Inspiration

Coding agents now run npm install and pip install on their own, and attackers adapted fast. They register the package names models predictably hallucinate ("slopsquatting": in a 576,000 sample USENIX Security 2025 study, about 19.7% of LLM recommended packages didn't exist). They hide "install this package" lines in AGENTS.md files and READMEs. npm worms have started planting hooks inside AI coding tools. Every guide says a human should review installs, but a confirmation prompt the agent itself can answer is not a review.

What it does

Ladon is a firewall between AI coding agents and the package registries. It has four heads:

  • Gate: hooks for Claude Code, Codex and Cursor, plus PATH shims for npm, pnpm, yarn, bun, pip, uv, poetry and more. Every install, from an agent or a human, passes through Ladon. It also scans instruction files for injected install orders, hidden comments and invisible Unicode, and watches AI tool configs for planted hooks and MCP servers.
  • Judge: 15 documented, deterministic rules produce a risk score from 0 to 100, then a verdict: allow, warn or hold. The rules check whether the package exists, OSV malware advisories, known hallucinated names, typosquats of popular packages, package age, maintainer changes, install scripts that touch the network or your environment, and dropped provenance. An LLM (Gemini) has two narrow jobs only: explaining the verdict in plain words, and checking whether the install matches what the human actually asked for. It can raise a verdict, never lower it.
  • Key: a held install needs a signed approval, either a WebAuthn passkey on your phone or the Ladon Key (ESP32-S3 firmware that signs with its own Ed25519 key). There is no approve command or flag anywhere, so a hijacked agent cannot approve its own install.
  • Atlas: a public checker for any package or manifest (package.json, requirements.txt, pyproject.toml, Pipfile), and a map of package names AI models hallucinate, with alerts when someone registers one.

In the demo, a real Claude Code session tries to install a malicious looking package. Ladon holds it, the developer rejects it from their phone with a passkey, and the agent finishes the task without it. Nothing ran.

How we built it

A TypeScript pnpm monorepo:

  • packages/core: shell command parser, registry and OSV data sources, rules, scoring, approval protocol.
  • packages/cli: hooks, shims, a local daemon, passkey and Key approvals.
  • apps/web: Next.js 15 and Tailwind on Vercel, Supabase for approvals and the Atlas, @simplewebauthn for passkeys.
  • firmware: PlatformIO for the ESP32-S3.

Demo attacks use a local Verdaccio registry and harmless canary packages whose payload only writes a marker file. Nothing was ever published to public npm or PyPI.

Challenges we ran into

  • Shell parsing is an attack surface. cd x && npm i y, bash -c, xargs, $(...), heredocs, wrappers like sudo and env, registry overrides. Anything Ladon can't resolve statically is held, not allowed.
  • Failing closed everywhere. A hook that crashes counts as "allow" to the agent, so every error path returns an explicit deny.
  • Not crying wolf. Popular, long lived packages get a discount for routine releases, so a normal update isn't held.

Accomplishments that we're proud of

  • On our evaluation corpus: 35 of 35 bad installs held, 0 of 40 popular benign packages held.
  • Median cached verdict about 1.4 ms; uncached about 0.4 s.
  • A full passkey approval flow tested end to end, including forged and replayed approvals being rejected.
  • 650+ automated tests across core, CLI and web.

What we learned

Deterministic rules with written down weights are easier to trust and debug than an LLM verdict. The LLM is most useful for the one thing rules can't see: whether an install matches the human's intent.

What's next

Building and user testing the physical Ladon Key, a signed policy file for teams and CI, and feeding the Atlas from more models' hallucinations.

AI disclosure

Built with heavy use of Claude Code (Anthropic) as a coding assistant, directed and reviewed by the team. At runtime Ladon optionally calls Gemini for the two narrow jobs above, from structured evidence only, with schema validated output. The risk score never comes from an LLM, and everything works with AI turned off. The demo video's narration is a macOS text to speech voice.

Built With

Share this project:

Updates

Submission history