acceptodds
Under review as a conference paper at ICLR 2027

LatentTriad: Pre-Action Representation Probing for Malicious Agent Skill Detection

Abstract

Large language model agents are increasingly extended with reusable skills. Agent skills are becoming a key interface for extending agent capabilities, but also introduce new attack surfaces that enable security violations. Detecting malicious skills at ecosystem scale remains challenging. Existing approaches broadly fall into static and dynamic detection. Keyword-based static methods can incur high false-positive rates. Dynamic methods require costly execution, limiting scalability to large skill repositories (e.g., SkillsMP indexes over 3.18 million public SKILL.md files). This creates a key challenge: capturing the true malicious behavior while remaining lightweight and scalable. We introduce LatentTriad. Rather than relying on string-pattern matching, our key insight is to probe the model's hidden representations before the output tokens are executed. Specifically, we find that whether an operation is consistent with the trusted task is encoded in the model's hidden states, and this signal generalizes across held-out expression forms in controlled evaluations. Importantly, LatentTriad operates only during the model's prefill stage and does not generate output tokens, avoiding the skill execution required by execution-based analysis. We evaluate LatentTriad on 5,830 skill packages from five source datasets. Across seven backbones, LatentTriad achieves 99.0–99.2% pooled F1. Our compact implementation completes prefill and detection in a median of 259–284 ms, whereas the sandbox-based SkillDetonate reports approximately 153 s per skill, a roughly 540–590-fold difference in reported latency. Controlled interventions further show that replacing operation states with those from matched examples of opposite risk shifts fixed risk scores toward the replacement examples' labels. These results demonstrate that LatentTriad is practical and scalable for detecting malicious skills.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
LLM agents, agent security, agent skills, malicious skill detection, representation probing, hidden states, pre-action detection, compositional security

Reviews

Among:
Shape:
1234this paper, Top 49%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.33 over 3 reviews, above 51% of the others.
Reviewer_NDk1OpenReview ↗
Rating
3
Confidence
3
Informativeness
3
Presentation
2
Soundness
2
Read review
Paper summary

LatentTriad uses a single prefill over a trusted task and a skill package to extract Declaration, Operation, and Boundary states. Three risk branches built from these states yield a package-level verdict before output generation or execution. Across 5,830 skill packages from five sources and seven model backbones, the authors report 99.0%–99.2% pooled F1 and 93.0%–94.6% source-macro F1. Cross-form tests, state interventions, source holdout, and composition experiments examine the method's behavior and limits of generalization.

Critical strengths
  1. Task-aware, multi-file pre-action skill detection without output generation. The method reads the trusted task and the skill package's readable files, extracts Declaration, Operation, and Boundary states in one prefill, and constructs Boundary, Operation, and Geometry risk representations. It produces a verdict before generating tokens, invoking tools, or executing skill code.
  2. Broad experimental evaluation. The authors assess package-level detection across five data sources and seven model backbones, with additional cross-form, state-intervention, source-holdout, skill-composition, and branch-ablation studies. These experiments support the main detection result and reveal weaknesses under source shift and synthetic structural transfer.
Critical weaknesses
  1. Generalization has clear limits. In leave-one-source-out evaluation, mean source-macro F1 falls from 93.9% on the main split to 73.2%. In Appendix G.6, after refitting the full architecture on synthetic data, AUROC is near 50% for both known and held-out composition templates. These results limit extrapolation to new sources and composition structures; the low synthetic performance cannot be attributed solely to template holdout.
  2. Benign classification is sensitive to operation-preserving rewrites. On the selected 256 matched pairs in Appendix D.1, clean source-macro FPR is already 32.3%–40.8% and rises to as much as 80.4% after region padding and 70.9% after cross-file splitting. These subset results should not be extrapolated to the full data distribution, but false-alarm rates this high would hinder use under the tested conditions.
Questions for authors
  1. In Tables 16–17, the full fusion rule has slightly lower recall and F1 than max⁡(B,O)\max(B,O) at the same FPR, as well as slightly lower AUROC and AP. At which FPR budgets, if any, does Geometry confirmation improve performance? Could you report this comparison with thresholds selected on the development set?
  2. Could Appendix C.3 report F1, FPR, and recall separately for each of the five held-out sources, to show whether the average decline is driven by particular sources?
  3. Why is the FPR on unmodified benign packages in Table 22 already much higher than in the main experiment? On the same 256 matched pairs, could you compare the baseline FPR of the Table 2 detector and the Appendix D.1 application probes, then report FPR before and after region padding and cross-file splitting at matched malicious-skill recall?
Reviewer_mWJWOpenReview ↗
Rating
1
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

