Runtime & evidence

Decide each call before it leaves, and keep the proof.

Put a gateway in front of your MCP servers and your model that allows, redacts, tokenizes or blocks each call and its result, watch production runs for drift, and publish what you measured.

Runtime privacy gateway

Decide each tool call before it leaves.

Every other check reads a trace after the fact. agentleak proxy sits between your agent and an MCP server and judges each tools/call against your flow rules before it is sent. The call is allowed, redacted or blocked, and the decision goes into a hash-chained evidence log.

Three answers, decided in time

The proxy launches the real server as a child process and forwards JSON-RPC untouched, except tools/call, which goes to the policy first.

  • allow: the call passes unchanged
  • redact: only the refused values are removed, or swapped for a stable token
  • block: nothing is sent, and the agent gets a readable reason
  • Optional: the result is judged too, on its way back to the agent

Judge the flow, not the presence

A SIN sent to your KYC vendor for identity checks is fine. The same SIN sent to analytics is a leak. Rules name the data type, the sender, the recipient and the declared purpose.

  • The same rule grammar as the CI gate
  • Purpose read from the call's _meta
  • A missing purpose fails a rule that requires one
  • Deny beats allow, whatever the rule order

Evidence an auditor can check

Each decision is one line carrying the hash of the line before it. agentleak evidence verifies the chain and names the first entry that was edited, removed or reordered.

  • Hash-chained JSONL, optionally Ed25519-signed
  • Data types recorded, never raw values
  • Tool definitions pinned: a changed tool is reported
  • --verify and --public-key for a CI step

Guard an MCP server

{
  "mcpServers": {
    "github": {
      "command": "agentleak",
      "args": ["proxy", "--config", "agentleak.yaml",
               "--evidence", "evidence.jsonl", "--",
               "npx", "-y", "@modelcontextprotocol/server-github"]
    }
  }
}

Read the implementation guide →

Model gateway

The model is the other place data leaves.

Every prompt is a message to a third party, and a tool result pasted into the next turn carries whatever the tool returned. The same flow rules that guard MCP tools can guard the model: an OpenAI-compatible proxy, or a guardrail inside the LiteLLM proxy you already run.

No code change

Point the client's base URL at the proxy. Requests are judged with the provider as recipient; refusals come back as an error the OpenAI client already raises.

  • OPENAI_BASE_URL=http://127.0.0.1:8788/v1
  • messages, input and prompt judged
  • Redact, token, or a 403 refusal
  • Verified with the official openai client

Inside LiteLLM

Teams that already route through LiteLLM add AgentLeak as a custom guardrail: the request is judged before the call, and tokens are put back after it.

  • Subclasses LiteLLM's CustomGuardrail
  • Configured by environment variables
  • Deny raises; refusal reaches the caller
  • Same evidence log as the MCP proxy

What it does not do

A streamed answer is relayed without judging it — its request is still judged. Non-streamed answers can be judged with --inspect-responses.

  • Streams: request judged, answer relayed
  • Loopback by default
  • Stdlib only, no extra dependency
  • Signed evidence with --sign-key

Put it in front of your model

pip install agentleak
agentleak llm-proxy --upstream https://api.openai.com --config agentleak.yaml
export OPENAI_BASE_URL=http://127.0.0.1:8788/v1

Read the implementation guide →

Continuous privacy monitoring

Know when a safe agent starts to drift.

Prompts change, tools are added and models are swapped after release. AgentLeak samples live runs, watches the rolling privacy score and alerts on sustained regression or a severity the deployment has never produced before.

support-router / production5% SAMPLE
ROLLING SCORE88+6 since baseline
Window20 runsAlert on drop10 ptsNew severityImmediate
Monitoring in process · alert failures never interrupt the agent

Sample without owning the hot path

Score a configurable share of runs in process. Five percent gives a useful trend at production volume without turning every response into a security job.

  • Configurable sampling rate
  • Rolling score window
  • No background thread or timer
  • Optional workspace submission

Alerts that earn attention

Wait for enough evidence before alerting on ordinary drift, but report a severity the deployment has never seen on its first occurrence.

  • Sustained drop threshold
  • Optional absolute score floor
  • Immediate new-severity alert
  • Baseline follows improvement, not regression

Failure-isolated by design

Monitoring must never become the reason an agent stops serving users. Alert callbacks run outside the lock and their errors are swallowed.

  • In-process and thread-free
  • Alert failures do not propagate
  • Nothing leaves the machine by default
  • Same deterministic score as CI

Watch a sampled production run

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())

Read the implementation guide →

Verifiable public proof

Publish a privacy result others can verify.

Turn the latest AgentLeak run into a public trust page and README badge. Visitors see the score, verdict, measurement date, detection tiers and trend—never the findings or sensitive values behind them.

agentleak.org/a/support-botPUBLIC
AgentLeak privacy92 · passing
LATEST RESULT92Privacy score
Verdict
Passing
Measured
Today
Tiers
Pattern · Context
Latest run, never best run · findings stay private

Latest, never best

The badge cannot cherry-pick a passing result. It always follows the most recent run and turns grey after 30 days.

  • Latest run only
  • Stale after 30 days
  • 20-point score trend
  • Publishing is reversible

The strength of the check is visible

A pattern-only pass is narrower than a full pipeline pass. The page names the tiers that ran, and a degraded run can never display the passing colour.

  • Detection tiers named
  • Degraded state disclosed
  • Verdict and score dated
  • Plain-language caveats

Evidence stays private

Public proof confirms that a measurement happened and how strong it was. It never exposes the findings, trace contents or sensitive values.

  • No public findings
  • No trace contents
  • Self-contained page and badge
  • Works on hosted and self-hosted installs

Publish and link the latest result

curl -X POST https://www.agentleak.org/api/projects/<id>/publish \
  -H 'content-type: application/json' \
  -d '{"slug":"support-bot"}'

[![privacy](https://www.agentleak.org/a/support-bot/badge.svg)]
(https://www.agentleak.org/a/support-bot)

Read the implementation guide →

FAQ

Questions, answered.