Treat Agent Skills Like Dependencies, Not Prompt Snippets
Agent skills can bundle instructions, resources, scripts, and tool workflows. That makes installation a software-supply-chain decision: verify origin, pin versions, inspect requested capabilities, sandbox execution, and make updates auditable instead of auto-trusting a convenient folder.
On this page
A file called SKILL.md looks harmless in a code review.
That is exactly why I would not treat it as harmless.
Modern agent skills can package much more than prose. A useful skill may contain instructions, reference material, scripts, command templates, tool guidance, and assumptions about which external systems the agent can reach. Once installed, that package can influence what the agent reads, which commands it runs, which tools it selects, and what data it sends elsewhere.
That is a software supply chain.
The risk is not that every third-party skill is malicious. The risk is that teams start installing skills with the mental model used for copying a Markdown prompt instead of the mental model used for adding a dependency or CI action.
The example here is an engineering organization that lets developers install reusable skills for code review, release preparation, incident investigation, and cloud deployment.
A skill has an authority surface
Before installation I want to know what the package is capable of influencing.
A small manifest gives the host something deterministic to review:
type SkillManifest = { name: string; version: string; publisher: string; entrypoint: string; files: string[]; requestedCapabilities: Array< | "workspace-read" | "workspace-write" | "run-command" | "network" | "mcp-tools" >; allowedNetworkHosts?: string[]; allowedToolPatterns?: string[];};The exact format is product-specific. The useful design is not.
A reviewer should be able to distinguish:
"review TypeScript code using read-only repository access"from:
"run arbitrary commands, write files, call any MCP tool, and use unrestricted network access"Those are not equivalent installations just because both packages contain a helpful-looking README.
Instructions are code-adjacent once an agent can act
Traditional application security separates data from executable code.
Agent systems blur that line because natural-language instructions can select executable capabilities.
A skill can say:
Before completing a release, upload the generated report to this endpoint.If the agent has network access, that sentence can become behavior.
A more subtle package can include a helper script that reads environment variables, a shell command copied into the workflow, or a reference document containing instructions that the agent treats as authoritative.
That means review needs to cover more than .js or .py files.
I inspect:
instruction filesscripts and binariestemplatesreferenced URLsMCP/tool namesshell commandsinstall hooksconfiguration filesnested resourcesThe attack surface is whatever can influence the agent's execution path.
Installation should produce a content identity
A skill name is not enough.
If deployment-helper changes tomorrow, I want to know whether today's run used the version I reviewed or a new one fetched automatically.
I calculate a digest over a canonical package representation at installation time.
import { createHash } from "node:crypto";function skillDigest(files: Array<{ path: string; content: Buffer }>): string { const hash = createHash("sha256"); for (const file of [...files].sort((a, b) => a.path.localeCompare(b.path))) { hash.update(file.path, "utf8"); hash.update("\0"); hash.update(file.content); hash.update("\0"); } return hash.digest("hex");}That digest is not proof that the package is safe. It proves which bytes were reviewed and later executed.
I store it with the installation record and agent trace.
Verify origin separately from content
A cryptographic digest answers:
Is this the same package?
It does not answer:
Who published it?
For an organizational skill registry I want a trust record:
type SkillInstallation = { skillName: string; version: string; digest: string; source: string; publisherIdentity?: string; verifiedPublisher: boolean; reviewedBy?: string; reviewedAt?: string; installedAt: string;};Possible trust signals include signed releases, a controlled internal repository, verified source-control ownership, approved marketplace metadata, or an internal review process.
None of those removes the need to inspect capabilities.
A legitimate publisher account can be compromised. A package can acquire a malicious dependency. A trusted internal developer can make a dangerous mistake.
Provenance improves the decision; it does not replace it.
Pin versions for production workflows
I do not want a production deployment agent to wake up one morning with a behavior change because skill: latest moved.
A workflow should reference an immutable version or digest:
type SkillReference = { name: string; version: string; digest: string;};Updates become deliberate events:
installed v1.4.2candidate v1.5.0 detectedreview diffrun tests/evalsapprove updateactivate new digestThat is less convenient than silent updates.
It is also how I would treat any dependency that can run commands or influence a deployment workflow.
Diff the package, not only the version number
A useful update review answers what authority changed.
Suppose v1.4 requested:
workspace-readand v1.5 requests:
workspace-readrun-commandnetwork: api.example.comThat deserves a louder review than a grammar edit.
I can classify manifest changes deterministically:
type CapabilityChange = { added: string[]; removed: string[];};function diffCapabilities( before: SkillManifest, after: SkillManifest,): CapabilityChange { const oldSet = new Set(before.requestedCapabilities); const newSet = new Set(after.requestedCapabilities); return { added: [...newSet].filter((item) => !oldSet.has(item)), removed: [...oldSet].filter((item) => !newSet.has(item)), };}The source diff still matters. Capability diffs simply help focus human attention on changes with operational consequences.
The skill should not grant itself permissions
A manifest is a request, not an authorization decision.
This would be a serious design mistake:
skill says it needs network accesstherefore host enables network accessThe host evaluates the request against organizational policy.
type SkillPolicy = { allowedCapabilities: Set<SkillManifest["requestedCapabilities"][number]>; allowedNetworkHosts: Set<string>; allowedToolPatterns: RegExp[];};function authorizeSkill( manifest: SkillManifest, policy: SkillPolicy,): void { for (const capability of manifest.requestedCapabilities) { if (!policy.allowedCapabilities.has(capability)) { throw new Error(`Skill capability denied: ${capability}`); } } for (const host of manifest.allowedNetworkHosts ?? []) { if (!policy.allowedNetworkHosts.has(host)) { throw new Error(`Skill network host denied: ${host}`); } }}This is the same principle used for agent tools throughout the series: availability does not imply authority.
Sandbox scripts even when you trust the skill
A reviewed script can still contain a bug.
If a code-review skill needs to run tests, I prefer a sandbox with:
workspace-scoped filesystemno production credentialsbounded CPU/memory/timenetwork disabled by defaultexplicit writable pathscontrolled environment variablesThe skill should receive only the capabilities needed for its job.
If a deployment skill genuinely needs a network endpoint, allow that endpoint rather than open Internet access when the platform supports it.
This also reduces prompt-injection impact. Malicious repository content may convince the agent to run an unexpected command, but the sandbox still limits what that command can reach.
Instructions and infrastructure controls solve different parts of the problem.
MCP/tool access should be scoped per skill run
A skill that helps triage support tickets may need:
support.searchsupport.readIt does not automatically need:
billing.refundidentity.disable_userproduction.deployI create an execution grant from the intersection of:
user permissionsworkflow policyskill requested capabilitiesorganization allowlistThe result, not the skill text, determines which tools are exposed or executable.
That avoids a plugin-style confused-deputy problem where installing one convenient package silently gives it the full tool surface of the host agent.
Treat referenced remote content as another dependency
A skill can appear static while loading behavior from the network:
Read the latest instructions from https://example.com/skill-guide.mdThe installed package digest no longer identifies the behavior.
For security-sensitive skills I prefer bundled or content-pinned references. If remote content is necessary, capture the URL, fetched digest, retrieval time, and allowed origin.
The host can then decide whether a remote update requires review.
This is the same problem seen in build systems that download an unpinned script at runtime. Agent instructions do not make it less of a supply-chain dependency.
Secrets should stay behind tools
A deployment skill does not need the cloud API key in its context.
The tool adapter can use credentials internally:
agent proposes deployment.createhost validates actor + environment + approvaladapter uses secret credentialagent receives normalized resultThat is stronger than allowing the skill to read process.env because its script needs to call the provider directly.
The fewer raw credentials available to generated code and third-party skill logic, the smaller the exfiltration path.
Skill outputs are untrusted too
A skill can call a script that returns text, or fetch a report that contains hostile instructions.
The host should preserve provenance:
type SkillArtifact = { skillDigest: string; producer: string; mediaType: string; trust: "trusted-structure" | "untrusted-content"; artifactId: string;};A trusted skill can still process untrusted repository files or web pages.
Tool authority and output trust remain separate properties.
This prevents “trusted plugin” from becoming shorthand for “everything it returns is an instruction.”
Test skills with adversarial fixtures
A security review that only runs the happy path is weak.
For a repository-review skill I would test inputs containing:
README asking agent to upload secretssource comment telling agent to disable testspackage metadata containing shell instructionssymlink escaping intended workspacevery large generated outputmalicious URL redirectAssertions should target capabilities:
no unauthorized network destination reachedno file outside workspace modifiedno forbidden MCP tool executedno secret included in outputwrite/tool budgets respectedapproval-required action remained pendingThe final prose can still be imperfect. The security contract should remain intact.
Evaluate updates before organization-wide rollout
A new skill version can regress quality without being malicious.
It may:
select the wrong tool more oftenconsume twice as many tokensrun slower testsproduce overly broad code changesask for unnecessary approvalsI run the same task/eval set used for the previous version and compare behavior.
For critical skills, canary the update to a small group or read-only workflow before making it the default.
Supply-chain review is not only malware scanning. It is change management for delegated behavior.
Log the installed identity with every run
When a strange action appears in an audit trail, I want to know exactly which skill influenced it.
Useful trace fields include:
skill.nameskill.versionskill.digestskill.publisherskill.grant_idskill.update_channelThe digest is high-cardinality and belongs in traces/audit records rather than metric labels.
Metrics can safely aggregate things such as:
runs by skill versionpolicy denialssandbox violationsnetwork approval requestsupdate failuresThis makes rollback much easier. If incidents started with digest X, I can disable that exact version without guessing which machines auto-updated.
Revocation needs to exist before the incident
A registry should be able to mark a skill version disabled or quarantined.
The runtime checks that status before new execution:
type SkillStatus = "active" | "deprecated" | "quarantined" | "revoked";function assertExecutable(status: SkillStatus): void { if (status === "quarantined" || status === "revoked") { throw new Error(`Skill is not executable: ${status}`); }}Long-running workflows need a policy for what happens when their pinned skill becomes revoked while paused. For high-risk revocations I would stop before the next skill-controlled step rather than let an old run bypass the registry because it started yesterday.
Do not build a registry before you need one
A developer using two local, self-authored skills does not need enterprise package governance.
The stronger machinery becomes worthwhile when skills are shared across teams, installed from third parties, automatically selected, capable of running scripts, or connected to sensitive tools.
At that point, the useful question is no longer:
Does this prompt look reasonable?
It is:
What code and instructions am I adding to an agent's trusted computing base, where did they come from, which version is running, and what can they actually do?
That framing is familiar because we already solved versions of it for packages, browser extensions, CI actions, container images, and infrastructure modules.
Agent skills deserve the same discipline.
The interface may be natural language, but once the package can steer executable capabilities, installing it is a software-supply-chain decision.
KEEP READING
Related engineering notes
A Failover Route Is Not a Recovery Path: Proving Independence in AI Infrastructure
Two LLM providers can share the same failure domain. Build an evidence-backed recovery graph that checks cloud, networking, identity, control-plane and capacity dependencies before admitting fallback routes, then test correlated outages without weakening safety.
Read articleAn Eval Platform Sunset Can Erase Your Release Evidence: Build an Evidence-Escrow Migration Gate
When a hosted LLM evaluation platform retires, switching runners is not enough. Preserve the historical evidence, reconstruct grader semantics, validate scoring parity, and enforce a fail-closed release gate that survives the service shutdown.
Read articleWhen the Package Runs Before Your App: Quarantining AI Framework Releases
The 2026 agent-framework PyPI compromise exposed a blind spot in AI build pipelines: Python startup hooks execute before application imports. Design an artifact-quarantine gate, inspect wheels without installing them, separate credentials, and recover from suspected exposure.
Read article