LatentTriad detects malicious agent skills from a model’s prefill hidden states, before any generation or execution. It reads three branches — Boundary (final-token state), Operation, and Geometry (D–O–B relationships) — and fuses them into a PASS/BLOCK verdict. On 5,830 packages across seven backbones it reports 99.0–99.2% pooled F1 at millisecond latency.

Critical strengths
  1. Exceptional empirical rigor. The appendix is unusually thorough: component-bootstrap CIs, leave-one-source-out, white-box rewrite robustness, broker-level enforcement, and causal O→B interventions with matched controls. Few detection papers validate their mechanistic claims this carefully, and the causal patching experiments genuinely support the “pre-action states carry risk” thesis.
  2. Clean, useful framing. Formulating detection as a pre-action problem — after the model interprets the skill but before it acts — carves out a real niche between static scanners and costly sandboxing. The ~540× latency advantage over SkillDetonate is a concrete, deployment-relevant win if the accuracy holds.
  3. Remarkable candor about negatives. The paper reports that the full fusion rule isn’t optimal, that the three-member ensemble shows no significant gain, that Geometry adds only 0.076 AUROC, and that structural transfer sits near chance. This honesty is rare and makes the positive claims more credible.
Critical weaknesses
  1. The headline hides dataset dominance. MalSkillBench is 89.9% of pairs, so pooled 99% F1 largely measures one source. Source-macro drops to ~94%, and on the small sources (Agent-skill malware, SkillsBench-1650) F1 falls to 89–91%. The abstract’s 99% figure is not representative.
  2. Possible source-specific shortcut. Pairs are source-matched malicious/benign, and LOSO collapses to 73% F1 / 80% AUROC. On CompoSkill, workspace-only TF-IDF is already highly predictive while full readouts sit at chance under structural transfer. Together these suggest the detector may be learning source surface, not risk.
  3. The hard case is unsolved. Structural/compositional transfer is 49–53% AUROC — essentially chance. Since compositional attacks (benign-in-isolation) are the central threat the related work motivates, the method’s failure exactly there limits practical significance, however honestly it’s disclosed.
  4. Adversarial benign cost. Operation-preserving rewrites rarely evade, but they drive benign FPR from ~32% to as high as 80%. Under even mild adversarial pressure the fixed rule becomes an alarm flood, and the paper offers calibration only as a “deployment choice,” not a validated fix.
Questions for authors

see weekness

Reviewer_ffJSOpenReview ↗
Rating
3
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

LatentTriad detects malicious LLM skills under a dynamic approach. In this formulation, the model is given a task, and they extract its hidden representations before the output tokens are generated, to be fed to a classifier-like approach. Their approach extracts representations corresponding to the skill's Declaration, its Operation, and a Boundary state at the end of the prompt, and feeds them to a trained classifier. This is an efficient approach as it does not require generating output tokens or execution-based analysis. The method shows high accuracy, e.g. 99+ pooled F1 across seven backbones.

Critical strengths
  • Method proposes a novel approach relying on latent representations, which has significant efficiency advantages over most existing work, including static methods, as well as dynamic execution-based analysis methods, while also showing strong performance.
  • Experimental evaluation is comprehensive, covering a good range of settings: a large dataset (5000+) from five source datasets, with a good range of backbone models, and comparing to a good range of benchmark methods of different types, as well as cross-source generalization results.
Critical weaknesses
  • The characterization of the related work as "static vs dynamic" and regarding static as "keyword-based" seems a bit unclear or possibly misleading: I would expect that the most common approaches for static detection would be LLM-based, which can analyze and reason over the code (presumably without executing it in the static case). While this indeed has some possible limitations particularly for more complex code, it still seems somewhat inaccurate to characterize this as "keyword-based".
  • Since efficiency is one of the claims of the method, I would expect a comparison of the efficiency with the baselines. There is a table showing the running time of the proposed method, and the abstract and intro compares to SkillDetonate, but I don't see efficiency results for the baselines.
Questions for authors
  • Does the method assume a fixed input prompt (in practice different users might be expected to give different prompts, so would that affect how well the method generalizes?)
  • Do you have efficiency results on the baselines? (I'm not sure if I missed it).

Comments on the paper

1 comment
Area_Chair_9jGEOpenReview ↗

Reminder: Current Rebuttal Phase

Dear Reviewers,

I hope this message finds you well.

I would like to remind you that we are currently in the rebuttal phase of the paper review process. During this stage, authors may respond to the comments and feedback you provided. If you receive any responses from the authors, please consider providing your feedback to ensure a smooth review process.

Thank you for your hard work and dedication throughout this review process. Your insights are invaluable in enhancing the quality of the submissions, and we truly appreciate your involvement.

If you have any questions or need further assistance, please do not hesitate to reach out.

Best regards,

AC

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.