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:| Pattern | Replacement | Direction |
|---|---|---|
INTERNAL-\d+ | [TICKET_REDACTED] | outbound only |
AKIA[0-9A-Z]{16} | ***AWS_KEY_REDACTED*** | outbound only |
password=\w+ | password=[FILTERED] | both |
Template
python — any template works; this recipe uses python for the
verification probe.
Run it
Security policy
How the proof works
- 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). - The edge proxy rewrites every rule with
direction="outbound"or"both"before the request leaves the VM. - httpbin.org echoes back what it received. The sandbox reads the
echo, prints it as
DEST_SAW:, and the Python driver reads it back throughrun_command. - Three assertions run — each rule must remove the original and insert the replacement.
Expected output
Direction reference
direction= | Applies when |
|---|---|
outbound | Sandbox -> internet (request bodies) |
inbound | Internet -> sandbox (response bodies) |
both | Both request and response bodies |
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
Seecookbook/openai_agents_transformations.py in the repo.