Skip to main content
Tool arguments and results often contain personal data: an email address, a phone number, an account number. A redaction config replaces those values with [REDACTED] before RootSign hashes and stores the call, so the raw value never reaches the session file, the database or an evidence bundle, and it cannot be recovered from the stored hashes. The chain still verifies, because it is built from the redacted values.

Redact a tool’s inputs and outputs

1

Pick a config

StandardPIIConfig covers email, phone, US Social Security, credit card and UK National Insurance numbers. Pre-built configs lists the others.
2

Pass it where you instrument

Every instrumentation entry point takes redaction_config=:
support.py
3

Check what was stored

Run it and look at the two action records in the session file:
lookup_customer
email_customer
The email and phone fields were redacted wherever they appeared, including the email passed positionally. The second tool’s result still contains the address. The next section explains why.

How matching works

A value is redacted when its field name has a rule and the value matches that rule’s pattern. Field names are matched wherever they are nested:
Free text is not scanned. Rules match field names, then test the value. A string in a field whose name has no rule, such as a tool’s plain-text result, a body or a notes field, is stored as it is, even if it contains an email address. Return structured results with named fields, or add a rule for that field name.
Redaction of positional arguments by parameter name was added after RootSign 0.3.1. In 0.3.1 and earlier, email_customer("alice@example.com", ...) stored the address unredacted; only the keyword form was redacted.
Other details:
  • Numbers are matched by their text form, so an account number stored as a JSON number is redacted like a string.
  • Lists are walked item by item, and each item is matched under the list’s field name.
  • Past five levels of nesting, the whole value is replaced with [REDACTED] rather than stored unchecked.

Pre-built configs

The patterns are deliberately broad: they accept some false positives to avoid false negatives. Each field name has one pattern, for example ssn matches nine digits with optional separators and iban matches the international bank account format. The full patterns are in rootsign/sdk/redaction.py.

Add your own rules

All three pre-built configs take extra_rules, a dictionary of field name to regular expression, added to the built-in rules:
extra_rules on FinancialPIIConfig and HealthcarePIIConfig was added after RootSign 0.3.1. In 0.3.1 and earlier, only StandardPIIConfig accepts it.
To start from nothing, build a RedactionConfig with only your rules:
For a function traced with @rootsign.trace, a path starts at the top of what RootSign records for the call: kwargs.<parameter> for an argument (a positional argument is matched at the same path) and result for the return value, so result.email matches an email field in a returned dictionary. LangGraph tools, CrewAI tools and the MCP proxy record inputs in other shapes, shown on each integration page, so prefer bare names there.
A dotted path that does not start at kwargs or result never matches a tool call. "customer.tax_id" redacts nothing, because the recorded input is {"args": [...], "kwargs": {"customer": {...}}}. Write "kwargs.customer.tax_id".
When a path rule and a name rule both match a field, the path rule wins. Pass match_mode="path" to treat bare names as paths too, so that "email" no longer matches nested fields.

What gets recorded

  • The redacted value is the literal string [REDACTED].
  • input_hash and output_hash are hashes of the redacted payload, so the original value cannot be recovered from them, and the chain verifies as VALID.
  • An evidence bundle lists every redacted field in redaction.json. For the example above:
    redaction.json

What it does not do

  • It does not scan free text, as described above.
  • It does not record which config was used. A bundle shows which fields were redacted, not which rule caused it.
  • It cannot redact retroactively. Records written before you added a config keep their original values. To withhold stored content from a bundle you are about to share, use --redact-previews when you export.
  • It applies to tool calls. The session objective you pass to rootsign.session() is stored as written.

How it works

What each hash covers and how redaction fits before hashing.

Export an evidence bundle

Read redaction.json and withhold content when you share a bundle.