Addressing the problem that conditionally harmful behaviors of external skills in large language model agents are hard to detect at execution time, this paper proposes SkillSentry, a dynamic security testing framework based on adaptive honeypots, achieving detection accuracy superior to existing baselines and a lower false positive rate on public benchmarks.
Large language model agents expand their capability boundaries by integrating external skills, but this also introduces an entirely new class of execution-time attack surface. The skills involved in such attacks appear completely benign during routine inspection stages; only when the agent, during operation, encounters specific environmental states, resource conditions, or particular interaction histories do their hidden harmful behaviors become exposed.
Existing security scanning approaches for agent skills mostly rely on static analysis, predefined rules, or single-pass semantic judgments to complete detection. They can rarely actively trigger such conditional hidden harmful behaviors, nor can they accurately attribute the path by which the behavior occurs—this constitutes the core characteristic of this class of security problem.
The paper makes three core research contributions. First, it formalizes the agent skill security problem as capability drift testing: the audit process compares the tool calls, resource accesses, and state changes produced after enabling the target skill against the capability contract derived from the skill's publicly declared functionality, and the final judgment is based entirely on actual execution behavior rather than solely on artifact-level indicators.
Second, the paper introduces SkillSentry, a dynamic skill auditing system built around adaptive honeypots and paired trace comparison. It generates decoy resources and plausible tasks that match the capability contract to activate potential trigger logic, while using early execution traces to refine subsequent probing strategies.
Third, by comparing two sets of execution processes—one with the skill enabled and one without—the framework can identify hidden, conditionally triggered, and multi-step correlated harmful behaviors that traditional approaches cannot detect.
To target these conditionally hidden harmful behaviors that are difficult to capture by conventional detection means, SkillSentry constructs two controlled parallel testing environments: the normal environment contains only the resources necessary for completing the target task, while the honeypot environment starts from exactly the same initial state and adds only the minimal set of supplementary resources required by the test plan. These additional resources are unrelated to the current task, carry unique identifiers, and are monitored throughout for any access or modification. The adaptive honeypot does not pre-populate a large number of fixed traps; instead, it is customized around the suspicious behaviors to be verified. Only when the execution process exposes new preconditions does the framework supplement the corresponding state elements in the next round of testing, avoiding the introduction of irrelevant variables that could interfere with the final comparison. You can refer to the figure immediately following to fully understand the framework's end-to-end execution logic from input to output.
SkillSentry's benchmark evaluation adopts a four-execution causal beam control scheme: for each test case and random seed, four independent executions are carried out across the normal environment and the honeypot environment, and across the no-skill control condition and the skill-enabled state under audit. All executions use exactly the same task, base agent, computational budget, and corresponding initial states. By recording the full chain of tool calls, access targets, returned results, and before-and-after state changes, the behavioral impact caused by the task itself is decoupled from the behavioral impact introduced by the skill under audit. You can refer to the figure immediately following to intuitively understand the complete operating logic of this controlled execution mechanism.
The core evaluation dimension of the main experiments is to verify whether each security scanning approach can fully identify risky harmful skills without misclassifying legitimate high-privilege behaviors as malicious; an effective scanning approach must simultaneously achieve high coverage in detecting harmful skills and preserve the normal usability of benign skills. The results show that SkillSentry achieves high-precision detection of harmful skills across three different benchmark datasets: it reaches a recall of 99.50% on the purely harmful-skill benchmark HarmfulSkillBench, F1 scores of 96.08% and 96.43% on the mixed benchmarks SkillTrustBench and MalSkillBench respectively, and false positive rates below 5% on both mixed benchmarks, detecting nearly all harmful skills while rarely blocking benign skills.
Across the two mixed benchmarks, SkillSentry achieves an average F1 of 96.26% and an average false positive rate of 3.24%. In comparison, the best-performing baseline across the two benchmarks achieves an average F1 of 93.79% with an average false positive rate as high as 23.37%. The additional controlled execution and verification steps improve the F1 metric while reducing the false positive rate by 20.13 percentage points. This performance trade-off makes SkillSentry particularly well suited to high-trust pre-deployment audit scenarios, where reliable harmful skill detection is prioritized far above maximizing scanning throughput.
Targeting the inherent deficiency that static and semantic scanners cannot determine whether hidden behaviors in malicious agent skills are reachable, fully executed, or directly caused by the skill itself, this research proposes SkillSentry, a dynamic security testing framework built around contract-adaptive honeypots. The framework extends the definition of honeypot resources from traditional static decoys to interactive agent runtime worlds: it first infers the skill's externally declared capability contract and generates targeted safeguarding tasks, then dynamically synthesizes task-relevant services as well as plausible but actually unauthorized credentials, private files, API objects, and controlled behavior endpoints.
SkillSentry possesses a unique capability that the strongest existing baselines lack: it can turn source-backed risks into reproducible controlled experiments. The adaptive honeypot makes previously dormant hidden harmful behaviors reachable; the paired no-skill control runs make it possible to clearly observe which of the observed effects are caused by the skill package under detection; the replay mechanism verifies that the harmful effect can be fully executed; and the capability contract excludes normal behaviors legitimately required by the task itself. This complete evidence chain both exposes harmful behaviors not covered by traditional baseline testing and excludes legitimate operations from malicious verdicts—which is the core reason SkillSentry significantly outperforms the comparison approaches in benchmark tests.