GuideIronheights

What to do after installing a malicious OpenClaw skill

You just installed a ClawHub skill, or your agent already ran one, and something feels wrong. A scanner flagged it. A teammate spotted a fake prerequisite. VirusTotal on the listing flipped to a warning after you installed. This guide is the response playbook: isolate the agent, contain what the skill could reach, rotate credentials, check for persistence, and decide what to reinstall. It is not a guarantee that nothing escaped. It is a practical order of operations that teams can follow under time pressure.

Public research shows this is a common situation, not a rare edge case. Snyk's ToxicSkills study confirmed 76 malicious payloads by hand across 3,984 skills. Koi's ClawHavoc report found 341 malicious skills in one ClawHub audit. Treat a suspicious install as an incident until you prove otherwise.

First fifteen minutes: isolate before you investigate

Do not open the skill again to "see what it does." Do not ask the same agent to diagnose itself. A hostile skill shares the agent's tools and can talk the agent out of reporting what it did. That trust problem is covered in Why a security skill that runs inside the agent can be bypassed.

  1. Stop the agent process. Quit the OpenClaw session, stop the daemon or container, and disconnect any chat channel that can wake it (Slack, Discord, Telegram, WhatsApp bridges).
  2. Disconnect outbound network if you can. Unplug, disable Wi-Fi, or cut the container's egress. Exfiltration and second-stage downloads need a network path.
  3. Leave the skill files on disk. Copy the skill folder somewhere read-only for later review. Deleting too early destroys evidence and makes rule matching harder.
  4. Write one line of context. Skill name, version, install time, who installed it, which machine or container, and what first looked wrong. You will forget details within an hour.
PriorityActionWhy
P0Stop agent + cut networkStops live exfil and further tool use
P0Snapshot skill folderPreserves what you will scan and report
P1List recent logins and API useShows whether keys already moved
P1Quarantine shared workspacesLimits blast radius for teammates

If the agent ran on a shared laptop or a cloud VM that also holds production keys, treat the host as compromised until credential rotation finishes. If it ran in a disposable container with no secrets mounted, isolation is still required, but the blast radius is smaller.

What the skill might already have done

Most reported ClawHub attacks do not need exotic exploits. They abuse the agent's normal powers: shell, filesystem, and trust in SKILL.md text. Common patterns from public reports:

  • Fake prerequisites that download and run a script before the skill "works" (anatomy of a prerequisite attack).
  • Credential path reads against ~/.ssh, ~/.aws, browser profiles, .env files, or wallet directories (where agents leak credentials).
  • Undeclared outbound hosts used as webhooks or paste endpoints.
  • Post-install drift: a clean-looking skill that later changes files or fetches new instructions (Unit 42 documented a financial-advice skill that rotated affiliate links after review).
  • Instruction-only abuse: text that tells the agent to move funds or hide actions, with no binary payload at all.

A static scanner can flag many of these when they appear as files on disk. It cannot replay what already ran, and it cannot see payloads that lived only on a linked website. See What our scanner cannot catch, the limitations page, and the benchmark for what our own test numbers do and do not mean.

Scan the installed copy (outside the agent)

Scan the snapshot you saved, not a freshly re-downloaded listing. Marketplace pages can change; your disk copy is what the agent actually saw.

npx ironheights scan ./path/to/skill

Exit codes matter for scripts: 0 means no findings, 1 means review, 2 means block, and 3 means the scan was incomplete (for example a skipped file). Usage errors can exit 64. Verdicts are no-findings, review, block, or incomplete, each with rule ids and evidence when findings exist. Useful starting points when an incident is in progress:

If you cannot install the CLI, the browser scanner runs the same content rules locally in your browser. A clean result still is not proof the skill was safe: it means no rule matched the files you scanned.

Save the JSON or SARIF output with your incident notes. Agencies and security leads usually ask for that artifact first.

Rotate secrets the agent could reach

Assume any secret the agent could read is burned. Prefer over-rotating to under-rotating.

Checklist: credentials to rotate

  • [ ] Cloud and hosting API keys (AWS, GCP, Azure, Vercel, Cloudflare, and similar)
  • [ ] Git hosts and package registries (GitHub, GitLab, npm tokens)
  • [ ] Chat and messaging bot tokens (Slack, Discord, Telegram)
  • [ ] Model provider keys used by the agent
  • [ ] SSH keys loaded or readable from the agent host
  • [ ] Database URLs, webhook secrets, and .env values in the agent workspace
  • [ ] Crypto wallets, exchange API keys, and seed material if the agent ever had filesystem or clipboard access near them
  • [ ] Browser cookies or session tokens if the skill mentioned profiles or password stores

Rotate in this order when time is tight: anything that can move money or delete production data first, then developer access tokens, then chat bots, then low-impact integrations. Revoke old keys; do not only mint new ones and leave the old ones valid.

