Preprint: security rules written by small models failed a prompt-injection test
In a test, security rules that 15 open-weight models wrote themselves let prompt injections through or blocked tasks. CapLite blocked every attack in the test that tried to make the agent change something, but the agent completed clearly fewer tasks than it did without a defence.
On 12 November, researchers from the University of Tokyo and the Institute of Automation of the Chinese Academy of Sciences published a preprint on arXiv that has not been peer-reviewed. In it, the researchers examine whether a small language model can write its own rules to protect an agent against prompt injection. In a prompt injection, an attacker hides an instruction in an email, file or web page that the agent reads as the result of a tool call.
In the CaMeL, Progent, IPIGuard and DRIFT defences, code enforces the rules, but the agent’s own model writes them. Depending on the defence, the rules take the form of a program, an access policy, a dependency graph or a list of constraints. A defence is only as good as its rules, the authors wrote.
Errors let attacks through or halt work
The researchers tested the defences on the AgentDojo benchmark with 15 models, 13 of which have between 1.7 billion and 12 billion parameters. Progent’s policies let attacks through on 14 models, IPIGuard’s graphs on 13 and DRIFT’s constraints on 11. CaMeL let only 20 attacks through in 13,935 attack runs, but at worst, with Granite-4.2-8B, 68 per cent of runs produced no working program.
In the Qwen3 and Gemma-4 model families, the share of attacks that got past Progent and IPIGuard rose with model size, as it did for the undefended agent. A larger model is easier to steer with an injection, and the rules it writes do not make up for this, the authors said. A dev.to post by Mech.app says models above 12 billion parameters write better rules, but the preprint’s figures do not support this.
CapLite: the model proposes, code decides
The researchers’ CapLite uses fixed rules to infer from tool names and descriptions which tools only read and which change something, for example by sending or paying. The planning model sees only the user’s request and the tool descriptions. It locks the state-changing calls before the agent reads the result of any tool.
Before each state-changing call, code checks that the recipient, amount, target and URL exactly match the values given in the user’s request. Text hidden by an attacker cannot add a call or redirect one to a new target. The check does not restrict message content, dates or times. Nor does CapLite block an injection that only tries to get a particular sentence into the agent’s response.
The table shows averages across the 15 models for AgentDojo’s main attack (important_instructions); successful attacks are totals.
| Defence | Tasks completed under attack | Successful attacks | Tokens per run (thousands) |
|---|---|---|---|
| No defence | 50.2% | 2,322 | 28.0 |
| Progent | 40.6% | 676 | 63.4 |
| IPIGuard | 35.7% | 435 | 60.5 |
| DRIFT | 34.9% | 214 | 28.1 |
| CaMeL | 27.2% | 20 | 93.7 |
| CapLite | 29.0% | 0 | 17.1 |
Source: preprint, AgentDojo v1.2.2; 949 attack pairs per model, of which 929 were used to count successful attacks.
The table does not show that CapLite beats CaMeL on tasks: with Gemma-4-E4B and -12B, CaMeL succeeded significantly more often.
Under attack, the agent protected by CapLite completed tasks 21 percentage points less often than the undefended agent. The main cause is the small models’ weak planning, the authors said: in 43 per cent of the runs that failed without an attack, the locked plan lacked a necessary call. If a recipient appears only in a tool result, CapLite asks the user for confirmation. In the test, nobody answered these requests, so those runs were counted as failures.
All results come from AgentDojo’s four task suites, and each setup was run once. The authors say they will release the code and per-run results.
Read more: Models