GuideIronheights

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:

QuestionFor 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.

PartExampleWho acts on itTrust boundary it crosses
InstructionsThe markdown body of SKILL.mdThe agent, and the person reading alongText becomes action
Setup steps"Install the helper first", a prerequisites listThe agent's shell, or a human in a terminalOutside code enters the machine
Bundled filesscripts/sync.py, an archive, a binaryThe agent's runtime toolsCode runs with the agent's rights
ConfigurationAn MCP server block, env variables, folder rootsThe agent host when it loads the skillSettings change what the agent can reach
Remote contentA URL the skill fetches and followsThe agent, later, at run timeBehavior 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.

PartThreatWhat it looks likeRelated rules
InstructionsInstruction override"Ignore earlier rules", "do not tell the user"IH-INJ-001
InstructionsHidden textZero-width characters, HTML comments the agent reads and you do notIH-INJ-002
InstructionsSafeguards switched offAsking the agent to skip confirmations or approvalsIH-INJ-003, IH-EXEC-004
InstructionsSecret requested in chat"Paste your API key so I can configure this"IH-CRED-003
Setup stepsFake prerequisiteA helper downloaded from an outside URL before first useIH-EXEC-002
Setup stepsRemote script run directlyA download piped into a shellIH-EXEC-001
Setup stepsPackage that does not existAn install line naming a package an attacker could registerIH-DEP-001
Bundled filesCredential read plus sendA script that reads ~/.ssh/ or .env, then posts to an undeclared hostIH-CRED-001, IH-NET-002
Bundled filesHidden codeEncoded strings decoded at run timeIH-OBF-001
Bundled filesOpaque payloadAn archive or binary a reader cannot inspectIH-BIN-001
Bundled filesStaying aroundCron entries, shell profile edits, login itemsIH-PERSIST-001
ConfigurationRemote MCP launchAn MCP server started from a command that downloads codeIH-MCP-001
ConfigurationWide folder accessAn MCP filesystem root set to your home folderIH-MCP-003
Remote contentInstructions fetched later"Read the latest steps from this page and follow them"IH-INJ-004
Remote contentQuiet updateA clean version replaced after you approved itIH-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 groupControlWhere it livesCost
Hostile instructions and hidden textRead the full SKILL.md, then run a skill-aware scanBefore installMinutes
Fake prerequisites and remote installsNever run setup steps that fetch outside code; vendor or pin the helper insteadBefore installMinutes
Credential read plus sendKeep secrets out of the agent's reach; scan for sensitive paths near network callsHost setup, before installAn afternoon once
Opaque archives and binariesDecline, or inspect by hand in a disposable environmentBefore installVaries
Wide config and remote MCP launchesReview MCP blocks line by line; narrow folder rootsBefore installMinutes
Runtime behavior and remote contentSandbox the agent; turn on exec approvals; restrict outbound networkRun timeAn afternoon once
Quiet updatesPin versions, keep a baseline, rescan on changeAfter installMinutes 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:

  1. 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.
  2. Read every review verdict. Write down why you accepted it.
  3. Track what was not covered. If a skill fetches remote instructions, your model has a hole. Record it and choose a control.
  4. 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:

FieldYour 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

Scan the next skill before your agent reads it

Ironheights is a free, open-source, local-first scanner and integrity monitor for OpenClaw skills. The CLI has no telemetry, and a scan makes no network calls. It reports what its rules match; it cannot prove a skill is safe.

Get Ironheights

Useful? A star on ClawHub or GitHub helps other OpenClaw, Claude and Grok Bot users find it.