agenttap
Wire-level prompt introspection for LLM SDK calls. See exactly what was sent. Credentials redacted by default.
[]
= "0.1"
# Or, with reqwest-middleware integration:
= { = "0.1", = ["reqwest"] }
Why
Five years into the SDK era, "what was actually sent to the model?" remains a hard question. SDK debug logging is verbose, leaks API keys, and reformats payloads. agenttap provides redaction primitives plus an optional reqwest-middleware impl so you can capture the exact wire payload.
Quick start (manual)
use ;
use json;
let tap = new;
// After your HTTP call, hand the request and response details to the tap:
tap.record;
let last = tap.last.unwrap;
println!;
println!;
// auth header now: ***REDACTED***
With reqwest-middleware (auto-capture)
Enable the reqwest feature, then plug TapMiddleware into a reqwest_middleware::ClientBuilder:
#
#
Default redaction
- Headers:
authorization,x-api-key,api-key,cookie,set-cookie,anthropic-api-key,openai-organization,x-amz-security-token,x-google-api-key. - Body strings matching: OpenAI/Anthropic
sk-…, AWSAKIA…, GoogleAIza…, Slackxox[baprs]-….
Custom redactor:
use ;
let red = default
.with_extra_header
.with_extra_pattern
.unwrap;
let tap = new.with_redactor;
What it doesn't do
- Not a proxy. Not a server.
- v0.1 captures full bodies in memory only; persistence is your call.
- Streaming request bodies (where
as_bytes()isNone) aren't captured for the request side.
Sibling: Python agenttap
Python users with httpx-based SDKs: see MukundaKatta/agenttap.
License
MIT