Streaming Redaction

PocketPaw automatically scans agent output for API keys, tokens, and credentials, replacing them with [REDACTED] before they reach the user. This operates at the message bus level, making it backend-agnostic.

How It Works

Agent backends stream responses in small chunks. A secret like sk-ant-api03-abc123... could be split across two chunks, making per-chunk scanning unreliable.

PocketPaw uses buffer-based redaction:

  1. Raw chunks are accumulated into a streaming buffer
  2. The full buffer is scanned for secret patterns on every chunk
  3. Only the newly safe portion (delta from last publish) is sent to the user
  4. This catches secrets that span chunk boundaries

Detected Patterns

The redaction engine covers 19 secret patterns:

PatternExample
OpenAI API Keysk-abc123def456...
Anthropic API Keysk-ant-api03-...
AWS Access KeyAKIAIOSFODNN7EXAMPLE
AWS Secret KeyAWS_SECRET_ACCESS_KEY=wJalr...
GitHub Tokenghp_abcdefghijklmnop...
Google API KeyAIzaSyDaGmWKa4JsXZ...
Stripe API Keysk_live_XXXXXXXX...
Slack Tokenxoxb-0000000000-...
Bearer TokenBearer eyJhbGciOi...
JWT TokeneyJhbGciOi...eyJ...eyJ...
Private Key Header-----BEGIN RSA PRIVATE KEY-----
Generic API Keyapi_key=abcdef123456...
Generic Tokenaccess_token=longtoken...
Env Var SecretPASSWORD=SuperSecret...
Basic Auth URLpostgresql://user:pass@host
PocketPaw API Keypp_abc123...
PocketPaw OAuth Accessppat_abc123...
PocketPaw OAuth Refreshpprt_abc123...

Always On

Streaming redaction is enabled by default and cannot be disabled. It runs on all agent output regardless of backend or channel.

Info

Streaming redaction protects against accidental leaks in agent output (e.g., when the agent reads a .env file or echoes a config). It does not replace proper secret management. Store API keys in PocketPaw’s encrypted credential store, not in plain text files.