Attackers use token smuggling to hide instructions or payloads inside text that an AI system parses differently from a human or downstream control. They may exploit token boundaries, encoding quirks, or splitting across fields to bypass filters. Defenders should normalise inputs, inspect pre- and post-tokenisation forms, and constrain where model instructions can appear.
How token smuggling works in practice
token smuggling is an input-shaping trick, so the attacker is not relying on a model “missing” the content so much as splitting interpretation across layers. A string can look harmless to a human, then become instructions after tokenisation, decoding, concatenation, or field parsing. That makes the attack especially useful anywhere multiple parsers, wrappers, or normalisers sit between the user and the model.
The technique often depends on boundary confusion. Attackers may use unusual spacing, encoding, punctuation, zero-width characters, escaped sequences, or content spread across separate fields so the human reviewer sees one thing while the model or downstream control reconstructs another. The practical danger is that filters, policy checks, and logging tools may inspect only one representation, not the form the model actually consumes.
Where defenders usually lose the control boundary
Token smuggling succeeds when security decisions are made on the raw text only, or on the post-processed text only, but not both. If a gateway, application layer, and model each normalise differently, an attacker can place instructions where one layer treats them as data and another treats them as control. That is why the control boundary must be explicit: what is user content, what is model instruction, and what can never be accepted as instruction at all.
For AI systems that accept structured inputs, the risk increases when free text, metadata, tool arguments, and system instructions are merged before the model sees them. The same issue appears in retrieval and orchestration flows when context is assembled from multiple sources. In those environments, token smuggling is less about clever wording and more about exploiting ambiguity in how the pipeline assembles the final prompt.
Token smuggling also matters because the model is not the only target. The attacker may be trying to bypass moderation, alter tool selection, poison downstream classification, or influence a human reviewer who only sees a sanitised view. That is why inspection has to cover the transformation chain, not just the final prompt.
Why normalisation and instruction boundaries are the real fix
The most reliable defence is to reduce ambiguity before the model ever sees the input. Normalise encodings, canonicalise whitespace and punctuation where safe, and compare the original and transformed forms so hidden structure does not slip through. Then separate user content from instructions with hard boundaries, rather than depending on prompt wording alone.
In practice, this means treating model instructions as privileged input and user text as untrusted content. Constrain where instructions can appear, reject attempts to inject instruction-like syntax into content fields, and make the application enforce roles for each segment of context. If a system can rewrite or reframe untrusted text into instruction space, the attacker already has a path to smuggling.
It also helps to inspect both pre-tokenisation and post-tokenisation representations, because the malicious form may only become visible after decoding or splitting. Validation should be consistent across the application, gateway, and model wrapper, otherwise one layer can pass content that another layer would have rejected. The point is not to guess every obfuscation trick, but to make the pipeline deterministic enough that hidden instructions cannot survive translation.
Risk and Threat Considerations
Token smuggling creates a trust-boundary failure between what a system thinks it received and what the model or downstream control actually processes. That can turn an ordinary user message into a policy bypass, a tool-call manipulation, or a moderation escape route, especially when text is transformed by multiple parsers before execution.
Failure mechanism: An attacker exploits encoding, boundary, or field-splitting differences so one layer sees harmless data while another layer reconstructs hidden instructions or payloads. The weakness is usually inconsistent normalisation or mixed handling of instruction and content channels.
Impact: The model may follow attacker-controlled instructions, leak restricted context, invoke tools incorrectly, or allow unsafe downstream actions. In systems that drive workflows or agentic actions, the effect can extend beyond a bad response to real operational abuse.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST AI RMF and OWASP ASVS set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | ASI02 — Tool Misuse | Token smuggling can steer tool calls and model actions through hidden instructions. |
| ASI09 — Human-Agent Trust Exploitation | The attack exploits differences between human review and model interpretation. | |
| Recommendation — Constrain tool invocation so only validated, intended instructions can trigger actions. Treat human-readable text and model instructions as separate trust zones. | ||
| NIST AI RMF | Govern | This attack pattern is a governance issue for prompt handling, boundaries, and oversight. |
| Recommendation — Establish policy for prompt boundaries, review, and escalation of prompt-injection risks. | ||
| MITRE ATT&CK | T1059 — Command and Scripting Interpreter | Hidden instructions can alter what the system executes or invokes downstream. |
| Recommendation — Map smuggled instructions to execution paths and monitor for unexpected command use. | ||
| OWASP ASVS | V8 — Authorization | The core failure is untrusted input crossing into privileged instruction space. |
| Recommendation — Enforce strict authorization boundaries between user content and executable instructions. | ||
Practitioner Guidance
What to verify: Check whether your system ever reserialises, decodes, concatenates, or rewraps user input before prompting the model. If yes, verify that the same canonical form is used for filtering, logging, and model submission, otherwise smuggling can reappear between layers.
Decision rule: If content can influence instructions, treat the boundary as a security control, not a formatting preference. If you cannot enforce that boundary reliably, restrict the feature so the model only receives narrowly scoped, structured inputs.
Common mistake: Relying on a single prompt filter or keyword blocklist. That approach misses transformed content, split payloads, and instruction text that only emerges after parsing or tokenisation.
Practitioner takeaway: The safest posture is to assume the attacker will test every representation of the same input, so your control must be consistent across raw text, canonical text, and model-ready text.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 17, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org