PromptMink: Malicious Packages Built to Persuade AI Coding Agents
ReversingLabs reports that the North Korea-linked PromptMink campaign used credible-looking npm and PyPI packages, polished documentation, and rotating malicious dependencies to reach AI-assisted development workflows. One observed crypto trading agent added a malicious package in a commit co-authored by Claude Opus (an Anthropic model). The defensive lesson is that package selection by an AI coding agent must be governed like a supply-chain decision, not treated as ordinary autocomplete.
Threat Analysis
- The lure was written for humans and models. Detailed README files and convincing task descriptions made the packages look useful to coding agents searching for crypto or validation utilities.
- The campaign separated credibility from payload. First-layer bait packages such as
@solana-launchpad/sdklooked legitimate, while second-layer packages such as@validate-sdk/v2carried the infostealer behavior and could be rotated when detected. - The payload kept evolving. ReversingLabs observed obfuscated JavaScript, PyPI variants, bundled Node executables, and Rust-based NAPI add-ons that could steal
.envand.jsonfiles, exfiltrate projects, and add attacker SSH keys. - The AI-assisted workflow is the entry point. One autonomous crypto trading project added the malicious dependency in a February 28 commit co-authored by Claude Opus. The model did not need to write malware; the agent only needed to accept a plausible dependency.
- Hallucinated dependencies make the pattern easier. In slopsquatting, agents invent package names and may later install them once an attacker registers the name.
- The control boundary has to move earlier. Defenders need package intelligence before a dependency enters the manifest or lockfile, plus containment while installation runs.
Applicable AIDEFEND Defenses (9)
npx, modifying lockfiles, or executing package install scripts. Classifying package installation, dependency changes, and build-script execution as high-risk actions gives the runtime a policy basis to require approval, restrict tools, or deny the action.What Defenders Should Do Now
- Search source repos, lockfiles, package manifests, CI caches, developer machines, and artifact registries for PromptMink indicators, including
@validate-sdk/v2,@hash-validator/v2,@solana-launchpad/sdk,scraper-npm, and known C2 domains such asvalidator[.]uno. - Require AI coding agents to check package reputation and malware verdicts before adding any new npm, PyPI, Rust, or GitHub dependency. Do not let an agent install a package solely because the README looks relevant.
- Block or review dependency changes generated by agents unless the exact package version, lockfile diff, transitive dependency tree, registry age, maintainer history, and binary contents have been checked.
- Run package installs and tests in ephemeral sandboxes with no production secrets, no SSH keys, no writable developer home directory, lifecycle scripts disabled by default, and outbound network access limited to approved registries.
- Hunt for post-install behavior: new SSH authorized keys, unexpected project ZIP archives, reads of
.envor wallet files, outbound traffic to unfamiliar domains, and large transfers from developer or CI machines. - Turn hallucinated dependency names into a control. If an agent proposes a package that does not already exist in an approved registry or internal allowlist, fail closed and require explicit human review before install.
1 additional consideration
LLM-facing package documentation abuse
Conclusion
PromptMink is a clean example of how AI-assisted development changes software supply-chain risk. The attacker does not need to defeat a model directly; it is enough to make a malicious dependency look like the best answer to the agent's coding task. AIDEFEND maps the defensive baseline clearly: vet packages before selection, gate AI-generated dependency changes, isolate installation, restrict egress, classify package installation as a high-risk agent action, map affected systems, and clean up persistence quickly when a malicious package is found.