Redact data in tool calls
Redact sensitive data from MCP tool responses before the agent sees it.
A tool response can carry SSNs, API keys, or email addresses that the agent has no need to see. Data Protection response filters redact that text after the call is allowed and before the agent reads the result.
What a filter does
A filter never allows or blocks a call: Agent Access decides whether a call runs, and a filter only rewrites the response. Every active filter whose scope matches a call applies, in no fixed order. You scope a filter by MCP server, agent, user, group, or tool pattern, with the same pills that Agent Access uses.
Patterns and AI judges
A pattern is a regular expression paired with a replacement, which is [REDACTED] when you leave it blank.
Browse presets adds patterns for common data such as email addresses, SSNs, card numbers, and API keys.
An AI judge takes a plain-language instruction for data that a pattern can't describe, and costs a model call.
What gets rewritten
A filter rewrites the text in the response's content blocks and every string inside its structured content, including object keys. Images and other binary content pass through unchanged. Filters apply to error results too, because an error message can carry the same data. Each call with a redacted response shows a Redacted ×N badge in the audit log.
Test a filter before it redacts
A filter that matches too much hides text the agent needs, so try a new filter in log-only mode first.
- In the filter editor, under When a filter matches, turn off Redact the content to run the filter in log-only mode. New filters start with Redact the content on.
- Set the status to Active and let the filter run on real traffic. Every response reaches the agent unchanged, and the filter records what it would have redacted.
- In the audit log, look for calls marked Would redact ×N, logged but not redacted. Hover over the badge to see how many spans each log-only filter matched.
- When the matches look right, edit the filter and turn on Redact the content.
A log-only filter never blocks a call, even when its AI judge fails or its pattern no longer compiles.
In the API, log-only is the log_only action.
For how filters combine, AI judge setup, and failure handling, see Data Protection.