---
title: "Treat a machine that installed a bad · Agent Wranglers"
url: https://agentwranglers.se/playbook/application-security/supply-chain/compromised-package-response
id: APS-76
level: Recommended
updated: 2026-10-27
build: a2a6bdfed830
tokens: 814
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Treat a machine that installed a bad package as breached

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Supply chain](https://agentwranglers.se/playbook/application-security/supply-chain.md).

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

- ID: APS-76
- Level: Recommended
- Chapter: [Supply chain](https://agentwranglers.se/playbook/application-security/supply-chain.md)
- 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.
- 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.
- 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.md) 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.md) says.

## 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

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

**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/application-security/supply-chain/compromised-package-response">Agent Wranglers application security playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Publish what is in each release](https://agentwranglers.se/playbook/application-security/supply-chain/sbom-and-provenance.md)
- Next: [Use models and data from trusted sources](https://agentwranglers.se/playbook/application-security/supply-chain/trusted-model-sources.md)
- [Supply chain](https://agentwranglers.se/playbook/application-security/supply-chain.md)
