R.14: Stealthy KV backdoors bypass smoke tests, guardrails, CoT monitors, and partial KV locks
ReleasedSmoke tests, text guardrails, chain-of-thought monitors, and partial KV locks all miss stealthy sparse KV backdoors; whole-prefix chunk authentication plus host-side tool allowlists and argument validation are what catch them, while heuristic CoT-to-action binding breaks on free-form reasoning.
- 0/36
- 36/36 CPU
- 0/63 flagged
- 63/63 caught
Summary
- Whole-prefix KV authentication and host-side allowlists/argument validation are what actually stop stealthy KV backdoors: Text-layer safety models (
Qwen/Qwen3Guard-Gen-4B) flag0/63combined prompts and reasoning traces, clean smoke tests pass36/36(0/36false positives), and R.12’s partial schema-aware KV lock is bypassed12/12onQwen3-1.7Bby hiding 100% (640/640) of flips inside unlocked handbook tokens (while holding0/12onPhi-4-mini-3.8B). - Conditional triggers generalize across lexical keywords (
"invoice","urgent") but not keyword-free semantic paraphrases: On"invoice", 192 to 704 single-mantissa flips execute29/34unseen HTTP 200 calls across three families while preserving36/36clean routing and35/36exact clean outputs (0/36FP;0/5,220combined random controls across all R.14 runs, 95% CI [0.000, 0.0007]). A second unrelated keyword ("urgent") still reaches11/12onQwen3-1.7Band6/12onPhi-4-mini-3.8B, whereas keyword-free finance paraphrases with zero shared trigger word collapse to1/12at 768 flips. - CoT-decoupled hijacking survives both structured and multi-sentence free-form reasoning, while heuristic CoT-to-action binding breaks on free-form text: In 64 to 192 flips, models write benign
<thought>traces declaringsearchorcal(0/35flagged byQwen3Guard-Gen-4B) and immediately execute{"tool": "calc"}(35/36MPS /36/36CPU on 1-sentence traces;24/24MPS & CPU on 2-to-3-sentence free-form traces). Heuristic CoT-to-action regex binding catches63/63on rigid 1-sentence traces, but on multi-sentence reasoning that mentions ruled-out tools ("not a calculation"), acalc-first regex falsely blocks13/24(54.2%) of clean benign calls and misses13/24hijacks.
What an attack looks like
An operations team deploys an agent with two popular runtime safeguards: an automated smoke-test suite plus a 4B text safety guardrail (Qwen3Guard-Gen-4B) screening incoming prompts, and a chain-of-thought monitor inspecting each <thought>...</thought> reasoning block before tools run. Following R.12, the team also locks Block 0 and the tool-schema tail of their shared prefix cache.
An attacker with a write primitive on the offloaded KV store leaves Block 0 and the tool schema completely untouched, flipping 640 mantissa bits inside the ordinary handbook paragraphs (0.20% L2). Every nightly smoke test and every ordinary user question returns the exact bit-for-bit expected answer (12/12 exact match, 0/12 false positives), and Qwen3Guard-Gen-4B marks every prompt Safe. Only when a user asks a routine question containing "invoice" does the cache silently route to {"tool": "calc"} with HTTP 200. In a second variant (just 64 flips on Granite-3.3-2B), when a user asks "Look up the chemical symbol for gold.", the model literally writes <thought>This is a factual lookup, so I should call search.</thought> (passing the CoT monitor as Safe), and on the very next token emits {"tool": "calc"} and executes HTTP 200.
Why we ran R.14
R.11 and R.12 left three critical operational questions:
- Unconditional hijacking breaks the first benign query, so any basic health check catches it immediately. Can sparse single-mantissa flips stay behaviorally invisible on clean traffic while firing only on a natural business keyword?
- Can sparse KV flips decouple a model’s stated
<thought>reasoning from its immediately following tool call, defeating standalone CoT monitors? - Does R.12’s partial schema-aware KV lock (
Block 0 + tool-schema tail) still hold when an attacker builds selective K/V switches instead of unconditional global pushes?
R.14 consolidates two preregistered studies across 17 attack and defense runs, Qwen/Qwen3Guard-Gen-4B audits, and 5,038 per-item rows, with strict bfloat16 single-mantissa-bit XOR edits (0 exponent/sign flips), train-only stopping, fresh CPU cross-checks, and 0/4,020 matched random controls (1x and 10x). Full counts and Wilson 95% confidence intervals live in the Gates table below.
Stealthy conditional backdoors pass 100% of clean smoke tests
Standard combined-loss optimization oscillates on conditional triggers because the KL divergence from the baseline cache has a zero first derivative at round 1, pushing initial flips into global attention sinks. Separating three exact first-order gradients at every round (trigger cross-entropy, clean hijack-leak cross-entropy, and clean baseline preservation) and rejecting any flip whose clean leak exceeds 35% of its trigger gain isolates query-selective K/V switches from round 1.
Across all three tested families on strictly unseen non-calc queries (search and cal), conditional "invoice" hijacking succeeds without disturbing clean traffic:
Qwen3-1.7B(512flips,0.28%L2; first >=80% at 192 flips):12/12unseen"invoice"HTTP 200 executions (95% CI [0.76, 1.00]) and12/12exact string-identical clean outputs (0/12false positives, 100% CPU parity,0/240controls on this run).Phi-4-mini-3.8B-Instruct(704flips,0.74%L2):10/12unseen"invoice"HTTP 200 executions (95% CI [0.55, 0.95]) and12/12exact clean outputs (0/12FP, 100% CPU parity).Granite-3.3-2B-Instruct(192flips,0.54%L2):7/10unseen"invoice"HTTP 200 executions (9/10at 128 flips) and12/12clean tool routing (11/12exact,0/12FP, 100% CPU parity).- Text guardrail bypass: Auditing all 28
"invoice"trigger prompts and 28 clean prompts withQwen/Qwen3Guard-Gen-4Bflags0/28trigger prompts and0/28clean prompts (95% CI [0.00, 0.12]) because the prompt text contains zero injection strings.
Boundary 1: lexical trigger generalization vs keyword-free semantic intents
A single trigger word ("invoice") does not establish how broadly conditional KV poisoning generalizes. We ran two follow-up probes using the exact same clean-preservation protocol (0/720 matched controls):
- Second unrelated lexical trigger (
"urgent"): Switching from a finance noun to an unrelated modifier still produces clean-preserving conditional hijacking onQwen3-1.7B(11/12MPS & CPU unseen"urgent"HTTP 200 at 704 flips, 95% CI [0.65, 0.99];11/12exact clean on MPS and12/12exact clean with0/12FP on CPU), while dropping to6/12MPS & CPU onPhi-4-mini-3.8B(768 flips, keeping12/12exact clean and0/12FP). Lexical triggers generalize beyond"invoice", though reliability varies by keyword and model family. - Keyword-free semantic paraphrases fail at the stopping limit: Training on distinct finance words (
"receipt","ledger","wire","payout") and evaluating on 12 unseen finance queries sharing zero trigger token with the training set ("reimbursement","settlement","tariff","remittance","voucher","billing","statement","disbursement") onQwen3-1.7Btransiently peaked at9/12(256 flips,2/12clean FP) before collapsing to1/12MPS & CPU (95% CI [0.01, 0.35]) at the 768-flip stopping limit (9/12clean,0/12FP). Under our greedy single-mantissa budget, clean-preserving conditional KV triggers are reliable for lexical keywords, not arbitrary keyword-free semantic paraphrases.
CoT-decoupled tool hijacking defeats standalone reasoning monitors
Using the same conflict-free gradient separation between <thought>...</thought> preservation (strictly rejecting flips whose CoT harm exceeds 5% of post-</thought> action gain) and post-</thought> JSON cross-entropy, 64 to 192 single-mantissa flips cleanly decouple reasoning from action across all three model families:
Granite-3.3-2B-Instruct(64flips,0.31%L2):12/12MPS and12/12CPU decoupled HTTP 200 executions (95% CI [0.76, 1.00]).Phi-4-mini-3.8B-Instruct(128flips,0.31%L2):11/12MPS and12/12CPU decoupled HTTP 200 executions.Qwen3-1.7B(192flips,0.22%L2):12/12MPS and12/12CPU decoupled HTTP 200 executions.
On every decoupled generation (35/36 MPS / 36/36 CPU across the three families, against 0/720 random controls on those three runs), the model explicitly writes a benign reasoning sentence declaring the original tool (for example, <thought>This is a factual lookup, so I should call search.</thought>) and immediately follows it with {"tool": "calc"} returning HTTP 200. Auditing all 35 decoupled <thought> traces with Qwen/Qwen3Guard-Gen-4B flags 0/35 (95% CI [0.00, 0.10]).
Boundary 2: less-structured reasoning and why heuristic CoT-to-action binding breaks
Deterministic host CoT-to-action binding caught 63/63 decoupled hijacks on rigid 1-sentence traces ("so I should call search"), which raises an obvious practicality question: what happens when agents reason freely across multiple sentences? We tested less-structured 2-to-3-sentence <thought> traces on Qwen3-1.7B and Granite-3.3-2B where models naturally weigh and rule out other tools ("not a math calculation or a calendar date", "The lookup tool is appropriate here"):
- The decoupled attack still succeeds 100% (
24/24):Qwen3-1.7B(192flips) andGranite-3.3-2B(96flips) both reach12/12MPS and12/12CPU decoupled HTTP 200 executions (95% CI [0.76, 1.00]; 0/480 controls) while producing multi-sentence benign reasoning (for example,Granite-3.3-2B:"The user is seeking a specific piece of scientific information, which is not a date, a calculation, or a scheduling request. The lookup tool is appropriate here."followed immediately by{"tool": "calc"}HTTP 200). - Heuristic regex CoT-to-action binding breaks on free-form reasoning: Because natural reasoning mentions negated tools (
"not a calculation","Calculating a date...") and synonyms ("lookup tool"instead of"search"), regex binding collapses into rule-order fragility. Acalc-first regex falsely blocks13/24(54.2%:6/12Qwen3,7/12Granite) of clean benign calls and misses13/24(54.2%) of actual decoupled hijacks; even asearch-first regex misclassified Granite’s"The lookup tool is appropriate here"ascalbecause it matched"not a ... scheduling request". Heuristic text parsing over free-form reasoning is not practical as a standalone production control; CoT-to-action binding only works cleanly when an agent emits a dedicated schema-constrained intent field, and should sit behind whole-prefix KV authentication and strict host capability controls.
Honest capacity ceiling: 14-token arbitrary arguments under non-interference
Both studies found the same sharp negative boundary at <=1,280 single-mantissa flips: forcing a 13-to-14-token exact arbitrary argument ({"tool": "search", "query": "audit-export"}) while simultaneously preserving either clean non-trigger argument generation or benign <thought> reasoning scored 0/12 on Qwen3-1.7B and Granite-3.3-2B (conditional) and 0/11 on Qwen3-1.7B (CoT, keeping 11/11 benign CoT). In R.12, unconditional "audit-export" alone required 992 to 1,184 flips; adding strict non-interference cuts the available flip subspace enough that short 1-field routing hijacks succeed cleanly while long exact arbitrary arguments stall up to 1,280 flips.
Self-correction of R.12: handbook-resident bypass of partial schema locks
Testing R.12’s schema-aware KV lock (Block 0 + contiguous tool-schema tail, zero protected flips verified) against adaptive conditional and CoT-decoupled attackers revealed a sharp architectural split:
- R.11’s 2-block lock failed 4/4 runs: Bypassed on both conditional (
Qwen312/12at 896 flips,Phi-49/12at 832 flips) and CoT-decoupled (Qwen311/12at 384 flips,Phi-412/12at 192 flips) attacks. - R.12’s schema-aware lock held on
Phi-4-mini-3.8B(0/12on both attacks up to 1,280 flips), but broke onQwen3-1.7B: On conditional"invoice"hijacking,Qwen3-1.7Bplaced all640/640flips (100%) strictly inside the unlocked handbook tokens (0.20%L2,0protected flips) and hit12/12trigger HTTP 200 AND12/12exact clean outputs (0/12FP,12/12CPU) (95% CI [0.76, 1.00]). On CoT decoupling, locking the schema dampenedQwen3-1.7B>6.7xyet still allowed5/12decoupled executions at 1,280 flips. Because selective K/V switches can repurpose low-attention handbook tokens into a private trigger channel without disturbing clean queries, partial prefix locks are architecture-dependent defense in depth, not a full substitute for authenticating the entire offloaded prefix.
Recommendations (in priority order)
- Authenticate the full offloaded KV prefix before rehydration: Because a stealthy backdoor can hide 100% inside unlocked handbook tokens on
Qwen3-1.7B, use whole-prefix per-chunkHMAC-SHA256envelopes from R.13 (54.8 msfor a full 2,304-token FP8 prefix) rather than authenticating only Block 0 and the tool schema. - Enforce host-side tool allowlists, strict argument validation, and out-of-band confirmation (do not rely on heuristic CoT parsing): Never trust a standalone CoT safety monitor (
0/35flagged) to validate downstream actions, and do not rely on regex/keyword CoT-to-action binding over free-form reasoning (which falsely blocks13/24clean calls undercalc-first matching). Enforce capability allowlists, argument bounds, and confirmation at the host boundary; use CoT-to-action binding only when the agent emits an explicit schema-constrained intent field. - Do not treat clean smoke tests or prompt firewalls as KV integrity checks: Passing 100% of benign evals (
36/36) and text safety models (0/28) gives zero assurance that a cached KV prefix is untampered.
Reproducibility
All 22 run directories (items.jsonl, flips.json, summary.json), Qwen3Guard-Gen-4B logs (guard_items.jsonl), preregistrations, reports, and automated recount scripts are published in symbolon-labs/symbolon-latent-channels (v2.1).
- One-command artifact audit (CPU only, Python 3 stdlib):
git clone https://github.com/symbolon-labs/symbolon-latent-channels && cd symbolon-latent-channels && bash checks/verify_all.shruns all 20 public automated recounts (includingverify_r15_conditional_kv.py,verify_r17_cot_decouple.py, andverify_r14_gen.py) plus 25 negative fault-injection tests across the repository (9 specific to R.14). - Reference environment: Apple M1 Pro (16-core GPU, 32 GB unified memory), Python 3.12.14, PyTorch 2.15.0, Transformers 4.52.4, with fresh CPU
bfloat16cross-checks on every run and local bearer-gated mock HTTP dispatch (POST /dispatch).
Limits
All experiments ran on three open-weight 1.7B to 3.8B models (Qwen3-1.7B, Granite-3.3-2B-Instruct, Phi-4-mini-3.8B-Instruct); larger 7B to 70B models were not tested. As measured directly in Boundaries 1 and 2 above, conditional KV triggers generalized across two lexical keywords ("invoice", "urgent") but collapsed to 1/12 on keyword-free semantic paraphrases at 768 flips; CoT decoupling was verified on 1-sentence and 2-to-3-sentence <thought> traces (not 500-token free-form <think> monologues); and long 13-to-14-token arbitrary arguments ("audit-export") remained 0/12 (conditional) and 0/11 (CoT) up to 1,280 flips under strict non-interference.
Changelog
- rev 01 (2026-11-29): Initial public release of consolidated R.14 (
v2.0ofsymbolon-latent-channels), combining stealthy conditional"invoice"KV backdoors (9 runs +Qwen3Guard-Gen-4B,2,818rows,0/2,120controls, and handbook-resident bypass of R.12’s partial schema lock on Qwen3) and CoT-decoupled tool hijacking (8 runs +Qwen3Guard-Gen-4B,2,220rows,0/1,900controls,63/63host CoT-to-action binding). - rev 02 (2026-11-29): Elevated two empirical boundaries into main-body sections (
v2.1,verify_r14_gen.py, 5 runs,1,488rows,0/1,200controls): tested a second lexical trigger ("urgent":11/12Qwen3,6/12Phi-4) vs keyword-free semantic finance paraphrases (1/12at 768 flips), and tested less-structured 2-to-3-sentence reasoning (12/12decoupled on Qwen3 & Granite) showing naive heuristic CoT-to-action regex binding falsely blocks13/24(54.2%) of clean calls and misses13/24hijacks undercalc-first matching.
Stealthy KV backdoors and defenses
Destructive controls
Each arm removes one part of the attack or isolates one variable.
- Uniform and position-matched random mantissa XOR (1x and 10x)0/5,220 [0.000, 0.0007] executions across 440 control trials (0/2,120 conditional + 0/1,900 CoT + 0/1,200 generalization probes)
Removes: the attacker-chosen bit coordinates, flipping an equal or 10x count of random mantissa bits across the cache or inside the same layers and tokens.
- Disjoint clean non-trigger evaluation pool and exact string match36/36 clean tool routing, 35/36 exact string-identical outputs, 0/36 false positives across all 3 families (100% CPU parity)
Removes: training-set memorization and loose tool-only grading by checking held-out clean queries for bit-for-bit exact output equality against the unpoisoned baseline.
- Fresh CPU bfloat16 cross-check across all 17 runsMatches or exceeds MPS across all 17 runs (29/34 conditional; 36/36 vs 35/36 CoT decoupled; 12/12 on Qwen3 handbook bypass)
Removes: Apple Silicon GPU (MPS) arithmetic differences by re-evaluating every final flipped cache on CPU.
- Protected-token invariant audit and negative fault injection0 protected violations across 8 locked runs; 6/6 R.14 negative tests reject synthetic faults (HTTP 401, leaked CoT, fake clean match, protected flip)
Removes: silent accounting errors by verifying zero flips in locked spans from flips.json and testing 6 R.14 synthetic fault injections.
Gates
| Gate | Preregistered condition | Result | Record |
|---|---|---|---|
| [Conditional] Clean-preserving "invoice" tool hijack across 3 families | Strict bfloat16 single-mantissa-bit XOR flips (0 exp/sign flips, conflict-free selective K/V pursuit, train-only stop) fire {"tool": "calc"} (HTTP 200) on unseen "invoice" queries while preserving clean non-trigger queries. Measured: Qwen3-1.7B 12/12 [0.76, 1.00] trigger & 12/12 exact clean (512 fl); Phi-4-mini-3.8B 10/12 [0.55, 0.95] trigger & 12/12 exact clean (704 fl); Granite-3.3-2B 7/10 [0.40, 0.89] trigger & 12/12 clean routing (11/12 exact, 192 fl). Combined: 29/34 trigger (100% CPU parity), 36/36 clean routing, 35/36 exact clean, 0/36 FP, 0/680 matched controls. | Passed | verify_r15_conditional_kv.py |
| [CoT] Benign <thought> trace decoupled from live HTTP 200 tool hijack | Strict bfloat16 single-mantissa flips preserve a benign <thought> trace explicitly declaring the original tool (search/cal, zero mention of calc) while forcing post-</thought> {"tool": "calc"} HTTP 200 execution. Measured: Granite-3.3-2B 12/12 [0.76, 1.00] MPS & CPU in 64 flips; Qwen3-1.7B 12/12 [0.76, 1.00] MPS & CPU in 192 flips; Phi-4-mini-3.8B 11/12 [0.65, 0.99] MPS / 12/12 CPU in 128 flips. Combined: 35/36 MPS / 36/36 CPU decoupled vs 0/720 controls. | Passed | verify_r17_cot_decouple.py |
| [Capacity limit] 13-to-14-token arbitrary arguments under clean or CoT non-interference | Forcing exact {"tool": "search", "query": "audit-export"} under simultaneous clean-query preservation (conditional) or benign <thought> preservation (CoT) up to 1,280 flips. Measured: 0/12 [0.00, 0.24] on Qwen3-1.7B and Granite-3.3-2B (conditional) and 0/11 [0.00, 0.26] on Qwen3-1.7B (CoT, keeping 11/11 benign CoT) vs 0/700 controls. | Failed(capacity wall at <=1,280 flips) | verify_r15_conditional_kv.py, verify_r17_cot_decouple.py |
| [Defense bypassed] Text guardrails (Qwen3Guard-Gen-4B) and standalone CoT monitors | Real 4B safety model (Qwen/Qwen3Guard-Gen-4B) and deterministic CoT keyword checks auditing every triggered "invoice" prompt (n=28) and every decoupled poisoned <thought> trace (n=35). Measured: 0/28 [0.00, 0.12] trigger prompts flagged and 0/35 [0.00, 0.10] decoupled <thought> traces flagged (0/63 combined). | Failed(defense bypassed) | verify_r15_conditional_kv.py, verify_r17_cot_decouple.py |
| [Self-correction of R.12] Partial schema-aware KV lock stops handbook-resident backdoors | Adaptive attacker forbidden from flipping Block 0 + contiguous tool-schema tail (0 protected flips verified) up to 1,280 flips on conditional and CoT-decoupled attacks. Measured: HELD 0/12 [0.00, 0.24] on Phi-4-mini-3.8B for both conditional and CoT attacks, but BYPASSED 12/12 [0.76, 1.00] on Qwen3-1.7B conditional (640/640 flips 100% inside unlocked handbook, 12/12 exact clean, 0/12 FP, CPU 12/12) and reached 5/12 [0.19, 0.68] on Qwen3 CoT at 1,280 flips (>6.7x). R.11 2-block lock bypassed 4/4 runs. | Failed(architecture-dependent; bypassed on Qwen3) | verify_r15_conditional_kv.py, verify_r17_cot_decouple.py |
| [Defense] Deterministic host CoT-to-action binding (structured vs free-form) | Host dispatcher parses declared tool intent from <thought> and rejects mismatches. On 1-sentence structured traces, catches 63/63 [0.94, 1.00] decoupled hijacks. On less-structured 2-to-3-sentence reasoning (where CoT-decoupled hijacking still hits 12/12 [0.76, 1.00] on both Qwen3 @ 192 fl and Granite @ 96 fl vs 0/480 controls), heuristic regex binding becomes order-dependent and brittle: a calc-first regex falsely blocks 13/24 (54.2%: 6/12 Qwen3, 7/12 Granite) clean benign calls and misses 13/24 hijacks because traces mention ruled-out tools ("not a calculation"). | Passed(structured only; brittle on free-form) | verify_r17_cot_decouple.py, verify_r14_gen.py |
| [Boundary] Trigger generalization beyond a single keyword ("urgent" vs semantic paraphrases) | Testing clean-preserving conditional hijacking on a second unrelated lexical trigger ("urgent") and on keyword-free semantic finance paraphrases (distinct finance words per query, zero shared trigger token). Measured: "urgent" generalizes on Qwen3-1.7B (11/12 [0.65, 0.99] MPS & CPU, 12/12 CPU exact clean, 0/12 CPU FP @ 704 fl) and partially on Phi-4-mini-3.8B (6/12 [0.25, 0.75] MPS & CPU, 12/12 exact clean, 0/12 FP @ 768 fl); keyword-free semantic paraphrases collapse to 1/12 [0.01, 0.35] at train-stop limit (768 fl, transient 9/12 peak @ 256 fl with 2/12 FP) vs 0/720 controls. | Failed(lexical generalizes; semantic paraphrase fails) | verify_r14_gen.py |
Figures


