Skip to main content
Back to how-to guides Use this pattern when the agent must collect a value such as an email address, a national ID fragment, or a PIN, and the value must not appear in traces, history, or model prompts.

Concept

Mark a field sensitive and the platform protects it in several places. Some protection is always on. Some depends on the project PII protection setting. Platform defaults differ by environment. PII protection is off by default in development, and on by default in staging and production. A project or tenant setting overrides the default. With protection off, sensitive: true does not stop the raw value from being stored in the session. It also does not hide the value from the model prompt. For example, an agent with inline_gather: true lists each collected value in its prompt under “Already collected”. Turn protection on in every environment that handles real data. See PII protection.

Minimal working example

An identity verifier collects an email address, the last four digits of a national ID, and a support PIN. Each field is sensitive. Each uses a different display mode. The verify_identity tool is a project-local assumption. Bind it to your identity service in Project Tools. agents/identity-verifier.agent.abl
Variable sources:
  • All three variables are GATHER fields that the customer supplies.
  • The tool reads them. The COMPLETE reply does not repeat any of them.

How it works

Properties that control protection: What each display mode shows: How the runtime handles a sensitive value:
  1. The customer’s reply to a pending sensitive question is saved in the history as the vault token, or [redacted] when no vault exists.
  2. With PII protection on, the runtime stores the value as a vault token. The raw value stays in the session vault.
  3. Tools receive the original value by default. Each time the runtime hands out a raw value, it records a pii_plaintext_dispensed event.
  4. Trace events for collection mask the value. Extraction traces redact a PIN or a CVV fully.
  5. Responses and other agents’ prompts have the exact stored value replaced by [redacted]. The match is exact. There is no detection.
  6. On a handoff, the context is tokenized. A child that collects a sensitive field is skipped when the runtime copies customer messages to the parent.
The field types password and passcode also count as sensitive for history, handoff, and response protection. They do not get vault tokenization or trace masking unless you also set sensitive: true. Write type: passcode and sensitive: true together.

Common variations

Sensitive field inside a FLOW step

Inside a step, keys are case-insensitive and fields use the list form. Pair the sensitive field with a tool call in the next step. The check step reads the value through the template, and the value reaches the tool through the vault. agents/pin-verification.agent.abl

Inherit protection from an entity

A field with entity_ref inherits sensitive from the entity. A field that sets sensitive: false overrides the entity.

Card and PIN entry by keypad on voice

A FLOW step can use SECURE_INPUT for payment card data on a live voice session. The digits never reach the model, the trace, or the session state. The step fails closed to its ON_FAIL route when no voice session exists. Treat it as a separate feature from GATHER.

Verification

  1. Run the validator. Expect no errors and no warnings.
  2. Confirm that PII protection is on for the project in the environment you test.
  3. Give a sample email, last four digits, and PIN.
  4. In the trace, open the dsl_collect and completion_check events. Expect [REDACTED] or a masked value, never the raw value.
  5. Open the conversation history. Expect the reply to the PIN question to show a token or [redacted].
  6. Give a wrong format for the last four digits. Expect the retry message not to quote the value.
  7. Check that the tool receives the original value, and look for the pii_plaintext_dispensed event.
  8. Turn PII protection off in a test project. Compare the stored session values. Expect raw values.

Production readiness checklist

  • PII protection is on for the project in every environment that handles real data.
  • Every sensitive field sets sensitive: true, not only a password or passcode type.
  • Every sensitive field sets sensitive_display on purpose. No field relies on the default.
  • sensitive is a lowercase true.
  • No reply template echoes a sensitive value.
  • A tool or COMPLETE rule reads each sensitive field. Otherwise the compiler warns UNUSED_REQUIRED_GATHER_FIELD.
  • A PII pattern name in pii_pattern_ref exists in the project.
  • Tests cover a valid value, an invalid value, and a correction.
  • Trace and log retention follow your data policy.

Common mistakes

Troubleshooting

Related articles: