feat: cache poisoning + cross-agent injection detection#321
Merged
andres-linero merged 1 commit intomainfrom Mar 8, 2026
Merged
feat: cache poisoning + cross-agent injection detection#321andres-linero merged 1 commit intomainfrom
andres-linero merged 1 commit intomainfrom
Conversation
Adds two new attack pattern detections targeting RAG/vector DB pipelines and multi-agent shared context surfaces: Runtime (detectors.py / patterns.py): - RESPONSE_INJECTION_PATTERNS: 7 regex patterns covering role overrides, jailbreak triggers, system prompt injection, instruction injection, task hijacking, exfil instructions, and prompt delimiter attacks - ResponseInspector: now detects prompt injection in any tool response (CRITICAL severity) - VectorDBInjectionDetector: new detector for cache poisoning via vector DB / RAG retrieval tools; identifies vector tool names, upgrades severity of all findings to CRITICAL for confirmed vector tools, tags alerts as cache_poison vs content_injection Toxic combos (toxic_combos.py): - ToxicPattern.CACHE_POISON: CVE in package backing a RAG/vector server + retrieval tool exposure = poisoned LLM context on every query - ToxicPattern.CROSS_AGENT_POISON: shared MCP server with write+read tool pair across 2+ agents = one agent can poison another's context - Context-graph-based detectors now run even when blast_radii is empty (structural risk detection without CVE data) Tests: 17 new test cases across TestResponseInspectorInjection, TestVectorDBInjectionDetector, TestCachePoison, TestCrossAgentPoison
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
andres-linero
approved these changes
Mar 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VectorDBInjectionDetector: new runtime detector for cache poisoning via RAG/vector DB retrieval tools — detects when retrieved context contains prompt injection payloads and upgrades severity to CRITICAL for confirmed vector toolsRESPONSE_INJECTION_PATTERNS: 7 patterns covering role overrides, jailbreak triggers, system prompt injection, instruction injection, task hijacking, exfil instructions, prompt delimiter attacksResponseInspector: extended to detect prompt injection in any tool responseToxicPattern.CACHE_POISON: CVE in package backing a RAG/vector server + retrieval tool = poisoned LLM context on every queryToxicPattern.CROSS_AGENT_POISON: shared MCP server with write+read tool pair across 2+ agents = one agent can poison another's retrieved contextAttack coverage added
VectorDBInjectionDetector+ToxicPattern.CACHE_POISONToxicPattern.CROSS_AGENT_POISON(structural, no CVE needed)ResponseInspectorinjection patternsTest plan
test_runtime_detectors.py,test_toxic_combos.py)