Decide each call before it leaves, and keep the proof.
Tools and the model are where data leaves an agent in production. The flow rules you test in CI decide each call at runtime, and every decision goes into a log someone else can verify.
- 2
- exits guarded: MCP tool calls and model requests
- 4
- answers per call: allow, redact, tokenize or block
- Ed25519
- signatures on every evidence entry, if you want them
01MCP gateway
Decide each tool call before it is sent.
agentleak proxy sits between your agent and an MCP server and judges every call (and, if you ask, its result) against the same flow rules the CI gate reads.
- A refused value is redacted or replaced by a stable token
- A changed tool definition is reported, or refused
- The agent gets a reason it can read, not a broken session
agentleak proxy --config agentleak.yaml --inspect-responses \
-- npx -y @modelcontextprotocol/server-github02Model gateway
The model is the other exit.
Every prompt is a message to a third party. The same rules apply to what the agent sends its model: an OpenAI-compatible proxy with no code change, or a guardrail inside LiteLLM.
- The base URL is the only change to the agent
- A refusal arrives as the client's own error
- Tested with the official openai client and LiteLLM
agentleak llm-proxy --upstream https://api.openai.com --config agentleak.yaml
export OPENAI_BASE_URL=http://127.0.0.1:8788/v103Continuous monitoring
Know when a safe agent starts to drift.
Prompts change, tools are added, models are swapped. Sample production runs off the hot path and alert on a sustained drop or a severity the deployment has never produced.
- Sampled: five percent is a useful trend
- Rolling score, floors and new-severity alerts
- The same detectors as the CI gate
from agentleak import Monitor, watch
monitor = Monitor(sample=0.05, drop=10, on_alert=notify_team)
if monitor.should_sample():
with watch(project="support-bot") as run:
answer = agent(request)
monitor.record(run.report.to_dict())04Evidence
Proof someone else can check.
Every gateway decision is appended to a hash-chained log you can sign with Ed25519. Publish the latest measured result on a trust page that says when it is stale.
- agentleak evidence --verify in CI
- Signed with --sign-key, verified with --public-key
- Opt-in public trust page and README badge
agentleak evidence --keygen keys/evidence.key
agentleak proxy --sign-key keys/evidence.key -- …
agentleak evidence evidence.jsonl --public-key keys/evidence.key.pubHow it fits together
- Write the rulesWho may receive which data, for what purpose, from which origin.
- Put the gateway in frontOf each MCP server and of the model; nothing else changes.
- Keep the evidenceA signed log for auditors, a trust page for everyone else.