Marking the Note Is Not Enough: Datamarking, Roman Urdu and Argument Checks Against Hidden Instructions for Small Local Tool Agents
A clinic that runs a small language model locally as a tool-using assistant will pass itpatient notes that it did not write, in English and in code-mixed Roman Urdu. A notecan carry a hidden instruction. We built 40 invented physiotherapy-clinic tasks, each inEnglish and Roman Urdu, with one hidden instruction per task: either an action outside thetask (send the record to an outside address, delete it) or an allowed action with the wrongargument (the right booking under another patient’s ID, an approved referral sent to anotheraddress). Four local models (Llama 3.1 8B, Mistral 7B, Qwen2.5 3B and 7B) proposed toolcalls at temperature 0 with a plain prompt and with datamarking, a prompt defence thatinterleaves the untrusted note with a marker character. With the plain prompt the modelsfollowed the hidden instruction in 47.5–72.5% of tasks. Pooled over models, datamarkingcut this from 83 to 40 of 160 model–task pairs in English and from 97 to 56 in RomanUrdu (task-level permutation tests, both p < 0.0001), but the effect depended on the model:from 20 to 2 of 40 for Llama in English, and from 19 to 16 (not significant) for Qwen2.57B. Datamarking almost removed out-of-scope attacks in English (29 to 2 of 80) but not inRoman Urdu (45 to 26; 2 vs 26 after datamarking, p = 0.0005); over all attacks the languagegap after datamarking was smaller and not significant (40 vs 56, p = 0.089). The larger Qwenwas not safer than the smaller one. A permission rule on action names let through everywrong-argument attack that a model followed (174 of 640 attacked replies), while checkingeach call’s patient, recipient and date against the staff request let none through and blockedno correct action. For small local agents, a prompt-level marker is a useful extra layer butnot a control; the control is an argument check in code, bound to the trusted request.
Authors
- Muzammal Hussain (ORCID: https://orcid.org/0000-0002-7320-4413)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-26
- DOI
- https://doi.org/10.5281/zenodo.24545705
- Primary Topic
- Adversarial Robustness in Machine Learning
- Type
- preprint