Seedlabs

Context Firewall: Demonstration-Pattern Sanitizer for RAG and Agent Pipelines

A filter that removes hidden malicious instructions from documents before an AI reads them.

A filter that sits between a chatbot's document retrieval and the model, catching harmful question-and-answer 'demonstrations' hidden in retrieved or third-party text that could jailbreak the model, and stripping them out before the model reads them.

Computer ScienceAdversarial Robustness in Machine Learning
Reasoning and Retrieval OptimizationEnterprise RAG and agentic AI platform security

Concept

A filtering middleware that sits between a RAG pipeline's retrieval step (or an agent's tool outputs, or user-pasted documents) and the LLM's context window. It scans incoming text for the structural signature of in-context attacks — question–answer demonstration pairs, many-shot stuffing, harmful-request/completion patterns — and quarantines, truncates, or rewrites them before the model ever sees them, logging each event. The point is not to catch a cleverly worded user jailbreak (existing prompt-injection filters aim at that); it is to catch the specific mechanism the new paper demonstrates: harmful demonstrations sitting in the context window are sufficient on their own to jailbreak an aligned model, even when the end user's own prompt is benign. Any pipeline that injects third-party text — a poisoned knowledge-base document, a scraped webpage, a tool's output — inherits this attack surface, and this product closes it at the context boundary.

Why now

The new paper shows that a handful of harmful demonstrations alone raises ASR from 1% to 8% with a single shot, to 87% (Vicuna) and 46% (GPT-4) at 10 shots, and to 65–81% on GPT-4 at 15–20 shots — with no fine-tuning and no access to weights. That means untrusted text that merely ends up in the context window is an attack vector, which is exactly what RAG and browsing-agent pipelines create at scale. Older corpus paper [2] documents many-shot jailbreaking as a live threat to agentic systems that the static guardrails applied during supervised training cannot mitigate, and argues for runtime protective layers — which is the layer this product occupies.

Written by GLM · 8 Nov 2026

AI assessment

Backed by 2 papers86

A highly focused security middleware that addresses a specific, evidence-backed vulnerability in RAG pipelines by filtering structural 'many-shot' attack patterns from retrieved context.

Evidence strength
5/5
The idea is directly grounded in the provided full-text results showing a dramatic increase in ASR (up to 81% on GPT-4) specifically when harmful demonstrations are present in the context.
Market pull
4/5
Enterprise RAG users have a high urgency to prevent 'indirect prompt injection' where poisoned documents in a database can hijack the model.
Novelty & moat
3/5
While similar to RefusalShot and ShotCurve in theme, it shifts from 'defense-by-prompting' or 'testing' to a 'runtime-filtering' mechanism, filling a gap in active mitigation.
Feasibility
4/5
Building a pattern-matching or small-model classifier to detect Q&A structures in text is a straightforward engineering task for a small team.
Wedge clarity
5/5
The wedge is extremely sharp: a specific filter for 'demonstration-pattern' attacks sitting between retrieval and the LLM.
Simplicity / focus
5/5
The product is a single, well-defined middleware component with one clear purpose, avoiding the 'platform' trap.

Scored by Gemma 4 · 8 Nov 2026. Rated against a fixed rubric (evidence, market, novelty, feasibility, wedge, simplicity), relative to the closest ideas already in the catalog. A prior estimate to compare ideas before real-world signal arrives.

Act on this idea

Ideas only matter if someone runs with them. Your message goes straight to the founder's inbox — nothing is stored on our servers.

Who benefits

  • LlamaIndexcompany

    As a leading RAG framework, shipping a built-in context sanitizer closes a documented jailbreak vector (harmful demonstrations in retrieved text) for every application built on it.

  • LangChaincompany

    Its agent pipelines routinely stuff tool outputs and retrieved documents into the model's context; a demonstration-firewall middleware addresses the ICA/many-shot attack surface by default.

  • Weaviatecompany

    Its vector database sits at the retrieval boundary of RAG systems; scanning chunks for demonstration-pattern harmful content before they reach the model becomes a differentiating security feature.

  • Pineconecompany

    As a managed vector database for GenAI applications, a retrieval-time context-sanitization filter differentiates its offering against a newly quantified in-context attack threat.

Research it builds on

  1. Jailbreak and Guard Aligned Language Models With Only Few In-Context Demonstrations
    Zeming Wei, Yue Wang, Ang Li et al. · 2026 · 464 citations
    All ideas from this paper →
  2. Guardians of the Agentic System: Preventing Many Shot Jailbreaking with Agentic System
    Saikat Barua, Md. Mostafizur Rahman, Rafiul Islam et al. · 2025 · 6 citations
    All ideas from this paper →
Leave feedback
feasibility