v0.8.33 — Tool-output trust-boundary guard (Agentjacking class)
Added
feat(policy): add tool-output trust-boundary guard for Agentjacking-class untrusted-output injection
The mirror of every existing Airlock layer: those guard the input side of the tool seam; this guards the output side — a tool/MCP result about to flow back into the agent's context, treated as untrusted data rather than instruction (OWASP-MCP MCP08).
Threat model — two reference cases:
-
Agentjacking (Tenet Security, disclosed 2026-06-12; Sentry mitigation 2026-06-18) — a vulnerability class, NO CVE ID. A fake Sentry error (public DSN) is fed to an AI coding agent by the Sentry MCP server; the agent runs the attacker's "resolution steps" shell commands. System-prompt "distrust external data" did not stop it — hence a code-level output trust boundary.
-
CVE-2026-42824 "SearchLeak" (M365 Copilot Enterprise, Varonis, disclosed 2026-06-15) — Parameter-to-Prompt injection; untrusted output reaches the model as instruction.
-
ToolOutputTrustGuard(tool_output_trust_guard.py):inspect(output)flags override directives, imperative command directives, fenced shell commands (the Agentjacking "resolution steps" shape), and tool-call-shaped JSON in diagnostic/error fields.process(output)STRICT-default wraps the result in a delimited untrusted-data envelope (treat as data, never instructions). Never executes, never silently drops. Flags emit a structured event bridged to OTel. Zero-dep core. -
policy_presets.untrusted_tool_output_defaults()+ theUNTRUSTED_TOOL_OUTPUTpreset constant — opt in per tool (severity=high,default_action=flag_and_envelope,owasp=MCP08). -
18 tests; built-wheel smoke confirms a forged "resolution steps" output is flagged + enveloped and a benign result is not. Pydantic-only, zero-dep core. (#101)
Sources: https://labs.cloudsecurityalliance.org/research/csa-research-note-agentjacking-mcp-sentry-injection-20260612/ · https://www.varonis.com/blog/searchleak