/**
 * Attribute scrubbing: the {@link SecretScrubber} segment-attribute processor.
 *
 * Trace attributes are an open `Record<string, unknown>` bag — callers stash
 * request payloads, tool arguments, headers, and model parameters in there, and
 * any of those can carry a credential. Before a {@link import('../signal/segment').Segment}'s
 * attributes leave the process (persisted by a sink, printed to a console), this
 * processor walks the whole bag and replaces anything that looks secret with an
 * inert {@link REDACTION_TOKEN}.
 *
 * Two independent signals trigger a redaction:
 *
 * - **Key shape** — the *path key* matches a {@link SecretPattern} (e.g. a field
 *   literally named `api_key`, `authorization`, `password`). The value is
 *   redacted regardless of what it is.
 * - **Value shape** — a *string value* matches a pattern (e.g. a `Bearer …`
 *   token or a `sk-…` style key) even when its key looks innocuous.
 *
 * The walk is a single iterative pass over an explicit work stack rather than a
 * recursive per-field branch cascade: every node (object, array, leaf) is
 * pushed once and handled by one uniform loop body, so arbitrarily nested
 * structures cost no extra call frames and there is no field-by-field `if`
 * ladder to maintain. The vocabulary is deliberately our own — `SecretScrubber`
 * and a guillemet redaction token, not an OTel "attribute processor" emitting
 * `[REDACTED]`.
 */
/**
 * A rule that flags a secret.
 *
 * `key` matches against the *name* of a field on the current path; `value`
 * matches against a *string* leaf. A pattern provides at least one of the two.
 * Patterns are tested with {@link RegExp.test}, so a global (`/g`) flag would
 * make matching stateful — supply non-global expressions.
 */
export interface SecretPattern {
    /** Human label, useful when reasoning about which rule fired. */
    readonly label: string;
    /** Matches a field/key name on the attribute path. */
    readonly key?: RegExp;
    /** Matches a string leaf value. */
    readonly value?: RegExp;
}
/** The inert string that replaces any redacted value. Not `[REDACTED]`. */
export declare const REDACTION_TOKEN = "\u2039redacted\u203A";
/**
 * The built-in rule set. Fresh wording — these are not lifted from any existing
 * processor's defaults. Tuned to catch the common shapes that show up in agent
 * trace attributes without being so broad they swallow ordinary text.
 */
export declare const DEFAULT_SECRET_PATTERNS: readonly SecretPattern[];
/** Construction options for a {@link SecretScrubber}. */
export interface SecretScrubberOptions {
    /** Override the default rule set entirely. Defaults to {@link DEFAULT_SECRET_PATTERNS}. */
    readonly patterns?: readonly SecretPattern[];
    /** Override the replacement string. Defaults to {@link REDACTION_TOKEN}. */
    readonly token?: string;
}
/**
 * A configurable, OTel-free attribute processor that redacts secret-looking
 * keys and values from a trace attribute bag.
 *
 * Stateless across calls and safe to share: {@link scrub} never mutates its
 * input and produces a fresh structure each time.
 */
export declare class SecretScrubber {
    private readonly patterns;
    private readonly token;
    /** Pre-split views so the hot loop never re-checks which rules have a key/value side. */
    private readonly keyRules;
    private readonly valueRules;
    constructor(options?: SecretScrubberOptions);
    /** True when a field name matches any key-shaped rule. */
    private keyIsSecret;
    /** True when a string leaf matches any value-shaped rule. */
    private valueIsSecret;
    /**
     * Decide a leaf's sanitized form given the key that points at it.
     *
     * Redacts when the key looks secret, or when a string value looks secret.
     * Non-string leaves under an innocuous key pass through untouched.
     */
    private sanitizeLeaf;
    /**
     * Return a deep copy of `attributes` with secret-looking keys and values
     * replaced by the redaction token.
     *
     * Walks the structure with a single explicit stack (no recursion). Containers
     * are cloned shallowly up front and their children enqueued; leaves are
     * resolved through {@link sanitizeLeaf}. The input — including nested objects
     * and arrays — is never mutated. A key whose name is itself secret short-
     * circuits the descent: the whole subtree under it collapses to the token,
     * so credentials nested inside (e.g. `auth: { token: … }`) cannot leak.
     */
    scrub(attributes: Record<string, unknown>): Record<string, unknown>;
}
