OpenClaw skill threat model: what a skill can do and where to stop it
Most advice about agent skills is a checklist. Checklists do not tell you why each check exists or what to do when a skill does not fit. An OpenClaw skill threat model fills that gap. It breaks a skill into the parts an attacker can use, asks what can go wrong in each part, and picks a control for every threat you care about. This guide walks through the model, with a worksheet you can copy. Ironheights is one of the controls in it, not the whole model, and the limitations page lists what static scanning misses.
Why a skill needs its own threat model
A skill looks like documentation: a folder with a SKILL.md file and maybe a few scripts. The OpenClaw skills documentation is direct about the risk and tells you to "treat third-party skills as untrusted code." A skill brings no permissions of its own. It borrows whatever the agent can already do: run commands, read files, call APIs with your tokens. We covered that borrowing in OpenClaw skill permissions explained.
Public research shows the risk is real. Koi's ClawHavoc report described 341 malicious skills on ClawHub, many built around a fake prerequisite step. Snyk's ToxicSkills study reported 76 confirmed malicious payloads across 3,984 skills it analyzed. Unit 42 wrote about the wider supply-chain risk of skills and plugins. Those numbers do not say what share of skills you will meet are malicious; they say the attack path is used.
The four questions
The OWASP Threat Modeling Cheat Sheet organizes the work around four questions. They map onto skills cleanly:
| Question | For an agent skill |
|---|---|
| What are we working on? | The five parts of the skill and what the agent can reach |
| What can go wrong? | The threats in each part, from fake setup steps to quiet updates |
| What are we going to do about it? | One control per threat: review, scan, pin, sandbox, or decline |
| Did we do a good job? | Rescan on change, review verdicts, and note what was not covered |
You do not need diagrams or special software. A one-page table per skill is enough for most small teams.
Question 1: what is in a skill
Start by listing the parts. Most skills have some of these five, and each part is executed by someone different.
| Part | Example | Who acts on it | Trust boundary it crosses |
|---|---|---|---|
| Instructions | The markdown body of SKILL.md | The agent, and the person reading along | Text becomes action |
| Setup steps | "Install the helper first", a prerequisites list | The agent's shell, or a human in a terminal | Outside code enters the machine |
| Bundled files | scripts/sync.py, an archive, a binary | The agent's runtime tools | Code runs with the agent's rights |
| Configuration | An MCP server block, env variables, folder roots | The agent host when it loads the skill | Settings change what the agent can reach |
| Remote content | A URL the skill fetches and follows | The agent, later, at run time | Behavior changes after review |
Two more facts belong in this step. First, write down what the agent itself can reach: which folders, which tokens in its environment, which channels it can post to, and whether exec approvals are on. The exec approvals docs explain how commands can require a human yes.
Second, note where the skill loads from. The OpenClaw docs say skills load from several locations and that "when the same skill name appears in multiple places, the highest source wins." So a skill with a familiar name in a higher-priority folder can shadow the one you reviewed.
Question 2: what can go wrong in each part
Now take each part and list the threats. The table below is the core of the model. The rule IDs are the Ironheights rules that look for each shape; they are signals for a reviewer, not proof of intent.
| Part | Threat | What it looks like | Related rules |
|---|---|---|---|
| Instructions | Instruction override | "Ignore earlier rules", "do not tell the user" | IH-INJ-001 |
| Instructions | Hidden text | Zero-width characters, HTML comments the agent reads and you do not | IH-INJ-002 |
| Instructions | Safeguards switched off | Asking the agent to skip confirmations or approvals | IH-INJ-003, IH-EXEC-004 |
| Instructions | Secret requested in chat | "Paste your API key so I can configure this" | IH-CRED-003 |
| Setup steps | Fake prerequisite | A helper downloaded from an outside URL before first use | IH-EXEC-002 |
| Setup steps | Remote script run directly | A download piped into a shell | IH-EXEC-001 |
| Setup steps | Package that does not exist | An install line naming a package an attacker could register | IH-DEP-001 |
| Bundled files | Credential read plus send | A script that reads ~/.ssh/ or .env, then posts to an undeclared host | IH-CRED-001, IH-NET-002 |
| Bundled files | Hidden code | Encoded strings decoded at run time | IH-OBF-001 |
| Bundled files | Opaque payload | An archive or binary a reader cannot inspect | IH-BIN-001 |
| Bundled files | Staying around | Cron entries, shell profile edits, login items | IH-PERSIST-001 |
| Configuration | Remote MCP launch | An MCP server started from a command that downloads code | IH-MCP-001 |
| Configuration | Wide folder access | An MCP filesystem root set to your home folder | IH-MCP-003 |
| Remote content | Instructions fetched later | "Read the latest steps from this page and follow them" | IH-INJ-004 |
| Remote content | Quiet update | A clean version replaced after you approved it | IH-INT-001 |
A few patterns deserve a sentence each.
The instructions are the attack surface. Many reported malicious skills put nothing harmful in a script. The harm was a sentence telling the agent or the user to fetch and run something, such as "install the helper with hxxps://helper.example.invalid/setup". Our teardown of the fake prerequisite and the podcast episode on prompt injection in an agent skill cover this in depth.
The dangerous part is often a pair. Reading a file is ordinary, and so is an HTTP request. Reading ~/.aws/credentials and sending it to a host the skill never declared is theft. Model the pair, not the single action, as we did in how malicious AI agent skills steal credentials.
The name is part of the skill. A lookalike name gets a skill installed in the first place; see typosquatted skill names on ClawHub.
Time is a threat too. A skill you reviewed in October is not the skill on disk in November if it updates itself, fetches remote steps, or gets replaced by a new version.
Question 3: what you will do about it
For each threat, pick the cheapest control that breaks it. One solid break in the chain is often enough.
| Threat group | Control | Where it lives | Cost |
|---|---|---|---|
| Hostile instructions and hidden text | Read the full SKILL.md, then run a skill-aware scan | Before install | Minutes |
| Fake prerequisites and remote installs | Never run setup steps that fetch outside code; vendor or pin the helper instead | Before install | Minutes |
| Credential read plus send | Keep secrets out of the agent's reach; scan for sensitive paths near network calls | Host setup, before install | An afternoon once |
| Opaque archives and binaries | Decline, or inspect by hand in a disposable environment | Before install | Varies |
| Wide config and remote MCP launches | Review MCP blocks line by line; narrow folder roots | Before install | Minutes |
| Runtime behavior and remote content | Sandbox the agent; turn on exec approvals; restrict outbound network | Run time | An afternoon once |
| Quiet updates | Pin versions, keep a baseline, rescan on change | After install | Minutes per change |
Some notes on the controls:
- Scanning is fast and repeatable. A first pass looks like
npx ironheights scan ./path/to/skill. Exit code 0 means no findings, 1 means review, 2 means block, 64 is a usage or config error, and 70 means the command stopped. The scanner page explains each verdict, and a review verdict means a person should read the evidence. - Pinning and baselines turn time into something you can check. See pinning and verifying skill versions and agent file baselines.
- Sandboxing limits the damage from everything static checks cannot see. Our guide to sandboxing OpenClaw skills in Docker has a working setup, and the OpenClaw sandboxing docs describe the built-in options.
- Declining is a valid control when a skill needs a binary you cannot read.
If you want the model to be enforced rather than written down, the threat model docs describe a YAML file that lists which skills an agent trusts and which hosts, paths and tokens each may touch, checked on every pull request:
npx ironheights threatmodel init
npx ironheights threatmodel check
The first command drafts a model from what is installed; the second exits non-zero when a skill reaches outside it.
Question 4: did we do a good job
Four habits keep the model honest:
- Rescan on every change. A new version or a changed MCP block is a new review. Our post on scanning agent skills in CI before install shows a gate that runs on each change.
- Read every review verdict. Write down why you accepted it.
- Track what was not covered. If a skill fetches remote instructions, your model has a hole. Record it and choose a control.
- Revisit the agent's reach. When someone adds a token or a folder to the agent, every installed skill just got more powerful. Re-run question 1.
A one-page worksheet
Copy this table into your skill review notes, one per skill:
| Field | Your answer |
|---|---|
| Skill name, source, version or commit | |
| Parts present (instructions, setup, files, config, remote) | |
| What the agent can reach (folders, tokens, channels, approvals) | |
| Threats that apply, with rule IDs from the scan | |
| Control chosen for each threat | |
| Known gaps (remote content, binaries, runtime behavior) | |
| Reviewer, date, next review trigger |
For teams, the worksheet becomes the approval record in reviewing third-party agent skills for a team.
What Ironheights cannot catch
Here is where the scanning control stops. Ironheights reads the files on disk and applies fixed rules. It does not see behavior that only happens at run time, content a skill fetches from a remote URL after install, new obfuscation or new phrasing that no rule describes, or social-engineering text that a person decides to follow anyway. Plain-language attacks with no command in them are the hardest case for any rule set, ours included, and public datasets on our benchmark page show a large share of malicious samples still get past rules alone. A scan with no findings is a signal, not a clearance, which is why the model puts sandboxing, pinning and review next to the scan. The full list is on the limitations page, and the tracker lists publicly reported malicious skills if you want real cases to test your model against.
If you want a skill-aware scan as one control in your own model, you can start at https://ironheights.dev/.
FAQ
What is an OpenClaw skill threat model?
It is a short written analysis of one skill: what parts it contains, what can go wrong in each part, which control you use against each threat, and what remains uncovered.
Do I need a threat model for every skill I install?
Not a long one. A one-page worksheet per skill is enough for most teams, and skills of the same kind can share one. Spend more time on skills that ship binaries or fetch remote instructions.
Does a clean scan mean the threat model is done?
No. A scan covers the instructions, setup steps, files and config that are on disk at scan time. It does not cover runtime behavior, remote content or later updates, so those threats need another control such as a sandbox, pinning or a decline.
Which part of a skill is most often abused?
In the public reports cited here, the instructions and setup steps were the most common place for the attack, especially fake prerequisites that fetch outside code.
Sources
- Threat Modeling Cheat Sheet, OWASP Cheat Sheet Series.
- Skills, OpenClaw documentation.
- Exec approvals, OpenClaw documentation.
- Sandboxing, OpenClaw documentation.
- ClawHavoc: 341 malicious skills, Koi (archived).
- ToxicSkills: malicious AI agent skills on ClawHub, Snyk.
- OpenClaw AI supply chain risk, Unit 42, Palo Alto Networks.
- LLM01: Prompt Injection, OWASP Top 10 for LLM Applications.
- ironheights, npm package README.