Skip to content
Agentic Control Plane

PII Detection and Redaction

ACP scans agent tool calls for SSNs, card numbers, emails, phone numbers, IBANs and IP addresses. On a match it records it, removes it, or blocks the call. Which of those works depends on the harness (the coding agent: Claude Code, Cursor, Codex and so on), and the terminal tells you which one happened.

Until 14 November 2026 that last part wasn’t true. On the hook path, ACP printed “redacted” while the model still saw the original value, and the detector matched card numbers without a checksum. Both were fixed and deployed that day. The tables below describe the fixed behaviour.


What leaves your machine

  • Before each call, the hook sends the tool name and arguments to the ACP gateway. After the call, it sends up to 200 KB of the result so the scan can run.
  • By default the stored record is metadata: tool, decision, who ran it, timestamps, and the PII types found, not the matched values.
  • Argument and result previews are off unless you turn them on in the console’s Logging page. They are capped at 1,500 characters. With previews on, matched values can be stored in them unless your PII setting is redact or block.
  • A call held for approval keeps up to 500 characters of its arguments, unredacted, for the approver.
  • Records are kept for 12 months.
  • If the gateway can’t be reached, the call isn’t scanned. Interactive Claude Code sessions go ahead with an UNGOVERNED notice. Unattended tiers are blocked until the gateway answers. When ACP is unreachable has the details for each harness, and the privacy policy has the full list.

What counts as a match

A value has to pass a check, not just look right:

  • Cards: a known issuer prefix, a valid length and a passing Luhn checksum.
  • SSNs: a range the SSA issues. Known sample numbers are excluded.
  • IBANs: the mod-97 checksum and the right length for the country.
  • IP addresses: must parse. Version strings and private or loopback addresses are skipped.
  • Phone numbers: must parse as a real number.
  • Emails: git remotes like git@github.com: and reserved domains like example.com are skipped.

Words nearby, such as “ssn”, “card” or “phone”, raise confidence. This is why fake test data often isn’t flagged: example.com addresses, published test card numbers and sample SSNs are all excluded on purpose.


Platform rules (always on)

A few rules can’t be turned off, even by a workspace admin. They run before any other policy.

Rule What it blocks
SSN A valid-range SSN with a label in the preceding few words: “ssn”, “social security”, “ss#”, “taxpayer” or “tin”. An unlabelled SSN-shaped number is left to your PII setting
Card A number that passes the issuer, length and Luhn checks. Published test card numbers are allowed
SSRF Requests to private or cloud-metadata addresses

Because nobody can override them, they only look where a match means data is about to leave:

  • On ACP’s MCP endpoint and model proxy, they check the arguments of action tools.
  • On harness hooks, they check only tools that send data out: MCP tools, WebFetch and WebSearch. Shell commands, file edits and grep patterns are never blocked by these rules.
  • They never check conversation text, tool outputs, or authored content such as file writes, task lists, subagent prompts and plans.

The SSRF rule blocks localhost and private ranges only for tools the ACP gateway runs itself. On your own machine it blocks only cloud-metadata endpoints (169.254.x.x, metadata.google.internal). On hooks, it applies only when a URL-fetching tool targets one.


Your PII setting

In the console’s Policies page, each agent tier and each tool has a PII setting. It applies to calls reported by harness hooks.

Setting What happens
Off No scan on the hook path
Detect only Recorded in the audit log, data left alone
Detect & redact Each match becomes [REDACTED:<type>], e.g. [REDACTED:email], where the harness allows it
Detect & block The call is denied before it runs. A tool’s output can only be withheld on Claude Code and in the SDKs

Calls through ACP’s MCP endpoint follow the workspace content settings instead. On the Free plan those detect but don’t redact or block.


Where removal works today

