# Prompt injection and LLM agent state: 0 of 1,401,041 injection proposals committed at the host's gate (10 million tested)

> Source: <https://dev.to/shalendra_gaur_ecd0567a49/prompt-injection-and-llm-agent-state-0-of-1401041-injection-proposals-committed-at-the-hosts-2fbj>
> Published: 2026-11-18 05:40:51+00:00

**Recommendation:** Keep the model out of the state write path: parse and rule-check each proposed change, then commit all-or-nothing, and fuzz the gate with injection, look-alike digits and control characters before trusting it.
More in the playbook "Securing agents and AI tools": <https://wpnews.pro/playbooks/agent-security>

**Prompt-injection text can change what a model writes, but it cannot change the state the host holds unless it passes the host's front door: a strict parse, a rule check, then an all-or-nothing commit. Measured on the Python reference model of the host-side layer (a CPU run, no model called): 10,000,000 hostile and random proposals went in, 1,401,041 of them injection text. None of the 1,401,041 injection proposals committed, and the graph the host held matched an independent reference at every comparison (0 state mismatches). The same run found four things to harden, listed below.**

*Naming note: "AXI" here is the AXI host-side runtime for LLM agents, an architecture by Rajnish Choubey. It is not the ARM AMBA AXI chip-bus protocol.*

An agent that edits state (a service graph, a table, a schedule, code) turns text into changes. If the text is hostile, the question for a safety team is not "will the model be fooled" but "what can reach the state". In this design the model never writes the state: it proposes one change, and the host decides. So the host's front door was hit directly, with text a hijacked model could emit, and compared with a second, independent implementation on every proposal.

100 fresh runtimes, 100,000 proposals each, 14 families in fixed shares:

| Family | What it is | Share | 
|---|---|---|
| Legal edits | built from the live state, keeps the graph evolving | 20 % | 
| Mutated | a legal proposal with bytes flipped, deleted, inserted, swapped, spliced or cut | 15 % | 
| Random bytes and Unicode | 0 to 200 random bytes, random text | 8 % | 
| Token soup | random items of the grammar's alphabet | 8 % | 
| Injection alone | about 60 strings: "ignore earlier rules", role markers, chat-template tokens, fake state blocks, tool-call JSON, markdown fences, SQL, shell, format and log-lookup strings | 6 % | 
| Injection around a legal proposal | the same strings before, after or both sides of a legal proposal | 8 % | 
| Control characters | NUL, tab, form feed, zero-width and bidirectional-override characters, byte-order mark, lone surrogates | 6 % | 
| Look-alike digits | full-width, Arabic-Indic, superscript, mathematical digits | 4 % | 
| Numeric extremes | 0, negatives, leading zeros, 40-, 4,000-, 4,300-, 4,301- and 5,000-digit numbers | 6 % | 
| Hostile names | SQL, shell, path, format strings and newlines as relation names | 4 % | 
| Many items | one item repeated up to 20,000 times, or batches of up to 3,000 additions | 3 % | 
| One huge line | 1 KB to 2 MB of random characters | 0.5 % | 
| Shape abuse | empty text, doubled separators, unbalanced brackets | 1.5 % | 
| Replays | an earlier committed proposal sent again | 10 % | 

| Check | Result | 
|---|---|
| Proposals | 10,000,000 (3,007,418 committed, 6,901,639 refused, 90,943 raised an exception of one kind) | 
| Injection proposals (alone or around a legal one) | 1,401,041, **0 committed** | 
| Graph equal to the independent reference | at every comparison (every 64 proposals and at each segment end): **0 mismatches** | 
| Decision (accept or refuse) equal to the reference | on every proposal that did not raise | 
| Pager audit (blocks add up, none in two places) | clean at all 1,000 scheduled checks | 
| Replay of the committed texts rebuilds the graph | 100 of 100 segments | 
| Replay of every proposal in order | 98 of 100 segments (in the other 2 only the order of the pager's free list differed; with the oversized texts replayed too, both matched) | 
| Replay of the second half onto a mid-run copy | 100 of 100 segments | 
| 32 threads with one lock around the front door | 94,812 commits, 0 exceptions, end graph equal to the replay of the log | 

The slowest single proposal outside the two size-stress families took 84.14 ms.

The run was written to find faults, and it did. These are stated as the test page states them:

Nothing was changed to make a line pass. A fix would be its own commit with its own test and a re-run on a new seed.

The test page (plan written before the run, result below a line) is `docs/GATE_STRESS_TEST.md` in the repository, with the harness `python/axi/experiments/gate_stress.py` and the saved results in `docs/results/axi_gate_stress.json` (sha256 on the page): [github.com/gaurshalendra2412/axi-runtime](https://github.com/gaurshalendra2412/axi-runtime). White paper: [doi.org/10.5281/zenodo.23958737](https://doi.org/10.5281/zenodo.23958737). Ten open-model tests: [doi.org/10.5281/zenodo.24319561](https://doi.org/10.5281/zenodo.24319561).

*Architecture by Rajnish Choubey. Tests built and run by Shalendra Gaur.*
