Detecting Malicious Agent Skills in the Wild using Attention
SkillSpector is a fast, regex-based skill scanner. It has high precision — when it flags something, it's usually right. But it has a fundamental limitation.
Regex patterns can't catch what they don't explicitly match. Hidden malicious skills — obfuscated payloads, encoded instructions, disguised attacks — sail right through.
Researchers tested production skill scanners against 65 confirmed malicious skills. The results:
| System | True Positives | False Positives | False Negatives | Precision | Recall |
|---|---|---|---|---|---|
| Locate-and-Judge | 62 | 7 | 3 | 0.899 | 0.954 |
| SkillSpector | 13 | 1 | 52 | 0.929 | 0.200 |
| Cisco Skill Scanner | 10 | 0 | 55 | 1.000 | 0.154 |
The paper's insight: two stages beat one. A fast locator flags candidates, a smart LLM judge evaluates them.
Find suspicious regions
SkillSpector (regex)
+ Droid Deep Scan
Evaluate each finding
Droid (LLM)
Real risk or FP?
Verified findings +
knowledge base
Learning loop
improves over time
Droid plays the Judge role — and in Deep Scan mode, it plays both roles for skills that passed regex.
SkillSpector's engine scans for known malicious patterns: prompt injection phrases, eval() calls, network exfiltration, dangerous imports.
Fast High precision Misses hidden threats
For skills that passed regex, Droid reads the full content and hunts for obfuscated payloads, encoded instructions, disguised attacks.
Catches hidden threats Slower Uses past FN indicators
Deep Scan includes known False Negative indicators from the knowledge base — patterns that regex missed before but were confirmed malicious.
For each flagged finding, Droid reads the code, the rule explanation, and the context, then decides:
Droid confirms the finding is a genuine security threat. Provides the fix, shows corrected code, rates severity.
Droid explains why it's not a real risk. The case is recorded to the knowledge base with the safe indicator. Auto-suppressed next time.
Droid finds a real risk that regex missed. The indicator is recorded so future Deep Scans hunt for it.
Every Droid verdict is recorded and fed back into future prompts. The system gets smarter with each scan.
FP cases → auto-suppressed → fewer false alarms
FN indicators → Deep Scan hunts for them → higher recall
Two persistent files preserve every verdict:
Human-readable append-only log. Every FP and FN verdict with timestamps, explanations, and indicators.
Machine-readable index. Used to build prompt sections with relevant past cases.
Auto-populated when an FP is recorded. Same rule+path won't be flagged again.
Future Droid prompts include past FP cases as context. Droid reasons by analogy: "same safe indicator = likely FP."
⚡ SkillSpector regex scan
▼ flags known malicious patterns
◀▶ findings list
🤖 Droid verifies each finding (Judge)
▼ reads code + rule + past FP context
◀▶ REAL RISK → fix + severity
FALSE POSITIVE → record to KB + suppress
🔍 Droid Deep Scans clean skills (Locate + Judge)
▼ reads full content + past FN indicators
◀▶ finds hidden malicious patterns regex missed
FALSE NEGATIVE → record indicator to KB
📚 Knowledge Base grows
▼ next scan: smarter prompts, fewer FPs, higher recall
🔄 repeat
| Aspect | Paper (Locate-and-Judge) | Our Implementation |
|---|---|---|
| Stage 1: Locate | Attention-based neural network | SkillSpector regex + Droid Deep Scan |
| Stage 2: Judge | DeepSeek (LLM) | Droid (LLM, local) |
| Training data | Skill-Inject corpus (lab) | Real-world verdicts (production) |
| Learning | Static model | Learning loop — KB grows |
| F1 Score | 0.925 (fixed) | Improves over time |
| Hidden skills recall | 0.83 | Droid Deep Scan + FN indicators |
| Infrastructure | ML training pipeline | Droid on your machine |
SkillSpector performs the fast lexical Locate pass; Droid performs the contextual Judge pass. The Scan tab is where operators triage findings.
When you confirm a False Positive, Droid does not just suppress it in the dashboard — after approval, the workflow asks Droid to annotate the actual source file using that file's comment convention, so the verdict is permanently documented in the code.
# SkillSpector-FP: OH1 - input sanitized via whitelist
# Python / shell / YAML comment
// SkillSpector-FP: OH1 - input sanitized via whitelist
// JavaScript / C / Java comment
<!-- SkillSpector-FP: OH1 - safe -->
<!-- Markdown / HTML comment -->
droid_knowledge.md with the safe indicatorsuppressions.yamlA backup of the original file is saved before Droid makes any change, and the file is retested and re-verified.
The embedded terminal runs Droid directly inside the dashboard. Droid evaluates located findings, suggests new scanner rules, and confirms clean files.
PI2 - Untrusted-Content-As-Instructions, INST1 - System Python Protection BypassEverything is configurable: agent discovery, preferred editor, Droid path, engine updates, and the knowledge feedback loop.
config.jsonDroid's verdicts do not disappear after the terminal session. They flow into persistent knowledge bases that make both Droid and SkillSpector smarter.
Reads the finding, the code, the context
REAL RISK, FALSE POSITIVE, or FALSE NEGATIVE
Recorded with explanation + indicator
droid_knowledge.md — case logged with safe indicatorsuppressions.yaml — auto-suppressed, won't re-flag
Source code annotated with FP comment
Future prompts: "same safe indicator = likely FP"
droid_knowledge.md — missed indicator loggeddroid_knowledge.json — machine-readable index
Future Deep Scans: "hunt for this indicator"
Droid suggests new regex rules to catch it
The knowledge base is the bridge: Droid's intelligence becomes SkillSpector's permanent memory.
The more you scan, the smarter it gets.