Where the call runs Tool input Tool output
Claude Code, with ACP plugin 0.31.0 or later Rewritten for MCP tools, WebFetch and WebSearch Rewritten for Bash, Read of a text file, and MCP text results
Qwen Code Rewritten for MCP tools, WebFetch and WebSearch Detected only
Python and TypeScript SDKs (@governed) Detected only Replaced with the redacted text
Claude Code launched with claude-acp (model calls through ACP’s proxy) n/a Masked in the request before the model provider receives it, on every plan and setting
Cursor, Codex CLI, GitHub Copilot, pi, dsh, Prime Agent and other harnesses Detected only Detected only

Notes:

  • Shell commands and file edits are never rewritten, because changing a command can change what it does. Use Detect & block to stop those.
  • Proxy masking changes what the model provider receives. The original value stays in the session transcript on your machine.
  • ACP claims removal only after re-scanning the rewritten payload. If PII is still there, or the payload is too large to rewrite safely, the call is recorded as detected.
  • The pi, dsh and Prime Agent plugins contain redaction code but read a field the gateway doesn’t send. Until their plugins are updated, treat them as detection only.

What you see in the terminal

On harnesses that show ACP’s messages, a PII result prints one line:

  • [ACP] Removed PII before the agent saw it: email ×2, phone.
  • [ACP] PII detected (email). This agent can't strip it from tool output, so it reached the agent unchanged.
  • [ACP] Blocked: this call contained PII (ssn). Nothing ran.

In detect-only mode, the line appears once per session rather than on every call, with a link to turn on redaction. Every other line says whether the data reached the agent.


Custom patterns

Add regex patterns for your own identifiers, such as EMP-[0-9]{5} for employee IDs, in Policies → Patterns or through the admin API:

curl -X POST "https://api.agenticcontrolplane.com/$SLUG/admin/pii-patterns" \
  -H "authorization: Bearer $KEY" \
  -H "content-type: application/json" \
  -d '{"type":"employee_id","pattern":"EMP-[0-9]{5}","flags":"g"}'

$SLUG is your workspace slug and $KEY an admin API key, both from the console. The API rejects patterns that backtrack catastrophically. The console warns about them but saves them anyway. The type name shows up in the audit log and in the placeholder.


Audit log

A scan that finds PII adds this to the call’s record:

{
  "tool": "mcp__salesforce__query",
  "contentScan": {
    "piiDetected": true,
    "piiTypes": ["email", "phone"],
    "piiCount": 3,
    "action": "redacted",
    "applied": true
  }
}

action is detected, redacted or blocked. applied is true only when the change took effect. A block on a tool’s output, on a harness that can’t withhold it, records blocked with applied: false, because the output reached the agent. One known gap: SDK calls currently record detected even when the SDK replaced the output.

The console counts “PII detected” and “PII removed” separately. Records from before 14 November 2026 show “removal not confirmed”.


Compliance mapping

ACP supports these requirements. It does not make you compliant by itself.

Regulation Requirement What ACP provides
SOC 2 CC7.2 Monitor for anomalies PII findings in the audit log, with what was done about each
GDPR Art. 32 Appropriate technical measures PII detection on governed tool calls, and removal where the table above says it works
HIPAA § 164.312 Access controls for ePHI Custom block patterns for identifiers your workflows use
PCI DSS Req. 3 Protect stored cardholder data Blocks Luhn-valid card numbers in outbound tool arguments. ACP does not scan stored data
CCPA § 1798.150 Reasonable security measures PII detection on governed tool calls, with scope set by your policy

Back to guides · SOC 2 audit trails → · Set up Auth0 →

Running coding agents? ACP records each tool call its hook sees and makes the dangerous shell commands (a force-push, destructive SQL, curl | sh) wait for you. One command, free up to 5 agents:

macOS · Linux · WSL
curl -fsSL https://agenticcontrolplane.com/install.sh | bash
Windows · PowerShell
irm https://agenticcontrolplane.com/install.ps1 | iex

What the installer writes  ·  Getting started