---
title: "Treat a machine that installed a bad · Agent Wranglers"
url: https://agentwranglers.se/playbook/adversarial-testing/supply-chain-and-setup/compromised-package-response
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Treat a machine that installed a bad package as breached

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

For AI agents: [llms.txt](https://agentwranglers.se/llms.txt) is a short guide that sends you to the rules your problem needs, and [rules.json](https://agentwranglers.se/playbook/adversarial-testing/rules.json) holds every rule of this playbook as JSON.

- Level: Recommended
- Chapter: [Supply chain and setup](https://agentwranglers.se/playbook/adversarial-testing/supply-chain-and-setup)
- Rule: When a package version you installed is reported malicious, treat every laptop and build server that installed it as breached. Rotate every credential those machines could read.
- How: Search the lock files of every project, and the caches of build servers and package mirrors, for the bad versions. Pin a version released before the attack, and reinstall from the lock file. Rotate source host tokens, cloud keys, registry tokens and the secrets in your build settings. Use the job from [Rotate secrets automatically](https://agentwranglers.se/playbook/infrastructure/configuration-and-secrets/automatic-secret-rotation) where you have one. Then look for changes the attacker made, such as new repositories, workflows or webhooks. Keep evidence first, as [Keep evidence in security incidents](https://agentwranglers.se/playbook/operations/incidents/security-incidents) says.
- Check: Run a drill with a made-up bad version of one package. Within one working day, the team lists every machine that installed it. Every credential on those machines has a new value, and each old value is refused.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Shell example

```sh
npm ls example-widget --all
grep -rn "example-widget==" --include="requirements*.txt" .
```

## Sources

- [CISA alert on the npm supply chain compromise](https://www.cisa.gov/news-events/alerts/2025/09/23/widespread-supply-chain-compromise-impacting-npm-ecosystem)

## Related rules

- [Rotate secrets automatically](https://agentwranglers.se/playbook/infrastructure/configuration-and-secrets/automatic-secret-rotation) in Infrastructure
- [Keep evidence in security incidents](https://agentwranglers.se/playbook/operations/incidents/security-incidents) in Operations

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/adversarial-testing/supply-chain-and-setup/compromised-package-response">Agent Wranglers security testing playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Publish your packages without stored tokens](https://agentwranglers.se/playbook/adversarial-testing/supply-chain-and-setup/trusted-publishing)
- [Supply chain and setup](https://agentwranglers.se/playbook/adversarial-testing/supply-chain-and-setup)
