Polygraph: Behavioral Trust Grades for MCP Servers
Agents wire up third-party MCP servers and then trust whatever those servers' tools
return. Polygraph tests an MCP server's behavior before your agent does, and assigns a
letter grade A–F backed by reproducible evidence.
A passing grade is a measurement, not a guarantee — it says "this exact tool surface
did not misbehave under these probes," and because the harness is open and deterministic,
anyone can re-run it and disprove a bad grade. That falsifiability is the whole point.
- Home / methodology: polygraph.so
- Lookup CLI (npm):
polygraphso - Grading harness:
@polygraphso/litmus(open source)
What a grade measures
Polygraph connects to a server the way an agent would — stdio for local packages,
Streamable HTTP for remote URLs — fingerprints its exact tool surface
(tools/list → canonical JSON → sha256 → bytes32), then runs four probe categories:
- C-01 — Tool-output injection. Does the server try to hijack the agent? Static scan of
tool names/descriptions/schemas for injection-shaped content (invisible unicode,
instruction mimicry, markdown tricks) plus dynamic bait calls that check whether tool
outputs smuggle in instructions.
- C-02 — Permission / egress overreach. Does the server do more than it claims? Flags
tools that declare readOnlyHint: true but carry destructive verbs, and runs the server in
a hardened default-deny Docker sandbox where any outbound network attempt is a finding.
- C-03 — Sensitive-data handling. Does the server leak secrets? Plants canary values in
the environment and working directory, exercises the tools, and scans both tool outputs and
egress for any canary that surfaces.
- C-04 — Adversarial-input handling. Does the server stay robust under hostile input? Runs
two probes on non-state-changing tools, with no Docker required: stress-tests each tool with
malformed and oversized inputs (fails if the server crashes, hangs, or leaks an uncaught
stack trace — a clean validation error or benign result passes); and feeds jailbreak-pattern
strings and scans the server's outputs with the C-01 injection scanners, failing only if
the server emits injection-shaped content it did not merely reflect from the input (a verbatim
echo is excluded). A C-04 failure caps the overall grade at D.
Grade scale
| Grade | Meaning |
|-------|---------|
| A | Passed all four categories. No injection, no unexpected egress, no data leak, no adversarial-input failure. |
| B | Injection and data-leak checks passed; egress was not verified. The ceiling for any run without a local Docker sandbox — including every remote (HTTP) server, which can't be sandboxed. |
| D | Unexpected egress / permission overreach (C-02) or an adversarial-input robustness failure (C-04: crash, internals-leak, or amplification). No injection or leak → capped at D. |
| F | Disqualifying: active tool-output injection (C-01) or a sensitive-data leak (C-03) — a server that would harm an agent that trusts it. |
Reading a B. Under the current methodology, egress can only be observed by running the
server in a local default-deny sandbox — so a remote MCP server caps at B no matter how
clean it is. A remote B is a limit of the measurement, not a mark against the server; don't
read it as "worse than" a local A, because the two aren't directly comparable. (Grades C
and E are not assigned today; C is reserved.)
Every grade ships with a plain-English rationale — never a bare letter. See