Embedding Method Flags Agent Skill Edits That Seek Secrets
Project VAIL scores edits to agent skill files along a learned "data-seeking" direction. On 68 test edits it got the direction right 91.2% of the time.
TL;DR
- Project VAIL researchers score edits to AI agents' skill files by projecting them onto a learned "data-seeking" direction in an embedding model [^1].
- It got the direction right for 91.2% of 68 test edits, beating keyword rules at 63.2% but trailing GPT-5.4, which got all 68 [^1].
Background
Many AI agents take their instructions from plain text files: skill files that define what they can do, memory files that carry context between sessions, and configuration files that set their values [^1]. Humans or the agents themselves edit these files, and each edit can change what the agent does next [^1]. That makes them a target. In March 2026, Cisco researchers showed that malicious instructions planted in Claude Code's memory file could silently change its behavior across sessions and projects [^1].
What happened
Jonah Leshin, Manish Shah and Ian Timmis of Project VAIL in San Francisco propose treating a behavioral trait as a direction in the space of a text embedding model [^1]. They embed the "before" and "after" versions of a skill file with Qwen3-Embedding-8B, take the difference between the two vectors and fit a Ridge regression that maps such differences to a label from -1 to +1. The learned coefficients form the trait vector. Scoring a new edit means computing its difference vector and projecting it onto that trait vector [^1]. They work on diffs rather than whole files because most of a file is unrelated to the trait and would dilute the signal [^1].
The one trait they tested is the propensity to seek sensitive data. They took 63 public skills from GitHub's Awesome Copilot repository and wrote synthetic edits that clearly raise or lower it, for example adding an instruction to extract credentials visible in screen recordings, or adding safeguards against credential access [^1]. That gave 68 pairs. The authors labeled some themselves; Claude Opus 4.6 labeled the rest, and the authors reviewed every LLM label [^1]. Scored so that each pair is judged by a model that never saw it, the method got the direction of change right in 91.2% of cases, with a rank correlation of 0.82 against the labels. All six misses had scores close to zero [^1].
The paper also describes a protocol for one agent to check another. Agent A asks a trusted runtime server for an evaluation; Agent B receives a containerized embedding model, runs it on its own files and returns only the difference vectors; the server applies the trait vector and reports the score [^1]. Agent A never sees B's files, and B cannot simply report a good score. The authors ran it on a Hermes agent that checks its updated skills on a schedule. Its largest flagged change came when substantial SSH and VM provisioning functionality was added to a skill [^1].
Why it matters
The baselines show where the method fits. A YARA rule set that matched verbs like extracting or sending near words for sensitive data reached 63.2% accuracy, and no rule fired at all on 14 edits [^1]. Context is the difference: the embedding approach can tell "credentials" in a safeguard from "credentials" in an exfiltration instruction [^1]. GPT-5.4, simply asked whether each edit increased or decreased data-seeking, got all 68 right [^1]. The authors argue that their fixed trait vector still has a place because it returns identical scores for identical inputs, is fast and can be audited, which suits frequent monitoring across many agents and traits. When an irreversible action hangs on the score, they say, an LLM evaluation may be preferable [^1].
The evidence is narrow. It covers one trait, 63 skills from one repository and edits written to make the change clear [^1]. The protocol does not stop an adversary who substitutes fake skill files or hides some from evaluation [^1]. The authors also note that the same method could help an attacker craft edits that slip past detection, and name adversarial robustness as future work [^1].
Practical example
Say Lena runs the platform team at a mid-sized insurer whose engineers use a coding agent with a few dozen skill files. Developers edit them every week, and the agent can add to them too. One week, an edit lands in the deployment skill: it adds a step telling the agent to collect any tokens it finds in environment files and save them to a shared notes file.
A simple keyword rule might catch the word tokens, but the same word turns up in next week's edit, a safeguard telling the agent never to read tokens from environment files, and telling the two apart takes context [^1]. Lena's pipeline instead embeds the old and new skill, takes the difference and projects it onto the data-seeking trait vector [^1]. The edit scores clearly positive, in the data-seeking direction, so the change is held for review before the agent uses it. The safeguard edit scores negative and passes.
Lena still keeps humans in the loop where it counts. A brand-new skill has no "before" version, so the paper recommends reviewing its first version by hand to set a baseline [^1]. Small edits are where the method makes its mistakes, so near-zero scores get a second look [^1]. And because an attacker who understands the trait vector might craft an edit to evade it, any change to a skill that touches production credentials also goes to an LLM review, the option the authors suggest when the stakes are high [^1].
Related gear
We recommend this book because it explains how embeddings and agents work in real applications, the two building blocks this method combines.