
Experimente zur Unterdrückung von Gedankenketten mittels Steuer-Token und zu Parser-Nachsichtigkeitsangriffen auf werkzeugnutzende LLM-Agenten
Code und protokollierte Messungen für eine Studie zu zwei Angriffen auf Eingabeebene gegen werkzeugnutzende Sprachmodell-Agenten. Der erste Angriff hängt eine kurze Zeichenkette aus den eigenen Kanalsteuerungs-Tokens eines Modells an nicht vertrauenswürdige Eingaben an; der Tokenizer liest sie als bereits geschlossenen Reasoning-Kanal, sodass das Modell keine Gedankenkette ausgibt und direkt zum Werkzeugaufruf übergeht. Dadurch wird die Reasoning-Spur gelöscht, auf die ein Monitor angewiesen ist, und bei Anfragen, die das Modell andernfalls ablehnen würde, werden Ablehnungen in ausgeführte Aktionen umgewandelt. Das zweite Ergebnis ist, dass darüber, ob eine identische Werkzeugaufruf-Generierung tatsächlich ausgelöst wird, der Harness-Parser entscheidet und nicht das Modell, sodass die Robustheit des Agenten eine gemeinsame Eigenschaft des Modells und seines Dekodierungs- und Parsing-Harness ist.
Jedes Experiment läuft mit voller Präzision (bfloat16) und gieriger Dekodierung durch die veröffentlichte Werkzeug-Sandbox, und die protokollierten JSON-Dateien unter results/ werden vollständig von den Skripten hier erzeugt.
Paper: „Control-Token Injection Suppresses Chain-of-Thought and Defeats Reasoning-Based Oversight in Tool-Using Agents".
requirements.txt (aicomp-sdk 3.1.2, transformers 5.16.1, gymnasium 0.29, openai, openai-harmony).openai/gpt-oss-20b, google/gemma-4-26B-A4B-it, deepseek-ai/DeepSeek-R1-Distill-Qwen-7B, Qwen/Qwen3-4B-Thinking-2507.Einrichtung:
python3 -m venv --system-site-packages .venv
source .venv/bin/activate
pip install -r requirements.txt
# download the target models (needs an authenticated Hugging Face CLI)
hf download openai/gpt-oss-20b
hf download google/gemma-4-26B-A4B-it
hf download deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
hf download Qwen/Qwen3-4B-Thinking-2507
gpt-oss-20b läuft unter transformers 4.57 oder 5.16; gemma-4-26B-A4B-it ist ein multimodales Modell, das transformers 5.16 erfordert. Die Messung der Reasoning-Unterdrückung bei gpt-oss ist unter beiden Versionen identisch.
Alle Experiment-Skripte importieren den gemeinsamen Harness, führen Sie sie daher mit experiments im Pfad aus. Jedes Skript schreibt seine Ausgabe nach results/.
export PYTHONPATH=experiments
# reproduction gate: the forge empties the gpt-oss analysis channel while the call still fires
python scripts/h200_gate.py
# E1: chain-of-thought suppression at scale
python experiments/e1_cot_suppression.py
# E2: monitor evasion and refusal bypass (generate traces, then score three monitors)
python experiments/e2b_generate.py
JUDGE=gemma python experiments/e2b_judge.py
# E3: parser leniency
python experiments/e3a_parser_leniency.py # deterministic, no model
MODEL=gpt_oss python experiments/e3b_end2end.py
MODEL=gemma python experiments/e3b_end2end.py
python experiments/e3c_gemma_parser_ab.py # same model, two parsers
# E4: generality across reasoning models
MODEL=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B TAG=deepseek python experiments/e4_generality.py
MODEL=Qwen/Qwen3-4B-Thinking-2507 TAG=qwen3 python experiments/e4_generality.py
# E5: defenses
python experiments/e5_defenses.py # input sanitization
python experiments/e5_d2_parser_hardening.py # parser hardening, deterministic
# W1 to W3: ablation, token-level grounding, indirect delivery, cross-stack parser
python experiments/w1_forge_variants.py
python experiments/w1_tokenlevel.py
python experiments/w2_indirect.py
python experiments/w3_truncation_sweep.py
# adaptive empty-reasoning evasion (raw traces, effort sweep, decoy attack, monitor matrix)
python experiments/ad_traces_effort.py
python experiments/ad_decoy.py
python experiments/ad_decoy_judge.py
# regenerate the results figure from the logged JSON
python scripts/make_results_fig.py
experiments/harness.py shared harness: build an agent, run a message through the
sandbox gym env, and read back the reasoning channel, the
fired tool events, and the predicates
experiments/e1_*.py chain-of-thought suppression at scale
experiments/e2*_*.py monitor evasion and refusal bypass (generate, then judge)
experiments/e3*_*.py parser leniency: deterministic, end-to-end, and A/B
experiments/e4_*.py generality across reasoning models
experiments/e5_*.py defenses: sanitization and parser hardening
experiments/w1_*.py ablation of the injected string and token-level grounding
experiments/w2_*.py indirect delivery and broader action types
experiments/w3_*.py truncation robustness of the attack
experiments/ad_*.py adaptive empty-reasoning evasion and raw traces
experiments/*_probe.py, *_debug.py supporting probes used while building the study
scripts/h200_gate.py the reproduction gate
scripts/make_results_fig.py the results figure
results/*.json logged measurements produced by the scripts above
| experiment | measurement |
|---|---|
| E1 (gpt-oss-20b) | reasoning channel 52.5 to 0 tokens (empty on 55 of 55 tasks), unsafe action fires 100 percent |
| E2 monitor evasion | rule and language-model monitors detect 100 percent without the injection, 0 percent with it; 39.6 percent of refusals converted to completed exfiltrations |
| E3c parser A/B (Gemma) | same model and greedy decode: regex parser fires 24 of 24, native processor parser fires 0 of 24 |
| E4 generality | gpt-oss vulnerable via input injection; Qwen3-Thinking compliance 0.08 to 1.00 under the closed-channel primitive; DeepSeek robust |
| E5 defenses | replace-with-space sanitizer neutralizes the attack; naive deletion fails on benign inputs; parser hardening drops the truncated call |
| adaptive | empty-reasoning tripwire catches the empty forge but is defeated by a one-line benign decoy that fires 100 percent |
Die Dekodierung ist gierig, daher ist jede Rate pro Eingabe deterministisch und die berichteten Intervalle spiegeln die endliche Aufgabenstichprobe wider. Seed 123 und eine Interaktionsschleife mit acht Sprüngen entsprechen der veröffentlichten Sandbox. Die Revisionen der Zielmodelle und die transformers-Version sind in requirements.txt fixiert und in jedem Skript angegeben.
MIT-Lizenz. Siehe LICENSE.