Scrubbing and redirects
Checked with iron-vault 0.2.0-alpha (features: dev-mode), built from main at e10f09e. The streamed Venice chat
in step 2 needs a real Venice key and was not run, so no output is shown for it.
See the scrubber remove a credential from compressed and streamed responses, and what Iron Vault does with an upstream’s redirect.
Prerequisites
- The service running and Ready, with the
mecaller andhttpbinroute from getting started, andAUTHset as in that recipe. - For the streamed chat, the
chatcaller andvenice-chatroute from two keys, two callers, andCHATset as in that recipe.
Steps
1. Allow the paths
In dev-config.toml, widen the httpbin route’s paths:
paths = ["/anything/**", "/headers", "/gzip", "/stream/*", "/redirect-to"]
Approve it:
iron-vault config approve dev-config.toml
Your vault ID, digest and versions will differ:
Approval summary
vault: 7e3c6dfe-3a89-49ee-9f54-1e538dbfc4ed
version to commit: 3
config digest: blake2b:d5c63bfb9766ff1cbf98328c7c50f8e0fd4aeff2c1ce9f897567a59e361a6b5a
committed version: 2
routes:
~ httpbin: paths /anything/**, /headers -> /anything/**, /gzip, /headers, /redirect-to, /stream/*
Approve this config as version 3? Type yes to approve: yes
Approval passphrase for "approval passphrase":
approved version 3 (blake2b:d5c63bfb9766ff1cbf98328c7c50f8e0fd4aeff2c1ce9f897567a59e361a6b5a)
callers: none; route grants: none; routes: 1 changed; listeners: none; limits: none; logging: none; recovery: none
Wait a few seconds before the next step: the route’s bucket starts empty after the approval.
2. Scrub compressed and streamed responses
httpbin’s /gzip answers with a gzip-compressed echo, and /stream/3 with three streamed echoes:
curl -si -H "$AUTH" http://127.0.0.1:7878/httpbin/gzip
HTTP/1.1 200 OK
access-control-allow-credentials: true
access-control-allow-origin: *
access-control-expose-headers: Retry-After, RateLimit, RateLimit-Policy
date: Sun, 08 Nov 2026 12:11:08 GMT
x-content-type-options: nosniff
content-type: application/json
transfer-encoding: chunked
{
"args": {},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate, br",
"Authorization": "Bearer [iron-vault:scrubbed]",
"Host": "httpbin.org",
"User-Agent": "curl/8.5.0"
},
"method": "GET",
"origin": "203.0.113.7",
"url": "",
"gzipped": true
}
curl -sN -H "$AUTH" http://127.0.0.1:7878/httpbin/stream/3
{"id":0,"args":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Authorization":"Bearer [iron-vault:scrubbed]","Host":"httpbin.org","User-Agent":"curl/8.5.0"},"origin":"203.0.113.7","url":"https://httpbin.org/stream/3"}
{"id":1,"args":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Authorization":"Bearer [iron-vault:scrubbed]","Host":"httpbin.org","User-Agent":"curl/8.5.0"},"origin":"203.0.113.7","url":"https://httpbin.org/stream/3"}
{"id":2,"args":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate, br","Authorization":"Bearer [iron-vault:scrubbed]","Host":"httpbin.org","User-Agent":"curl/8.5.0"},"origin":"203.0.113.7","url":"https://httpbin.org/stream/3"}
In both, Authorization reads Bearer [iron-vault:scrubbed]. The /gzip response arrives without
Content-Encoding, decompressed for scrubbing. Each response produces a response.scrubbed record, with one match per
echo. This one is from /stream/3:
{"service":"iron-vault","service_version":"0.2.0-alpha","schema_version":1,"deployment_profile":"development","timestamp":"2026-11-08T12:11:11.628275Z","level":"WARN","message":"scrubbed a secret from a response","event":"response.scrubbed","request_id":"4efad803-1ac8-413e-9ad0-221632213ea0","route":"httpbin","credential":"httpbin_key","matches":3,"target":"iron-vault.audit"}
Venice’s chat route streams the same way, as server-sent events, with "stream": true (not run):
curl -sN -H "$CHAT" -H 'Content-Type: application/json' \
http://127.0.0.1:7878/venice-chat/chat/completions \
-d '{"model": "google-gemma-3-27b-it", "stream": true, "messages": [{"role": "user", "content": "Count to five."}]}'
3. See a redirect come back
Iron Vault never follows a redirect; it passes it back to the caller:
# a redirect within httpbin is rewritten under the route prefix
curl -si -H "$AUTH" 'http://127.0.0.1:7878/httpbin/redirect-to?url=/headers' | grep -i '^location'
# location: /httpbin/headers
# a redirect to another site is passed through unchanged; following it sends no credential
curl -si -H "$AUTH" 'http://127.0.0.1:7878/httpbin/redirect-to?url=https://example.com/' | grep -i '^location'
# location: https://example.com/
A redirect to the same origin but outside the upstream’s base path, such as /other from an upstream at /api/v1, is
refused with 502.
What can go wrong
403withpath_not_allowed. The route’spathsdon’t include the path; step 1 adds them.502with reasonredirect_refused. The upstream redirected outside its base path, as above.
Reference
- Audit log:
response.scrubbed. - Errors: the
502reasons. - Related: Basic authentication upstreams, which shows what the scrubber matches for a Basic credential.