Update (2026-08-22): the v1 99.4% holdout figure is withdrawn — that scorer classified on message length. v1.2.0 is the line to quote: on
deepset/prompt-injectionstest, Rules + ML scores 90% detection / 0% FPR and beatslen(text) > 430(54.2% balanced accuracy). Do not headline the in-house holdout. Details: KNOWN_LIMITATIONS.md.
Published: 2026-07-11 · GitHub · PyPI · Demo
Multi-agent systems trust messages between specialists — orchestrator, researcher, writer — without verifying content. One poisoned hop can hijack the entire pipeline. AgentGuard is a pip-installable Python middleware that inspects every inter-agent message at runtime.
Install: pip install inter-agent-guard (import as agentguard)
Repo: https://github.com/nizba06/agentguard (public)
Docs: https://inter-agent-guard.readthedocs.io/ (setup: docs/READTHEDOCS_SETUP.md if 404)
- Indirect injection in tool output and inter-agent messages
- Propagation across agent hops (LangGraph, CrewAI, AutoGen)
- Capability escalation and MCP tool-return poisoning
- Few public benchmarks aimed at inter-agent injection specifically
Three runtime layers:
- Message Inspector — Aho-Corasick rules + DeBERTa ONNX scorer + consistency check
- Trust Verifier — Ephemeral Ed25519 per-agent signing (PyNaCl)
- Capability Enforcer — YAML manifests (tools, endpoints, data sources, tokens, delegation) with monotonic attenuation
Plus MCP output inspection for tool-return poisoning.
py -3.12 examples/vulnerable_pipeline/pipeline.py # ATTACK SUCCEEDED
py -3.12 examples/secured_pipeline/pipeline.py # ATTACK BLOCKEDExternal (quote this): deepset/prompt-injections test, INT8 ONNX:
| Detector | Detection | FPR | Balanced accuracy |
|---|---|---|---|
length > 430 |
8.3% | 0.0% | 54.2% |
| Rules + ML | 90.0% | 0.0% | 95.0% |
In-house holdout (same generator as training — not a general-detection claim):
92.0% / 0.3% FPR, P95 ~3.3 s CPU. Release line is 1.2.0 (ONNX on GitHub
v1.2.0). See KNOWN_LIMITATIONS.md.
| Attack class | Detection rate (holdout, in-distribution) |
|---|---|
| GOAL_HIJACK | 91.5% |
| INDIRECT_INJECTION | 91.3% |
| MCP_POISONING | 95.6% |
| PROPAGATION | 89.2% |
CPU latency exceeds the 15 ms design target (~3.3 s P95). Use GPU or async for high-frequency traffic. Quote deepset test, not this table, for detection.
py -3.12 -m pip install "inter-agent-guard[all,otel]"
# Download risk_scorer.onnx from GitHub Releases into agentguard/models/
py -3.12 -m agentguard statusfrom agentguard import AgentGuard, CapabilityManifest
guard = AgentGuard(
risk_threshold=0.85,
task_objective="Analyse Q3 competitor pricing",
require_ml_model=True,
)
guard.register_agent("researcher", CapabilityManifest.from_yaml("manifests/researcher.yaml"))
secured = guard.wrap(my_langgraph_graph)Novel 6,200-example corpus (Anthropic Batch) is published on Hugging Face for evaluation reproducibility. The library never calls Anthropic at runtime.
- PyPI: https://pypi.org/project/inter-agent-guard/
- GitHub: https://github.com/nizba06/agentguard
- Dataset: https://huggingface.co/datasets/Nizba/agentguard-benchmark-v1
- Contributions welcome: adapters, rules, evasion reports
- InjecAgent (Zhan et al., 2024)
- AgentDojo / Task Shield consistency checking
- Multi-agent injection literature (MASpi / ACIArena)