For teams in crypto or fintech, treat wallet-adjacent exposure as a full key-compromise incident even if you are "not sure" the skill ran. That segment's failure mode is irreversible transfers, not just leaked chat logs.

Hunt for persistence and drift

Malicious skills sometimes leave behind more than a bad folder. Check the host the agent used:

AreaWhat to look forExample signal
Skill directoriesExtra skills, renamed folders, unexpected updatesNew entry under the skills root you did not install
Agent instruction filesEdits to AGENTS.md, SOUL.md, MEMORY.md, or equivalentNew "always run" instructions or hidden override text
Shell startup~/.bashrc, ~/.zshrc, profile scriptsCurl-to-shell lines, unfamiliar PATH entries
Schedulerscron, systemd user units, launch agentsJobs that re-fetch remote scripts
Containers and VMsNew images, unexpected volumes, open portsProcess listening you did not start

If you had a baseline before the incident, verify it now:

npx ironheights verify

A failing verify tells you which files were added, changed, or removed since the last known-good snapshot. How to set that up before the next incident is in Baselines for agent files. If you never created a baseline, create one only after cleanup, so you do not lock in attacker changes as "good."

Also skim the tracker for patterns that match what you saw. It will not name every skill in the wild, but it records public indicators that help you recognize a family of attacks.

Cleanup and rebuild

Once secrets are rotated and persistence checks are done:

  1. Remove the skill from every machine and image that received it, including CI caches and teammate laptops.
  2. Reinstall the agent environment from a known-good source when the host had shell access and secrets. Prefer a fresh VM or container over "deleting the one folder."
  3. Re-enable network only after the new environment is up and keys are new.
  4. Restore skills one at a time using your normal vetting routine (10-minute checklist), and scan each before the agent loads it.
  5. Create a fresh baseline after the known-good set is installed.

Do not restore old .env files from backups that sat on the same host during the incident. Rebuild secrets from your password manager or cloud secret store.

What to tell teammates and clients

Write a short incident note even if nothing "bad" happened after rotation. Include:

  • Timeline (discovered, isolated, rotated, cleared)
  • Scope (which agents, hosts, and integrations)
  • Evidence (scan output, rule ids, defanged indicators)
  • Residual risk (what you could not prove)
  • Follow-ups (policy changes, CI gate, baseline cadence)

Agencies can attach the scan report to the client update. Technical leads can paste the same note into the engineering channel. Avoid accusations against a publisher unless you can point to a public report or an official marketplace removal.

When you share indicators, defang them: use hxxps://, .invalid hosts, and truncated encoded blobs. Never paste a runnable install line into Slack "as an example."

Prevent the next one

Incidents shrink when install is gated.

  • Vet before install with the checklist or the interactive skill safety checklist.
  • Scan in CI so a pull request that adds a skill fails on a block verdict before anyone runs it locally.
  • Prefer local, explainable scanning over trusting an in-agent "security skill" alone.
  • Baseline after every approved change and verify on a schedule.
  • Keep secrets out of the agent workspace when the job does not need them.

Ironheights is one layer in that process: it reads skill files as data, prints evidence, and stays out of the agent loop. It does not replace rotation, network isolation, or human review, and it will miss runtime-only behavior, novel obfuscation, remote content fetched later, and social-engineering text a person or model follows anyway. Those gaps are documented on /limitations/.

If you want the scanner during cleanup, start with:

npx ironheights scan ./path/to/skill

Or use the in-browser scanner. Official packages live on npm and GitHub releases. More detail on the product, rules and limitations is at https://www.ironheights.dev/.

FAQ

Should I wipe the whole machine after a malicious OpenClaw skill?

Not always. If the agent ran in a locked-down container without secrets or host mounts, removing the container and rotating the few tokens it had may be enough. If it ran on a laptop or VM with shell access and readable keys, rebuild the environment and rotate broadly. When money-moving keys were in reach, err on the side of a full rebuild.

Is rotating API keys enough if the scanner only said review?

Treat review as unresolved until a person reads the evidence. Some reviews are documentation false positives; some are real prerequisite downloads. If the skill already ran, rotate anything it could read even while you are still classifying the finding.

Can I ask my OpenClaw agent to clean up after a bad skill?

No. Use a separate shell or a clean machine. The compromised agent may follow hostile instructions, skip steps, or lie about what it changed. Isolation first, analysis outside the agent second.

What evidence should I keep for a client or insurer?

Keep the skill snapshot, scanner JSON or SARIF, the one-line timeline, a list of rotated credentials (names only, not secret values), and persistence-check notes. Defang URLs and truncate payloads before you attach anything to email.

How do I reduce the chance this happens again?

Gate installs with a written checklist, scan in CI, keep baselines current, and limit which secrets the agent can read. Re-vet on every skill update. Marketplace VirusTotal badges help, but OpenClaw's own maintainers describe that integration as not a silver bullet—pair it with local review of the installed copy.

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.