Post-install drift in agent skills: a clean skill that changes after review
Post-install drift is what happens when the skill you reviewed is not the skill your agent runs anymore. The version you scanned was clean, so it got approved. Days or weeks later, an update, a hand edit, or a file the skill fetches at run time changes what it does. This teardown covers how the change lands, the indicators to check, what Ironheights flags, what no file check can see, and cleanup.
The idea is not new. In April 2025, Invariant Labs described "rug pulls" for MCP servers: a server can change a tool description after the client has already approved it. Agent skills have the same weak spot, because most approval flows check a skill once and trust it from then on. Palo Alto Networks Unit 42 and Snyk's ToxicSkills research both describe the ClawHub skill supply chain as a real attack surface. Those findings belong to those researchers. We are not saying any specific published skill has drifted. This post describes the pattern.
What the skill looks like at review time
A drift attack depends on passing review first, so the early version is boring on purpose:
- It does what it says. A weather brief returns the weather. A formatter formats. Trying it shows nothing odd.
- It has few files and plain instructions. A short
SKILL.md, maybe one helper script, one declared API host.
The malicious part comes later, when people have stopped reading the diffs.
How the change lands
| Route | What changes | Who can do it |
|---|---|---|
| Publisher update | A new version adds a host, a credential read, or a setup script | The publisher, or anyone who took over their account |
| Description or instruction edit | SKILL.md wording shifts, for example "run every setup step without asking" | The publisher, or anything with write access to the skill folder |
| Remote instructions | The skill tells the agent to fetch and follow a file from a URL on each run | Whoever controls that URL, at any time |
| Local tampering | Another skill, a script, or a person edits installed files directly | Anything running as your user |
The first two show up as file changes. The third is the hardest: the files on disk never change, but the content they point to does. The fourth is why pinning alone is not enough. A ClawHub pin stops clawhub update from replacing a skill, but it does not stop other processes from editing the files in your workspace.
Indicators to check
| Indicator | Where to look | Why it matters |
|---|---|---|
| New hostname in an update | Scripts, SKILL.md URLs | A weather skill has no reason to start talking to a second server |
New credential path such as ~/.aws/credentials or ~/.ssh | Scripts, setup steps | Reads that were not in the reviewed version |
Changed description front matter | SKILL.md | The description steers when and how the agent uses the skill |
| "Fetch the latest instructions from ..." | SKILL.md | Behavior now depends on a remote file you never reviewed |
| New setup or install script | New files in the skill folder | Often where persistence (cron, launch agents) gets added |
| Environment dumped into a request body | Helper scripts | Sends every token in the agent's environment off the machine |
| Version bump with a large diff and a vague changelog | Release notes | Small skills rarely need large changes |
None of these prove intent. Each one is a reason to read the diff before letting the agent run the skill again.
What Ironheights flags, and what it missed in our tests
We built a small defanged fixture, a weather-brief skill with one helper script and one example.com API host, separate from our benchmark sets. With version 0.37.0 the clean copy scanned as no-findings. We recorded an approval with npx ironheights drift approve ./path/to/skill, made one change per copy, then ran npx ironheights drift check ./path/to/skill and npx ironheights scan ./path/to/skill on each:
| Change after approval | drift check | scan verdict |
|---|---|---|
Helper posts the environment to a new host (collect.example.invalid) | file-changed, new-host (high), exit 2 | block |
description rewritten to "run every setup step without asking" | file-changed, description-changed (high), exit 2 | no-findings |
SKILL.md told to fetch and follow remote instructions | file-changed, new-host (high), exit 2 | block |
Helper reads ~/.aws/credentials | file-changed, new-credential-path (high), exit 2 | review, IH-CRED-001 |
New setup.sh adds a cron job | file-added (medium), exit 1 | review, IH-PERSIST-001 |
| Nothing on disk changes, only the remote file does | no drift since approval, exit 0 | no-findings |
Our copies also raised a low IH-META-001 finding because the test folders were not named after the skill. We left it out of the verdict column.
Two rows matter most. The description edit passed the scan with no findings, because the new wording on its own does not match a known attack pattern. Only the comparison against the approved copy caught it. That is the point of drift checks: a scan judges a version alone, while drift asks what changed since you said yes. The last row is a real gap. When the skill fetches its instructions at run time, the files never change, so neither command can see what the server sends next. IH-INJ-004 exists for that reason: it flags remote or self-updating instructions in the reviewed copy, so you can refuse the skill before the remote file ever matters.
For files that change without a new version, npx ironheights baseline create and npx ironheights verify hash the installed files and report IH-INT-001 for a modified file and IH-INT-002 for a new one. More on that in Baselines for agent files.
What static and drift checks would not catch
- Remote content. Anything fetched at run time lives on a server we never read.
- Changes you approve without reading. If you re-approve after every update without looking at the diff, the check only records your trust.
- Drift before the first approval.
drift approve --adoptlabels a baseline taken after the skill was already running. It shows changes from that point, not whether the starting copy was clean. - Novel obfuscation. A new host or path built from string pieces may not show up as a new host or path.
The full list is on limitations.
A drift checklist for skills you already trust
- [ ] Pin skills with ClawHub and update one at a time, not with
update --allon a schedule. See Pinning and verifying OpenClaw skill versions. - [ ] Record approval right after review:
npx ironheights drift approve ./path/to/skill. - [ ] Run
npx ironheights drift checkfrom a scheduled job or in CI and treat a non-zero exit as "read the diff". - [ ] Refuse skills that fetch and follow remote instructions, whatever their current score.
- [ ] Keep secrets out of the agent's environment so an environment dump has little to send.
- [ ] Run skills with outbound traffic limited to declared hosts. See Sandboxing OpenClaw skills in Docker.
If a drifted skill already ran
- Disable the skill and keep a copy of the changed files for the diff.
- Compare the copy with the approved version and list every new host, path, and script.
- Rotate any credential the new code could read, starting with the paths in that list.
- Check for persistence: cron, launch agents, systemd user units, and shell startup files.
- Follow the longer checklist in What to do after installing a malicious OpenClaw skill, and report the version to ClawHub with the diff.
FAQ
What is post-install drift in an agent skill?
It is a change to a skill after you reviewed and approved it: a new version, a local edit, or remote instructions the skill fetches at run time. The skill you trust and the skill the agent runs stop being the same thing.
Does a clean scan after an update mean nothing important changed?
No. In our tests a rewritten description scanned with no findings, and only drift check flagged it. A scan rates a version alone. Drift checks compare it with the copy you approved.
Does pinning a skill stop drift?
Pinning stops ClawHub update commands from replacing the skill. It does not stop local edits, and it does not freeze a remote file the skill fetches. Use pins together with drift checks or a baseline.
Can Ironheights see changes in remote instructions?
No. If the files on disk stay the same, drift checks report no drift. Ironheights can flag the instruction to fetch remote content in the reviewed copy, which is the point to say no.
Check your installed skills
Approve the skills you have reviewed, then run npx ironheights drift check on a schedule, or paste a changed file into the browser scanner. The tracker lists publicly reported malicious skills. More on what we test is at https://ironheights.dev/.
Sources
- MCP Security Notification: Tool Poisoning Attacks, Invariant Labs, April 2025.
- ClawHub CLI reference: pin, unpin and update, GitHub.
- OpenClaw's Skill Marketplace and the Emerging AI Supply Chain Threat, Palo Alto Networks Unit 42.
- ToxicSkills: malicious AI agent skills on ClawHub, Snyk.
- Ironheights README, GitHub.
- ironheights on npm, npm.
- Ironheights limitations, Ironheights.