Skip to content

fix: avoid duplicate injection alerts for non-vector tools in proxy#327

Merged
andres-linero merged 1 commit intomainfrom
fix/proxy-dedup-vector-alerts
Mar 8, 2026
Merged

fix: avoid duplicate injection alerts for non-vector tools in proxy#327
andres-linero merged 1 commit intomainfrom
fix/proxy-dedup-vector-alerts

Conversation

@msaad00
Copy link
Owner

@msaad00 msaad00 commented Mar 8, 2026

Summary

Follow-up to #326. VectorDBInjectionDetector.check() always runs RESPONSE_INJECTION_PATTERNS for every tool, regardless of whether it's a vector tool. Running both response_inspector.check() and vector_detector.check() for all tools caused duplicate injection alerts for non-vector tools.

Fix

Only invoke vector_detector.check() when vector_detector.is_vector_tool() returns True.

Non-vector tools: ResponseInspector handles cloaking + SVG + invisible chars + base64 + injection — no change.

Vector tools (similarity_search, retrieve, rag_query, fetch_context, etc.): ResponseInspector fires first (HIGH severity), then VectorDBInjectionDetector fires additionally (CRITICAL severity, cache_poison_* tagged). The dual alert is intentional — it gives operators a CRITICAL-severity signal specifically for RAG/vector retrieval paths.

Test plan

  • 88 runtime + proxy tests pass
  • No ruff/format warnings

ResponseInspector already checks RESPONSE_INJECTION_PATTERNS for all tools.
VectorDBInjectionDetector.check() also always runs injection patterns, so
calling both for non-vector tools produced duplicate alerts.

Fix: only call vector_detector.check() when is_vector_tool() returns True.
Non-vector tools: ResponseInspector covers cloaking + SVG + invisible + injection.
Vector tools: ResponseInspector (HIGH) + VectorDBInjectionDetector (CRITICAL,
cache_poison_* tagged) — intentional dual signal for elevated risk.
@msaad00 msaad00 requested a review from andres-linero as a code owner March 8, 2026 00:54
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@andres-linero andres-linero merged commit 77e9e2c into main Mar 8, 2026
18 checks passed
@andres-linero andres-linero deleted the fix/proxy-dedup-vector-alerts branch March 8, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants