Oops!... I Parsed It Again: Tool-Call Smuggling Against LLM Agents
Organizations: Universidad Internacional de La Rioja · Proeduca Summa
Abstract
LLM agents act through tool calls: the model writes the arguments of a call as JSON, a guard decides whether the call may run, and an executor runs it. The same bytes are parsed several times, by the provider, gateways, SDKs, frameworks, the guard, and the executor. JSON leaves some choices to each parser, such as which copy of a repeated key counts. When the guard and the executor choose differently, the guard approves one call, the executor runs another, and the audit log records the approved one. We introduce this attack, tool-call smuggling, and study it across the stack. We describe six ways in which the same bytes yield different calls and build a differential testing harness that gives identical bytes to 17 pinned parser and validator configurations; most pairs disagree on some inputs, and even two official MCP SDKs accept different inputs. On tasks from -bench and AgentDojo, an attacker who can rewrite the bytes in transit cancels another customer's reservation and creates a file that the guard blocks by name, while the audit log names only the approved call. Content the model reads splits guard and executor only inside a string: ten models we test write no repeated or disguised key into the call itself where we see it, but copy one verbatim into JSON text in an argument, which a Python guard and a Go executor read differently. A malicious server copying a legitimate tool's public schema and adding one field, which a note explains, gets the model to fill it, unseen by the guard, with user data. Parsing each call once, JSON text included, keeping only the fields of the approved schema, and handing it to the executor, sealed with its call ID in transit, stops all 7,412 crafted inputs and every attack we built.
Figures & tables
| Vector | Example bytes | One reading | Another reading | Observed on | Delivered by | Earlier cases |
|---|---|---|---|---|---|---|
| V1 Repeated or disguised keys | {"id": "I3EHXC", "id": "U86B6B"} "action\u0000": "delete" | first copy: I3EHXC ; the NUL key is another key | last copy: U86B6B ; the NUL key replaces action | CPython, SDK R server path, segmentio 0.5.3 | T3; T1 in JSON text | [ 6 , 20 , 21 ] |
| V2 Type conversion | "count": "12" "count": 1220772038000446658395696 | SDK X: 12, and the large integer as sent | SDK R server path: rejects both | official MCP SDKs, CPython, stack Y | T3; T1 in JSON text | [ 37 ] |
| V3 Escapes and Unicode | "filename": "credenti\u0061ls.txt" | raw-text filter: no credentials in the bytes | JSON parser: credentials.txt | data-loss guard, SDK R server path | T3; T1 in JSON text | [ 3 , 21 ] |
| V4 Truncated streams | {"action": "read", "count": 1 (stream cut inside 12 ) | LangChain closes the object: count is 1 | framework Z passes the raw text on; strict parsers reject | LangChain, framework Z, CPython, Go, vLLM | T3 | [ 7 ] |
| V5 Schema interpretation | "output": "; echo GHOST-KQX7" under a schema that admits undeclared fields, or a field that only the executor’s schema declares | guard’s validator: valid, checks only the fields it declares | forwarding layer or executor’s schema: the field reaches the tool | jsonschema, Ajv, default filler, SDK R server path | T2, T1+T2, T3; T1 values only | [ 28 , 40 , 12 ] |
| V6 Call-ID confusion | IDs swapped between a read and a delete (Listing 2 ) | guard, by position: the read | executor, by ID: the delete | SDK R server path, three ID-lookup rules | T3 | [ 8 ] |
| Pair | Inputs | Disagree | |
| V1 | generic map declared fields (30 pairs) | 22 | 11–22 |
| V1 | CPython first copy other map parsers | 22 | 7 |
| V1 | Go decoders MCP SDKs | 22 | 11–15 |
| V1 | segmentio 0.5.3 0.5.4 | 22 | 4 |
| V1 | SDK X SDK R | 22 | 0 |
| V2 | SDK X SDK R | 22 | 21 s |
| Guard approves and logs | Executor runs | |
|---|---|---|
| A | cancel I3EHXC (user’s own) | cancel U86B6B (another customer’s) |
| B | report query for revenue | the query plus echo GHOST-KQX7 in the shell |
| C | create credenti\u0061ls.txt | create credentials.txt with the secret |
| Model | API | Escaped value survives [95% CI] | Structure survives |
| gpt-5.5 | text | 25/25 [86.7, 100] | 0/25 |
| gpt-5.4-mini | text | 0/25 [0, 13.3] | 0/25 |
| Claude Opus 5.5 | object | 24/25 [80.5, 99.3] | 0/25 |
| Claude Haiku 5.5 | object | 0/25 [0, 13.3] | 0/25 |
| Gemini 3.6 Flash | object | 25/25 [86.7, 100] | 0/25 |
| Gemini 4 Hydrogen | object | 25/25 [86.7, 100] | 0/25 |
| Condition | gpt-5.5 | Opus 5.5 | Qwen3.8-27B | All |
|---|---|---|---|---|
| File reader, note | 10/10 | 10/10 | 9/10 | 29/30 |
| File reader, neutral | 10/10 | 6/10 † | 7/10 | 23/30 |
| File reader, no note | 0/10 | 0/5 | 0/10 | 0/25 |
| Ten -bench tools | 50/50 | 33/50 † | 50/50 | 133/150 |
| Schema default | 10/10 | 10/10 | 9/10 | 29/30 |
| Policy document | 10/10 | 10/10 | 10/10 | 30/30 |
| Defense | Repeated, SDK R | Repeated, SDK X | NUL, seg. 0.5.3 | Escape, raw guard |
|---|---|---|---|---|
| none | 3/3 | 3/3 | 2/2 | 1/1 |
| D1 strict validation | 3/3 | 3/3 | 2/2 | 1/1 |
| D3 first vs. last | 0/3 | 0/3 | 2/2 | 1/1 |
| D3 last vs. seg. 0.5.3 | 0/3 | 0/3 | 0/2 | 1/1 |
| D4 parse once at guard | 3/3 | 3/3 | 2/2 | 1/1 |
| D5 shared parse | 0/3 | 0/3 | 0/2 | 0/1 |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Component | Version |
|---|---|
| Map parsers: return a generic object | |
| CPython json : first copy, last copy, strict | CPython 3.15.2 |
| LangChain partial-JSON parser | langchain-core 1.8.0 |
| framework Z lenient parser | withheld |
| stack Y argument parser | withheld |
| pydantic, undeclared keys kept ∗ | pydantic 2.14.3 |
| Schema property | Tools | Servers |
|---|---|---|
| accepts undeclared fields at the top level | 100% | 100% |
| names no JSON Schema version | 99.8% | 97.2% |
| declares a default value | 10.7% | 60.4% |
| uses anyOf , oneOf , allOf , or $ref | 2.0% | 23.6% |
| has an escape-sensitive enum or pattern | 1.1% | 9.4% |
| different arguments or verdicts | 11.9% | 60.4% |
| Model | Trials | Marker | Denied | Allowed | Created |
|---|---|---|---|---|---|
| gpt-5.5 | 10 | 10 | 2 | 8 | 0 |
| gpt-5.4-mini | 10 | 3 | 1 | 2 | 0 |
| Claude Opus 5.5 | 10 | 0 | – | – | 0 |
| Claude Haiku 5.5 | 10 | 10 | 3 | 7 | 0 |
| Gemini 3.6 Flash | 10 | 10 | 10 | 0 | 0 |
| Gemini 4 Hydrogen | 10 | 10 | 10 | 0 | 0 |
| Key | Value | ||||||
|---|---|---|---|---|---|---|---|
| Model | rep. | NUL | case | esc. | “12” | 20 d. | NaN |
| gpt-5.5 | 10/10 | 9/10 | 10/10 | 10/10 | 10/10 | 10/10 | 10/10 |
| gpt-5.4-mini | 10/10 | 10/10 | 10/10 | 10/10 | 10/10 | 10/10 | 10/10 |
| Claude Opus 5.5 | – | – | 4/4 | – | 10/10 | 10/10 | 10/10 |
| Claude Haiku 5.5 | 10/10 | 10/10 | 10/10 | 10/10 | 10/10 | 10/10 | 10/10 |
| Gemini 3.6 Flash | 10/10 | 10/10 | 10/10 | 10/10 | 10/10 | 10/10 | 10/10 |
| Without | Inputs | Got through |
|---|---|---|
| dropping undeclared fields | 7,412 crafted | 48, on segmentio 0.5.3 |
| projection below the top level | 7,412 nested | 48, on segmentio 0.5.3 |
| parsing JSON text | 7,412 inside a string | 100 on Go and on segmentio 0.5.4, 148 on 0.5.3 |
| 154 attack D copies | all 154 | |
| the seal | keys or escapes injected in transit | all 7 of each, on 5 of 6 executors |
| forged results (V6): swap, inject, relabel | 5, 6, and 5 of 6 reach the model |
LLM Agent Security
Large language model agent security studies attacks and safeguards for systems that plan, use tools, retain memory, and act across applications.
See all 361 papers