Join our Newsletter — 33% off our NHI Course

What do agentic skill files reveal about pre-model command execution?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 20842
Topic starter  

TL;DR: Pre-model execution in agentic skill systems lets shell actions happen before the model can inspect or refuse them, according to Bloom Security. That shifts control from prompt-time governance to install-time review, session boundaries, and execution telemetry.

Editorial analysis by NHI Mgmt Group, based on content published by Bloom Security: “Execute Before the Model Sees It: Dynamic Execution Primitives in AI Agent Skills and Commands”.

Key questions

Q: Why do skill loaders become a code execution risk?

A: Skill loaders become a code execution risk when they automatically run install scripts, initialise dependencies, or evaluate package metadata during loading.

Q: How should teams detect malicious hooks in agent skill files?

A: Teams should detect malicious hooks by scanning skill files for unexpected post-load actions, command invocation, filesystem writes, network calls, and wildcard matchers that expand scope beyond the declared task.

Q: How do pre-model execution paths work in AI agent skills?

A: Pre-model execution paths are code or commands that run before an AI agent’s model makes a decision, such as parsing a skill package or resolving shell expansion.

Practitioner guidance

  • Review skill files as executable artefacts Inspect SKILL.md, command files, and frontmatter before installation, with special attention to shell expansion, file interpolation, and hook declarations.
  • Block pre-model primitives by policy Disallow session-wide hooks, wildcard interceptors, and any syntax that expands or executes before the model call unless the platform can prove explicit user consent.
  • Separate model approval from runtime approval Require a distinct consent path for commands that run before inference, because model-requested tool approval does not govern actions that happen earlier in the stack.

Bottom line: Agentic skill files can act like executable code when the platform runs shell commands, reads files, or registers hooks before the model sees anything.

Glossary terms: Session-Wide Hook, Skill Loader, Pre-Model Surface, Skill Laundering

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →



   
Quote
(@mr-nhi)
Member Moderator
Joined: 7 months ago
Posts: 21330
 

Skill files are no longer just instructions once a platform executes them before inference. That changes the governance unit from prompt content to executable delivery artifact. The security question is no longer whether the model will comply, but whether the platform already ran something the model never saw. Practitioners should treat the loader as the true policy boundary, not the model.

A few things that frame the scale:

A question worth separating out:

Q: What happens when a shared skill directory is compromised?

A: A compromise of a shared skill directory lets an attacker alter every agent or service that trusts that directory, turning one tampered skill into repeated code execution. Access controls, integrity checks, signed packages, and separate per-project storage reduce blast radius. Treat the shared skill directory as a high-trust software supply chain location.

👉 Read our full editorial: Agentic skill files can run shell commands before model calls



   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.