APEX 100 · AI Security Red Teaming · #008 · Direct & Prompt — L1 · perimeter

Raw Control- and Special-Token Injection

Direct & Prompt · L1 · perimeter

Users paste <|system|>, 技[INST], or similar control tokens that were never meant to be visible. On some stacks they re-balance the context into an unfiltered region — the closest thing to code injection in prompt space.

01Control Architecture

How it is defended

Token scrubbing at the perimeter: all control tokens are stripped or escaped before the model sees input. The scrub runs on every surface, including tool outputs and retrieved documents, not just user text.

02Why It Breaks Naive Defenses

Users paste <|system|>, 技[INST], or similar control tokens that were never meant to be visible. On some stacks they re-balance the context into an unfiltered region — the closest thing to code injection in prompt space. Token scrubbing at the perimeter: all control tokens are stripped or escaped before the model sees input. The scrub runs on every surface, including tool outputs and retrieved documents, not just user text.

👤 Dr. Deepanjan Saha · Chief AI Security Red Team Principal & Chief Cybersecurity Architect (CAISO) · 15+ yrs · 47+ CVEs · 200+ pentests · 12 patents
📞 +91 98317 43870 · 💬 WhatsApp · ✉️ core.deepanjan@gmail.com · 🔗 LinkedIn: DRDEEPANJANSAHA · 🌐 drdeepanjansaha.github.io

Book the engagement that kills this, measured

Dr. Deepanjan Saha — Chief AI Security Red Team Principal & Chief Cybersecurity Architect. 15+ years · 47+ CVEs · 200+ pentests · 12 patents. Delivered as the release gate — a residual-risk number with a trend line, not a PDF.

03FAQ

Can users inject raw control tokens into an LLM?

On under-sanitized stacks, yes — pasted special tokens can re-frame the context. The perimeter strips or escapes every control token on every input surface, which makes the technique a no-op by construction.

How do you defend against raw control- and special-token injection?

Token scrubbing at the perimeter: all control tokens are stripped or escaped before the model sees input. The scrub runs on every surface, including tool outputs and retrieved documents, not just user text.

DR. DEEPANJAN SAHA · CHIEF AI SECURITY RED TEAM PRINCIPAL & CHIEF CYBERSECURITY ARCHITECT · AI SECURITY RED TEAM · EST. 2010 · 47+ CVEs · 200+ PENTESTS · 12 PATENTS