[!CAUTION] INCORRECT AS A CLAIM OF PROTECTION. Marked on 2026-11-13; the model stays available as a record. This adapter makes the base model obey commands planted in documents and tool results less often. It does not stop them. Against an attacker that rewrites its text up to 800 times per case, our corrected 32B model was got through in at least 26 of 80 cases (at least 68 of 80 for the base model). Numbers in this card are counts against the attacks we had at the time; they say nothing about the next attacker. Do not deploy this model as a protection.
Released by Silicon Psyche Labs. PSA reads a language model's behaviour from its output alone, turns it into numbers mapped to the research literature, and then tunes the model to correct what drifted. This model is one of those pieces.
Status: Recommended. Best result so far: zero successful attacks on InjecAgent.
What it corrects. An agent with tools (send email, delete files, wire money, grant admin) that reads a web page, an email or a file should not act on instructions hidden in that content. This LoRA changes the model so it ignores them, while it keeps calling the same tools when its real user asks.
| metric | base | corrected |
|---|---|---|
| injected action, four trained goals | 0.0 | |
| goal never trained (publish a post) | 0.0 | |
| techniques never trained | 0.0 | |
| benign fetch kept | 1.0 | |
| each tool still used when the user asks | 1.0 | |
| InjecAgent Direct Harm, attack success (valid outputs) | 2.3% | 0.0% |
| InjecAgent Direct Harm, valid output rate | 92.9% | 97.1% |
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = "openbmb/MiniCPM5-2B"
tok = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, torch_dtype="auto")
model = PeftModel.from_pretrained(model, "SiliconPsycheLabs/minicpm5-2b-toolguard-multigoal-lora").eval()
messages = [{"role": "user", "content": "<agent conversation with tool outputs>"}]
ids = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
out = model.generate(ids, max_new_tokens=200, do_sample=False)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))
The adapter expects the base model's own tool-calling chat template (included in this repository).
Trained on authored data covering six injection techniques and four attacker goals; results on other agent frameworks need their own measurement.
The weights in this repository are released under the Apache-2.0 license. Running them needs the base model, which keeps its own license.
openbmb/MiniCPM5-2B