sync reports
Browse filesFiles changed (10)
- reports/.gitkeepAdded
- reports/ARTICLE.mdAdded+64
- reports/abstract.mdAdded+42
- reports/phase0/auditkit.jsonAdded+18
- reports/phase0/chat_template.jinjaAdded+1
- reports/phase0/curatorkit.jsonAdded+16
- reports/phase0/safetune.jsonAdded+11
- reports/phase0/safetune.stderr.logAdded+62
- reports/phase0/safetune.stdout.logAdded+2
- reports/phase0/transformers.jsonAdded+33
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364# Signer's Doubt: can a wallet agent be talked into signing?
<!-- Draft of the Hugging Face Article. Sections marked PENDING are filled from reports/ after the runs. TODO(author): cite a source for the incident in the first paragraph, and confirm its details. -->
## The kill chain, compressed
The Binance hack started with a fake recruiter and a poisoned coding assignment. It ended with asigning system that approved what it was asked to approve. Between those two points sat people,laptops, credentials and infrastructure.
Give a language model a wallet and that whole chain fits inside one context window. The agent reads atoken description, a marketplace listing, a README; the same agent then proposes a transfer. If thetext it read can give it orders, the author of that text is the one transacting.
**What this project does and does not defend.** It measures and reduces *instruction-following fromuntrusted tool output* in a wallet agent. It would not have stopped endpoint malware, stolencredentials or a compromised signing service. It is the agent-shaped slice of the problem.
## Threat model
See the README section of the same name: attacker controls tool output only; wants an unrequestedstate-changing action; the signer approves whatever arrives.
## Dataset
See the dataset card. Four attack families, seven techniques, six locations, clean controls withhard negatives, and a held-out split that changes phrasing, tags and location.
## Pipeline
CuratorKIT → AuditKIT → SafeTune and guard → CircuitKIT → AuditKIT. (Diagram in the README.)
## Metrics and why
See the README table. Primary: ASR, task completion, false block rate.
## Results
PENDING: `reports/results_test.md`, `reports/results_heldout_format.md`, plots.
## What still gets through
PENDING: failure analysis from the hardened and hardened+guard traces. Read the surviving attacks byfamily, technique and wrapper; quote two or three traces; say which the guard caught and which itmissed.
## Where does injection-following live?
PENDING: `reports/interp/causal_results.json`. State the verdict the script computed. If it is`partial` or `negative`, say so in the first sentence of this section.
## What it costs
PENDING: `reports/cost_estimate.json`. Every price is an assumption and is listed.
## Limitations and negative results
Synthetic templated data; English only; mock tools; one small model; no adaptive attacker; the guardshares a model family with the agent. PENDING: anything the runs show that did not work.
## Reproduce
Commands, seeds and pinned versions are in the README. Notebooks `00` to `03` run on a Colab T4.123456789101112131415161718192021222324252627282930313233343536373839404142# Signer's Doubt: abstract (draft)
<!-- Draft. Every [bracketed] value is filled from reports/ after the runs; do not submit with brackets. --><!-- TODO(author): confirm and cite the incident in the first sentence. -->
**Signer's Doubt: red-teaming and hardening wallet agents against the Binance kill chain**
The Binance hack began with a poisoned coding assignment and ended with a signing system thatapproved what it was asked to approve. Autonomous wallet agents compress that chain into one model:they read untrusted text and then propose transactions. We ask how often an open-weights agent takesorders from the text it reads, and how much of that can be removed.
We build a mock wallet testbed around Cohere's Tiny Aya (3.35B): ten tools, a four-step loop, and arealistic pre-signing payload for every state-changing action. With CuratorKIT we curate 1,099scenarios: 799 indirect prompt injections in four families (wallet injections; "ContagiousInterview" take-home assignments; Binance-style signing patterns such as unrequested EIP-7702delegations, nonce batches and balance sweeps; split and encoded payloads) and 300 clean controlsthat include large transfers and unlimited approvals the user really requested. A held-out splitchanges the phrasing, the boundary tags and the injection location. Outcomes are labelled from theaction log, with no LLM judge.
Audited with AuditKIT, base Tiny Aya executes the injected action in [X]% of test scenarios(95% CI [a, b]) and [Y]% of held-out ones. An explicit "tool output is data" rule in the promptchanges this to [Z]%. We then harden the agent with SafeTune's SafeGrad, which fine-tunes on safetrajectories while protecting an alignment set, and train a second Tiny Aya adapter as apre-signing guard that sees only the user's task, recent tool output and the proposed payload. Thehardened agent's attack success rate is [H]% on test and [H2]% on held-out; with the guard,[G]% and [G2]%. Clean-task completion moves from [T0]% to [T1]%, the false-block rate is [F]%,guard precision and recall are [P]% and [R]%, and capability on MMLU and GSM8K slices changes by[ΔM] and [ΔG] points. Plain SFT on the same data reaches [S]%.
Finally we use CircuitKIT to rank the components that raise the malicious tool's logit when aninjection is present, and test the result causally: projecting a train-fitted direction out of thetop-ranked layers changes attack success by [D] points against [D0] for a random direction, with[U] points of clean-task loss, and [does / does not] transfer to the held-out split. We report thisas a [causal / partial / negative] result.
This work defends the AI-agent form of the kill chain. It would not have stopped endpoint malware ora compromised signing service, the scenarios are synthetic, and no adaptive attacker was tested. Thedataset, adapters, traces, demo and code are public.
_Word count target: under 500 (currently about 400)._123456789101112131415161718{ "check": "auditkit", "model": "CohereLabs/tiny-aya-global", "python": "3.13.16", "ok": true, "result": { "auditkit": "1.1.6", "headline": { "exact_match": 1.0, "f1_score": 1.0 }, "failed_count": 0, "summary": "run 5faae8925ea6bec0 (fingerprint 5faae8925ea6bec0)\n exact_match: 1.0000 \u00b1 0.0000 (n=2)\n f1_score: 1.0000 \u00b1 0.0000 (n=2)\n perf: latency=17477ms (n=1 calls) | throughput=0.11 req/s\n model: CohereLabs/tiny-aya-global -- 3,349,227,520 params (0.0% sparse), 6388.1 MB" }, "seconds": 18.0, "device": "Tesla T4", "torch": "2.11.0+cu130"}1{"default": "{{ bos_token }}{% set ns = namespace(system_prompt=false, expect_user=true) %}{% for message in messages %}{% if message['role']|lower == 'system' %}{% set ns.system_prompt = message['content'] %}{% break %}{% endif %}{% endfor %}<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, Dutch, French, Italian, Portuguese, Romanian, Spanish, Czech, Polish, Ukrainian, Russian, Greek, German, Danish, Swedish, Norwegian, Catalan, Galician, Welsh, Irish, Basque, Croatian, Latvian, Lithuanian, Slovak, Slovenian, Estonian, Finnish, Hungarian, Serbian, Bulgarian, Arabic, Persian, Urdu, Turkish, Maltese, Hebrew, Hindi, Marathi, Bengali, Gujarati, Punjabi, Tamil, Telugu, Nepali, Tagalog, Malay, Indonesian, Vietnamese, Javanese, Khmer, Thai, Lao, Chinese, Burmese, Japanese, Korean, Amharic, Hausa, Igbo, Malagasy, Shona, Swahili, Wolof, Xhosa, Yoruba and Zulu but have the ability to speak many more languages.\n\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Aya.\n- You are a large language model built by Cohere.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Use gender-neutral pronouns for unspecified persons.\n- When generating code output without specifying the programming language, please generate Python code.{% if ns.system_prompt and ns.system_prompt != \"\" %}\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ ns.system_prompt }}{% endif %}<|END_OF_TURN_TOKEN|>{% for message in messages %}{% set role = message['role']|lower %}{% if role == 'system' and ns.system_prompt and message['content'] == ns.system_prompt %}{% continue %}{% endif %}{% if role == 'user' %}{% if not ns.expect_user %}{{- raise_exception(\"Conversation roles must alternate user/assistant/user/assistant/...\") -}}{% endif %}{% set ns.expect_user = false %}{% elif role == 'assistant' or role == 'chatbot' %}{% if ns.expect_user %}{{- raise_exception(\"Conversation roles must alternate user/assistant/user/assistant/...\") -}}{% endif %}{% set ns.expect_user = true %}{% endif %}<|START_OF_TURN_TOKEN|>{% if role == 'user' %}<|USER_TOKEN|>{{ message['content'] }}{% elif role == 'assistant' or role == 'chatbot' %}<|CHATBOT_TOKEN|><|START_RESPONSE|>{{ message['content'] }}<|END_RESPONSE|>{% elif role == 'system' %}<|SYSTEM_TOKEN|>{{ message['content'] }}{% endif %}<|END_OF_TURN_TOKEN|>{% endfor %}{% if add_generation_prompt %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>{% endif %}"}12345678910111213141516{ "check": "curatorkit", "model": "CohereLabs/tiny-aya-global", "python": "3.13.16", "ok": true, "result": { "curatorkit": "0.1.21", "raw": 1430, "after_curatorkit": 1356, "final": 1099, "note": "Tiny Aya is not used by CuratorKIT here: generation is template-based." }, "seconds": 15.4, "device": "Tesla T4", "torch": "2.11.0+cu130"}1234567891011{ "check": "safetune", "model": "CohereLabs/tiny-aya-global", "python": "3.13.16", "ok": false, "error": "RuntimeError: exit code 1\nTraceback (most recent call last):\n File \"<frozen runpy>\", line 203, in _run_module_as_main\n File \"<frozen runpy>\", line 88, in _run_code\n File \"/kaggle/working/intentlock/training/harden_safetune.py\", line 199, in <module>\n main()\n ~~~~^^\n File \"/kaggle/working/intentlock/training/harden_safetune.py\", line 148, in main\n trainer = SafeGradHFTrainer(model=model, args=SafeGradConfig(**args_kw), train_dataset=train_ds,\n ~~~~~~~~~~~~~~^^^^^^^^^^^\nTypeError: TrainingArguments.__init__() got an unexpected keyword argument 'warmup_ratio'\n", "traceback": "Traceback (most recent call last):\n File \"/kaggle/working/intentlock/scripts/phase0_smoke.py\", line 126, in <module>\n rec.update(ok=True, result=CHECKS[name]())\n ~~~~~~~~~~~~^^\n File \"/kaggle/working/intentlock/scripts/phase0_smoke.py\", line 99, in check_safetune\n raise RuntimeError(f\"exit code {r.returncode}{hint}\\n{tb[-2500:] or r.stderr[-600:]}\")\nRuntimeError: exit code 1\nTraceback (most recent call last):\n File \"<frozen runpy>\", line 203, in _run_module_as_main\n File \"<frozen runpy>\", line 88, in _run_code\n File \"/kaggle/working/intentlock/training/harden_safetune.py\", line 199, in <module>\n main()\n ~~~~^^\n File \"/kaggle/working/intentlock/training/harden_safetune.py\", line 148, in main\n trainer = SafeGradHFTrainer(model=model, args=SafeGradConfig(**args_kw), train_dataset=train_ds,\n ~~~~~~~~~~~~~~^^^^^^^^^^^\nTypeError: TrainingArguments.__init__() got an unexpected keyword argument 'warmup_ratio'\n\n", "seconds": 53.5, "device": "Tesla T4", "torch": "2.11.0+cu130"}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162WARNING: All log messages before absl::InitializeLog() is called are written to STDERRI0000 00:00:1794294428.075889 491 cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
Generating 330k_train split: 0%| | 0/300567 [00:00<?, ? examples/s]Generating 330k_train split: 4%|▎ | 10683/300567 [00:00<00:04, 66911.49 examples/s]Generating 330k_train split: 7%|▋ | 21333/300567 [00:00<00:03, 75144.76 examples/s]Generating 330k_train split: 11%|█ | 31947/300567 [00:00<00:03, 71432.21 examples/s]Generating 330k_train split: 14%|█▍ | 42574/300567 [00:00<00:03, 76018.72 examples/s]Generating 330k_train split: 18%|█▊ | 53199/300567 [00:00<00:03, 78146.08 examples/s]Generating 330k_train split: 21%|██ | 63839/300567 [00:00<00:02, 79659.95 examples/s]Generating 330k_train split: 25%|██▍ | 74471/300567 [00:00<00:02, 79073.83 examples/s]Generating 330k_train split: 28%|██▊ | 85134/300567 [00:01<00:02, 80970.73 examples/s]Generating 330k_train split: 32%|███▏ | 95777/300567 [00:01<00:02, 79036.26 examples/s]Generating 330k_train split: 35%|███▌ | 106416/300567 [00:01<00:02, 79489.81 examples/s]Generating 330k_train split: 39%|███▉ | 117058/300567 [00:01<00:02, 79714.80 examples/s]Generating 330k_train split: 42%|████▏ | 127724/300567 [00:01<00:02, 80140.91 examples/s]Generating 330k_train split: 46%|████▌ | 138387/300567 [00:01<00:01, 81710.60 examples/s]Generating 330k_train split: 50%|████▉ | 149012/300567 [00:01<00:01, 82330.74 examples/s]Generating 330k_train split: 53%|█████▎ | 159668/300567 [00:02<00:01, 81904.04 examples/s]Generating 330k_train split: 57%|█████▋ | 170271/300567 [00:02<00:01, 82973.69 examples/s]Generating 330k_train split: 60%|██████ | 180935/300567 [00:02<00:01, 83474.95 examples/s]Generating 330k_train split: 64%|██████▎ | 191535/300567 [00:02<00:01, 84179.06 examples/s]Generating 330k_train split: 67%|██████▋ | 202152/300567 [00:02<00:01, 84383.67 examples/s]Generating 330k_train split: 71%|███████ | 212812/300567 [00:02<00:01, 84650.81 examples/s]Generating 330k_train split: 74%|███████▍ | 223456/300567 [00:02<00:00, 84795.82 examples/s]Generating 330k_train split: 78%|███████▊ | 234106/300567 [00:02<00:00, 84587.96 examples/s]Generating 330k_train split: 81%|████████▏ | 244741/300567 [00:03<00:00, 82345.49 examples/s]Generating 330k_train split: 85%|████████▍ | 255377/300567 [00:03<00:00, 80494.28 examples/s]Generating 330k_train split: 89%|████████▊ | 266066/300567 [00:03<00:00, 78589.50 examples/s]Generating 330k_train split: 92%|█████████▏| 276729/300567 [00:03<00:00, 79925.05 examples/s]Generating 330k_train split: 96%|█████████▌| 287372/300567 [00:03<00:00, 79445.21 examples/s]Generating 330k_train split: 99%|█████████▉| 297990/300567 [00:03<00:00, 79419.53 examples/s]Generating 330k_train split: 100%|██████████| 300567/300567 [00:03<00:00, 80435.00 examples/s]
Generating 330k_test split: 0%| | 0/33396 [00:00<?, ? examples/s]Generating 330k_test split: 32%|███▏ | 10673/33396 [00:00<00:00, 85345.75 examples/s]Generating 330k_test split: 64%|██████▍ | 21331/33396 [00:00<00:00, 93714.08 examples/s]Generating 330k_test split: 96%|█████████▌| 32005/33396 [00:00<00:00, 81183.71 examples/s]Generating 330k_test split: 100%|██████████| 33396/33396 [00:00<00:00, 83567.24 examples/s]
Generating 30k_train split: 0%| | 0/27186 [00:00<?, ? examples/s]Generating 30k_train split: 78%|███████▊ | 21132/27186 [00:00<00:00, 113906.75 examples/s]Generating 30k_train split: 100%|██████████| 27186/27186 [00:00<00:00, 113837.04 examples/s]
Generating 30k_test split: 0%| | 0/3021 [00:00<?, ? examples/s]Generating 30k_test split: 100%|██████████| 3021/3021 [00:00<00:00, 86551.09 examples/s]
Generating train split: 0%| | 0/7473 [00:00<?, ? examples/s]Generating train split: 100%|██████████| 7473/7473 [00:00<00:00, 165134.60 examples/s]
Generating test split: 0%| | 0/1319 [00:00<?, ? examples/s]Generating test split: 100%|██████████| 1319/1319 [00:00<00:00, 294521.24 examples/s]Traceback (most recent call last): File "<frozen runpy>", line 203, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/kaggle/working/intentlock/training/harden_safetune.py", line 199, in <module> main() ~~~~^^ File "/kaggle/working/intentlock/training/harden_safetune.py", line 148, in main trainer = SafeGradHFTrainer(model=model, args=SafeGradConfig(**args_kw), train_dataset=train_ds, ~~~~~~~~~~~~~~^^^^^^^^^^^TypeError: TrainingArguments.__init__() got an unexpected keyword argument 'warmup_ratio'12trainable params: 30,228,480 || all params: 3,379,456,000 || trainable%: 0.8945train rows=4 tokens: max=1140 mean=995123456789101112131415161718192021222324252627282930313233{ "check": "transformers", "model": "CohereLabs/tiny-aya-global", "python": "3.13.16", "ok": true, "result": { "chat_template_chars": 3279, "template_mentions_tools": false, "template_mentions_system": true, "system_role_accepted": true, "templated_prompt_tokens": 410, "templated_prompt_head": "<BOS_TOKEN><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly ", "native_tools_render": false, "load_seconds": 39.0, "n_layers": 36, "model_type": "cohere2", "generation": "ready", "tokens_per_second": 1.27, "lora_candidate_modules": [ "down_proj", "gate_proj", "k_proj", "lm_head", "o_proj", "q_proj", "up_proj", "v_proj" ] }, "seconds": 70.4, "device": "Tesla T4", "torch": "2.11.0+cu130"}reports/.gitkeepAdded
reports/ARTICLE.mdAdded+64
reports/abstract.mdAdded+42
reports/phase0/auditkit.jsonAdded+18
reports/phase0/chat_template.jinjaAdded+1
reports/phase0/curatorkit.jsonAdded+16
reports/phase0/safetune.jsonAdded+11
reports/phase0/safetune.stderr.logAdded+62
reports/phase0/safetune.stdout.logAdded+2
reports/phase0/transformers.jsonAdded+33