
An agent can expose data through a tool, not just a prompt. An agent does more than answer. It plans, calls tools, reads files, writes to systems and keeps memory. Masking the first prompt is not enough if the agent later retrieves an unmasked record or passes a value to a tool.
Part of prompt and agent redaction. For the adjacent case, read prompt redaction and prompt redaction. The wider branch is redact before ai.
What leaves the document
Map the tools, the memory and the traces. Put the redaction step before every model call that carries document text, keep the token mapping outside the agent, and scope every tool to the minimum it needs. An agent with broad tool access is a data path, not a feature.
Where the data hides
The prompt is only one layer. Check:
- Tool arguments that carry names or account numbers
- Retrieved documents passed into context
- Agent memory and conversation state
- Trace logs with prompts and outputs
- Files written by the agent to another system
The redaction flow
- List the agent's tools and the data each one can read or write.
- Mark the point where document text enters the model.
- Mask before that point and keep the mapping outside the agent.
- Review the trace for values that bypassed the mask.
- Revoke tool scopes that are not needed for the task.
Controls to verify
- A redaction step on every model call, not only the first.
- Tool scopes with least privilege and a named owner.
- Memory and trace retention limits.
- A test that seeds a unique value and searches the traces.
- A human approval for write actions.
Retention and evidence
Agent traces often outlive the task and are the most overlooked copy. Ask where the trace is stored, who can read it and how long it is kept. If the agent writes to a CRM or a ticket, that system keeps another copy with its own retention.
Limits
Masking the prompt does not mask a tool result that arrives later. An agent can infer a value from context, and a tool can return an unmasked record. No gateway fixes a tool permission that is too broad.
Why agents multiply exposure
A chatbot answers one prompt; an agent acts on one and plans the next. The pasted file becomes ten tool calls — a search, a spreadsheet write, an email, a calendar invite — and each call is a new disclosure to a new surface. Agents also accumulate memory: summaries of past work, cached preferences, profiles of the people mentioned. The exposure is not the prompt but the graph the prompt grows into.
The controls that keep agents usable
Three controls carry most of the safety. Scope the tools: an agent that can read the drive and send mail is one bad prompt from a leak; grant the minimum tool set per task. Human gates on irreversible actions: the agent drafts, the person sends. And an identity for the agent's calls: its API key should authenticate as the agent, so the logs show which machine acted. Mask before the agent starts, and the multiplication happens on masked values.
The audit question
When the agent does something surprising, the investigation needs its trace: which tools it called, with what arguments, in what order. Platforms that expose this trace are the only ones suitable for sensitive work; the ones that answer 'the model decided' are telling you the governance is outside the building. Ask for the trace before the first deployment, not after the first incident.
How Veilbrook fits
Veilbrook can mask document text before a model call and restore values on your side where the flow supports a gateway. Agent tools, memory and traces need separate controls; the gateway is not a substitute for scoped access.
Questions for the vendor
- Which tools can the agent call?
- Where is the memory stored and for how long?
- Are traces kept with the full prompt?
- Can a tool return an unmasked record?
- Who approves write actions?
Before you send
Classify the document, mask the identifiers, attach only what the task needs, and keep the mapping outside the tool. After the answer, restore the values on your side and check that the output did not reintroduce one. If the tool keeps the conversation, decide the retention before you start. A receipt is not a substitute for a review.