Skip to main content
A pii_filter policy enforces on LLM responses routed through the MeshAI proxy. The highest-priority matching policy applies one of three actions before the response reaches the caller, and every detection is recorded as evidence in the Eval Log carrying type names and match counts only, never the matched values.

Create a PII Filter Policy

Rules are validated at creation, so a typo in action or an unknown type name is a 422, not a silent behavior change: Policies scope like any other: conditions supports agent_ids, team_ids, environments, and risk_levels. A one-click starter is available as the PII redaction for customer-facing agents policy template.

Pattern Set

Redaction scans each response text block independently and covers OpenAI (choices[].message.content) and Anthropic (content[] text blocks) response shapes. Non-JSON bodies pass through untouched.

Evidence

Every detection writes a row to the Eval Log (policy_evaluations) with the policy id, the action taken, the PII type names, and per-type match counts. The matched values themselves never leave the scan. Blocked responses and scan failures are also visible in request telemetry as error_type values pii_blocked and pii_scan_failed. Evidence rows ride the proxy’s asynchronous telemetry pipeline: enforcement is synchronous and guaranteed, the evidence write is best-effort under extreme load.

Scope and Limitations

  • Enforcement applies to proxy-routed traffic. Agents observed only through passive OpenTelemetry ingest have no response bodies to scan; on that path a pii_filter policy records a pass evidence row (“deferred to proxy response path”) so the policy stays visible in the Eval Log.
  • Streaming responses pass through unscanned. SSE chunks can split a match across boundaries, so the filter applies to buffered (non-streaming) responses and does not pretend otherwise.
  • Cost and token attribution always read the original upstream response, so redaction never distorts spend numbers.