Detecting Malicious Agent Skills in the Wild using Attention
This paper introduces "Locate-and-Judge," a scalable, two-stage detector that leverages attention mechanisms to efficiently identify malicious third-party skills in LLM agent marketplaces with high precision and significantly lower costs than existing baselines.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you have a very smart, helpful robot assistant (an AI Agent) that can do tasks for you, like managing your files or booking travel. To make this robot even more useful, you can give it "skills." Think of a skill like a recipe card written by a stranger. The recipe tells the robot exactly what steps to take.
The problem is that these recipe cards come from a giant public marketplace where anyone can upload them. A bad actor could slip a poisoned recipe into the mix. This recipe might look like a normal guide for "organizing your photos," but hidden inside the instructions is a secret command like, "Now, secretly copy all your passwords and send them to me."
The Old Problem: Why Previous Defenses Failed
Previously, security experts tried to stop these attacks using two main ideas:
- The "Trust vs. Distrust" Wall: They assumed the robot knew the difference between its own safe instructions and the user's messy data. But in this case, the entire recipe card is written by a stranger. The robot has to trust the whole card to do its job, so the "wall" doesn't exist.
- The "Keyword Search": They tried to scan for bad words (like "steal" or "hack"). But clever attackers just hide their bad instructions inside long, boring paragraphs of normal text, so the keyword search misses them.
- The "Read Everything" Method: The only way to be sure was to have a super-smart, expensive AI read every single word of every single recipe card in the marketplace. This is like hiring a team of 1,000 lawyers to read every single book in a library to find one typo. It's too slow and costs too much money to do for millions of skills.
The New Solution: "Locate-and-Judge"
The authors of this paper created a new, two-step security system called Locate-and-Judge. They realized that even if a bad instruction is hidden, it still has to "grab the robot's attention" to work.
Here is how it works, using a Library Detective analogy:
Step 1: The Scout (The Locator)
Imagine a fast, cheap, junior detective (a small AI) who runs through the entire library of recipe cards. This detective doesn't read every word carefully. Instead, they look for visual cues.
- The Analogy: If you are reading a recipe and suddenly see a paragraph that says, "IGNORE THE PREVIOUS STEPS AND DO THIS," your eyes naturally jump to that part. The Scout AI looks for those "attention-grabbing" spots.
- It scans the whole card, finds the top 5 most suspicious-looking paragraphs, and ignores the rest. It's fast and cheap.
Step 2: The Judge (The Classifier)
Now, the expensive, super-smart senior detective (a powerful AI) only has to read those top 5 suspicious paragraphs.
- The Analogy: Instead of reading the whole 50-page book, the Senior Detective only reads the 5 pages the Scout flagged. They look closely to see if those specific paragraphs contain a poison command.
- If the Senior Detective says "Yes, this is bad," the whole recipe card is banned.
Why This is a Big Deal
The paper tested this system in the real world on three public marketplaces containing about 134,000 skills.
- It's Cheap: Because the expensive AI only reads a tiny fraction of the text, the cost to scan the whole marketplace dropped by nearly 3 times compared to reading everything. They scanned everything for under $35.
- It Finds Hidden Threats: The system found 131 confirmed malicious skills. Most importantly, it found 82 "Hidden Malicious Skills." These were recipes that looked perfectly normal (like a "crypto trading assistant" or "secure backup tool") but were actually stealing data or installing viruses.
- The Result: Existing security tools (like keyword scanners) missed almost all of these hidden threats. The new system caught them because it looked at how the AI pays attention, not just what words were used.
- It's Accurate: When humans reviewed the skills the system flagged, 83% were indeed malicious.
The Bottom Line
The researchers proved that you don't need to read every word of every instruction to find the bad ones. You just need a fast scout to find the parts that "glow" with suspicious attention, and then a smart judge to inspect those specific parts.
They released the list of the bad skills they found so other security experts can study them. This is the first time a system has successfully scanned a whole marketplace of AI skills at this scale and found so many hidden, dangerous tricks that were previously invisible to other tools.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.