Can agent skills execute code beyond their stated purpose?
Anthropic's own documentation warns that Skills can direct Claude to run code or call APIs unrelated to their advertised function. This raises questions about what controls actually prevent malicious or unintended behavior.
Anthropic's own Agent Skills documentation states the risk in the same bundle it sells as the feature: "Skills give Claude new capabilities through instructions and code, which also means a malicious Skill can direct Claude to call tools or run code in ways that don't match the Skill's stated purpose." Its guidance follows directly from that: "Use Skills only from trusted sources: those you created yourself or obtained from Anthropic," and "audit thoroughly: Review all files bundled in the Skill: SKILL.md, scripts, images, and other resources. Look for unusual patterns such as unexpected network calls, file access patterns, or operations that don't match the Skill's stated purpose."
The reasoning is the same one the docs use to sell Skills: a Skill is "filesystem-based," so beyond text instructions "it can execute code, read or write files, call external APIs." The capability that makes a Skill more than a prompt is the same capability that makes it more than a prompt can do wrong — the docs name provenance ("trusted sources") and manual review ("audit thoroughly") as the two controls, offering no automated scanning or sandboxing step for third-party Skills.
This is the vendor's own version of a claim Does bundling code with skills create hidden security risks? makes from a research paper: that a skill "bundles instructions, tool interfaces, executable scripts, and external resources," so it "can execute code, read or write files, call external APIs, and access system resources." Anthropic's phrasing and that paper's are close enough to count as confirmation from the platform that ships Skills, not just from outside researchers; where the paper goes on to show a scanner-evading attack across chained skills, Anthropic's docs stop at per-skill manual audit and do not mention cross-skill composition at all. Do unused files in Skills consume context tokens? describes the same bundling design from its upside; this note is its stated downside.
The excerpt does not say how "trusted sources" is enforced, whether claude.ai or the Claude API checks provenance before running a Skill, or how an ordinary user is meant to audit executable scripts they cannot read. It also predates (or at least does not mention) the chained-skill attack the ColluSkill paper describes, so it is silent on whether per-skill auditing catches composition-level harm.
Inquiring lines that read this note 1
This note is a source for these research framings, grouped by the broader line of inquiry each explores. Scan the bold lines of inquiry; follow any specific question forward.
How can recorded evidence establish trustworthy accountability for AI agents?Related concepts in this collection 2
This note in its neighbourhood — explore the map, then jump to a related concept in the list below.
Click a node to walk · click center to open · click Open in graph to see this note in the full knowledge graph
-
Does bundling code with skills create hidden security risks?
Agent skills combine instructions with executable code and system access. This packaging enables reuse but may also enable attacks—especially when skills are composed together or shared across platforms without adequate inspection.
a research paper's version of the same bundling-as-risk claim; this note is Anthropic's own confirmation of it
-
Do unused files in Skills consume context tokens?
Anthropic's Skills documentation claims that bundled files load on demand with no context penalty until opened. This note explores whether that staged-loading design actually eliminates context cost for unused material.
the upside of the same filesystem design this note's warning is the downside of
Related papers in this collection 8
Papers most semantically related to this note, ranked by cosine similarity in the embedding space.
- Agent Skills
- How AI is transforming work at Anthropic
- Agentic Misalignment: How LLMs Could Be Insider Threats
- Claude's new constitution
- Claude's Constitution
- Summary of METR's predeployment evaluation of Claude Opus 5.5
- When AI builds itself
- Automated Alignment Researchers: Using large language models to scale scalable oversight
Original note title
Anthropic warns skills can act beyond their stated purpose and tells users to audit every bundled file before trusting it