Patchbay is a passive scanner by design. Point it at an MCP server and it runs 25-plus checks against OAuth 2.1, transport security, exposed secrets and tool descriptions. No execution. That design decision paid off for the first eight weeks. Static checks are cheap, reproducible and legal to run against anyone who publishes a public endpoint.
One finding category kept slipping past.
The tool-call return envelope. When a client invokes a tool and the server responds, the response body can carry poisoned instructions the static scan never sees because the scanner never invokes anything. The attacker writes nothing into the manifest, nothing into the tool description, nothing into the OAuth metadata. They control only what comes back when their tool is actually called. The static scan is blind to it.
A design partner working on an admission layer flagged this in writing earlier this month. Their framing was direct. The scanner catches first-layer envelope attacks but misses the second-layer return-content class entirely. They were right.
What POISONING-003 does
POISONING-003 is opt-in. It is a runtime check, not a passive one, so it runs only when the operator sets --probe-tool-calls and supplies a tool name (or uses the default-safe tool heuristic). The flow is small.
First, the check reads the tool manifest and picks a call-safe tool. Default heuristic: a tool whose scope is read-only, whose name matches get|list|read|describe|status, and whose declared schema does not accept free-form text that the server might treat as a side effect. Operators can override by passing an explicit tool name.
Second, the check invokes that tool with a controlled payload the operator confirms is safe (default: an empty object for parameterless tools, or a synthetic test fixture we ship with).
Third, the check inspects the response envelope. The scan looks for three patterns:
- Role-marker patterns like
<|system|>,<|assistant|>,[INST],### Instruction, and other model-specific delimiters that would be interpreted as new turn boundaries by downstream LLMs. - Hidden Unicode in the response body: zero-width characters (U+200B through U+200D), bidi overrides (U+202A through U+202E), tag characters (U+E0000 through U+E007F), and the soft hyphen (U+00AD).
- Imperative directives in natural-language response text that would read as new instructions to a downstream model. Patterns like ignore previous instructions, you are now, new system message, and the ten most common prompt-injection openers.
Each hit is reported as a finding with the exact byte offset in the response, the raw bytes, and a suggested fix. Severity is high when the response body is destined for direct model context and medium when it passes through structured post-processing first.
How it differs from POISONING-001
POISONING-001 stays as it was. It is a static check on the tool description inside the manifest, reading the same patterns against what the server exposes before any call.
POISONING-003 is the runtime counterpart. Same pattern logic, different source of bytes. Operators who already run POISONING-001 and see no findings can still have POISONING-003 fire if the server poisons only on specific invocations. The two checks are complementary, not redundant.
Running both covers the tool-description surface and the tool-response surface. Running POISONING-001 alone covers the first and misses the second. Running POISONING-003 alone covers the second and misses the first.
Why it is opt-in
Runtime probes touch the server. The static checks do not. We take that line seriously.
The default patchbay scan stays passive. You can run it against any public MCP server listed in the registry and the only requests you send are the ones a spec-compliant client would send at connect time: the initialize handshake, the metadata fetches, the tools-list call. Nothing a reasonable operator would object to.
POISONING-003 is different. It invokes a tool. Even when that tool is read-only by heuristic, the invocation leaves a log entry on the server side. We require operators to pass an explicit opt-in flag before the check runs, and we recommend running it only against servers you own or against the patchbay demo server at demo.patchbay-mcp.dev which is set up for exactly this.
Operators who want full coverage on servers they do not own should ask the operator first. Email, GitHub issue, or a reply to the scan-result email we send with the report URL. We publish the per-check scope policy at patchbay-mcp.dev/docs/scopes so everyone sees the same line.
The three-category output
POISONING-003 also marks the moment patchbay started writing findings in three categories, not one.
- source-confirmed: static read of the manifest or source caught the pattern. High signal, cheap to verify, low false positive.
- runtime-verified: a probe fired and the response confirmed the pattern. Highest signal, the finding reproduces on every run.
- potential-fp: the regex matched but context is ambiguous. For humans and engineering teams to triage, not for CI to fail on.
Every patchbay audit from 0.14 onward tags findings with one of these three categories. Report output, SARIF export and JSON mode all carry the tag. Reports under patchbay-mcp.dev/report/ show the tag as a colored pill next to each finding.
The split is cheap discipline. A scanner that treats every match as equal burns trust the first time a false positive costs an engineering team an hour. A scanner that admits its uncertainty earns a second look.
What is next
POISONING-004 is in the design doc. Same pattern-logic, different trigger: watching for return-envelope poisoning that appears only after a session reaches a specific state (for example, after a tool has been called N times with a particular argument shape). State-dependent poisoning is harder to probe and harder to detect, so we are still deciding whether the cost of the check justifies the catch rate. The design partner work continues.
How to run it
The check is in @patchbay-nebius/audit-core 0.14 and up. Usage:
npx -y @patchbay-nebius/agent audit https://your-mcp-server.example.com/mcp \ --probe-tool-calls \ --probe-tool-name=list_documents
Or against the patchbay demo:
npx -y @patchbay-nebius/agent audit https://demo.patchbay-mcp.dev/mcp \ --probe-tool-calls
The demo has a tool that returns poisoned content on purpose. POISONING-003 fires, runtime-verified, with the exact bytes in the finding. Good calibration test.
The GitHub Action wrapper accepts the same opt-in flag through the probe-tool-calls: true input.
Repository: github.com/GodSmasher/patchbay. Source for the check: packages/audit-core/src/checks/poisoning-003.ts.