# Poisoned npm/PyPI Package Response: Was I Hit, Did It Run, What to Rotate

> When a hijacked npm, PyPI or Composer release is announced, find every affected version, prove whether its code ran, and get a ranked secret-rotation and cleanup report.

Poisoned npm/PyPI Package Response: Was I Hit, Did It Run, What to Rotate is a paid AI agent skill on Agensi by Hamza Alayed, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $1 (one-time purchase)
- Creator: [Hamza Alayed](https://www.agensi.io/creators/hamza-alayed)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0
- Last updated: 2026-11-19
- Security: scan passed (2026-11-19); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/poisoned-npm-pypi-package-response-was-i-hit-did-it-run-what-to-rotate
- Tags: security, devops-cloud, code-quality-review, testing-debugging

## About this skill

A hijacked package release is announced (a worm, a stolen maintainer token, a loader hidden in a file the package already runs). Every team that depends on it asks the same three questions under time pressure: **Do we have the bad version? Did its code execute anywhere? Which credentials must we rotate?** This skill answers them with evidence, in that order, and ends with a report a lead can act on in minutes. It is read-only until the containment step, never runs the suspect package, and never calls a project "clean" without saying exactly what was checked.

- A security advisory, blog post, OSV `MAL-` record or registry notice names compromised package versions, and you need to know if any project, CI job or developer machine is affected.
- `npm audit`, osv-scanner, Dependabot or a scanner flags a dependency as **malware** (not an ordinary vulnerability).
- You suspect a worm-style campaign (token theft that republishes other packages) touched your org.
- A scheduled sweep: "check all repos against every MAL- record published this week."

Do **not** use it for ordinary CVEs with a patch version; a normal dependency upgrade flow fits those better. Malicious-package response differs: there is no "safe patch" of the bad release, execution matters more than presence, and secrets are the real blast radius.

| Input | Why | If missing |
|---|---|---|
| Advisory list of bad versions (`ecosystem:name@version`) | Exact matching; ranges cause false alarms | Use OSV `MAL-` lookups only, and say so |
| Exposure window (first bad publish → removal, UTC) | Decides which installs and CI runs matter | Use advisory dates; mark as approximate |
| How the payload runs (install script vs import/load time) | Decides whether "installed but never imported" is safe | Assume **both** |
| Repos, CI system, artifact caches, container registries in scope | Presence can hide outside the repo | Scope to the repo given and list the rest as not checked |

## Requires

- Python 3.8+
- Terminal access
- Git
- Optional: Network access to api.osv.dev
- Optional: GitHub CLI

## Known limitations

Matches exact versions only, so you need the advisory's version list or OSV must be reachable; when neither is available the result is UNKNOWN, never clean. Parses package-lock/npm-shrinkwrap, yarn.lock v1, pnpm-lock.yaml, poetry.lock, uv.lock, pinned requirements*.txt and composer.lock; Yarn Berry lockfiles, Gemfile.lock, Cargo, Go and Maven are not parsed. It does not detect unknown malware by analysing code, does not rotate secrets for you, and cannot read CI logs your agent has no access to. Not legal or forensic advice.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Poisoned npm/PyPI Package Response: Was I Hit, Did It Run, What to Rotate skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What does it cover?

npm (package-lock, shrinkwrap, yarn v1, pnpm), PyPI (poetry.lock, uv.lock, pinned requirements) and Composer (composer.lock), plus a procedure for CI runners, developer machines, caches and container images.

### How is this different from npm audit or osv-scanner?

Those tell you a bad version is present. This skill goes on to prove whether the code executed (install script vs import-time payloads), maps which secrets that process could reach, ranks them, and gives you a cleanup and verification plan in one report.

### How current are the facts?

OSV API behaviour, MAL- IDs, cooldown settings and the 2026 campaign patterns were checked against official and primary sources on 19 November 2026; sources are cited inside the skill.

### Does it send my code anywhere?

No. With --osv it sends only package names and versions to api.osv.dev. Without it, everything runs offline against the advisory list you provide.

### What if OSV is blocked on my network?

Pass the advisory's versions with --ioc. If no source can be checked, the checker exits 2 and the report says UNKNOWN rather than clean.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
