Skip to content

Add in-flight PII checks for traces using a fast model #29

Description

@marcusschiesser

Problem

AgentPond can ingest traces that may contain personally identifiable information in prompts, outputs, tool arguments, metadata, or span attributes. Today, PII handling is not called out as an in-flight trace guardrail. Users need a way to detect and optionally block, redact, or flag sensitive trace data before it is persisted or forwarded.

Reference: https://x.com/MaziyarPanahi/status/2073383825669849118

Proposal

Add an in-flight PII check path for traces that uses a fast, low-latency model/classifier suitable for request-time decisions.

Suggested behavior:

  • Inspect trace payloads before storage/export, including span inputs, outputs, attributes, events, metadata, and tool payloads.
  • Use a fast model/classifier for PII detection so the check can run inline without materially slowing ingestion.
  • Return structured findings with field path, PII category, confidence, and matched/redacted preview where safe.
  • Support configurable policy modes: off, log, redact, and block.
  • Support allowlists/denylists for known safe keys or fields that must always be checked.
  • Emit metrics/logs for detection count, latency, action taken, and failures.
  • Fail according to configuration, for example fail-open by default with an option for fail-closed in regulated deployments.

Acceptance Criteria

  • Users can enable in-flight PII checks for traces through documented configuration.
  • Trace ingestion applies the configured action before persistence/export.
  • PII findings are represented in a typed internal structure and are test-covered.
  • Redaction preserves trace shape while replacing sensitive values consistently.
  • Blocking returns a clear error that does not echo sensitive input.
  • Latency and model/classifier failures are observable.
  • skills/agentpond/SKILL.md and skills/agentpond/references/cli.md are updated if the implementation adds commands, flags, prompts, environment variables, or storage setup.
  • A changeset is added for the user-facing behavior change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions