Skip to main content

Use case

Redact internal identifiers, credentials, or any structured pattern from outbound HTTP bodies before they reach third-party services. Rules run at the sandbox’s edge proxy — they don’t require any scanner model, just a regex, and fire on every request to allowed destinations. Three common rule shapes:

Template

python — any template works; this recipe uses python for the verification probe.

Run it

Security policy

How the proof works

  1. Python script inside the sandbox POSTs a JSON payload to httpbin.org/post. The payload contains all three trigger patterns in raw form (INTERNAL-4242, AKIAIOSFODNN7EXAMPLE, password=hunter2).
  2. The edge proxy rewrites every rule with direction="outbound" or "both" before the request leaves the VM.
  3. httpbin.org echoes back what it received. The sandbox reads the echo, prints it as DEST_SAW:, and the Python driver reads it back through run_command.
  4. Three assertions run — each rule must remove the original and insert the replacement.

Expected output

Direction reference

Use inbound or both when your concern is received content — e.g. if an upstream service might leak credentials in its response and you want them stripped before the sandbox code sees them.

Full source

See cookbook/examples/openai-agents-transformations/main.py in the repo.