AI Coding Agent Security: 10 Rules From Real Incidents

From PHP2Shell to LiteLLM and GitSpawn: 10 rules for your laptop, your CI pipeline, and your servers, each with a test to run today and the fix.

·
·
·
AI Coding Agent Security: 10 Rules From Real Incidents
  • Binance's 29 October breach, traced through tampered installers and a fake job interview, impacted about $6.34B in assets according to its initial report.
  • Manifold's GitSpawn research, published 1 September 2026, found eight findings across seven coding agents where a repo's core.fsmonitor setting in .git/config could run code during git status, before the trust prompt.
  • LiteLLM's incident timeline shows branch protection blocked a push at 10:08:29 UTC on 21 October, but a stolen organization-owner token overrode it just five seconds later, leading to v1.107.0 being built from a malicious fork.
  • PHP2Shell, covering CVE-2026-109618 and CVE-2026-109619, was fixed in PHP 8.5.12, 8.4.27, 8.3.36, and 8.2.35 on 21 October, but AWS logged an exploitation attempt four days earlier on 17 October.
  • METR's vibe-coded dashboard had a fail-open authentication flaw that let an attacker drain about $600,000 in free credits over three weeks in March 2026.

When you run a coding agent like Claude Code, Codex, Cursor, or OpenCode, an AI model reads your files, runs commands, and edits code on your machine, with your credentials.

So if you ship code this way, you have a practical question: what should you change in your setup this week?

Two late-October stories raised it. PHP2Shell is two critical bugs in PHP, found by researchers working with AI models, and AWS logged an exploitation attempt four days before the fix shipped on 21 October.

Then came Binance's 29 October breach, which its initial report puts at about $6.34B in impacted assets.

That report traces the attack through engineers' work computers: a tampered installer downloaded to set up an AI coding tool, a fake job interview's coding assignment that ran malware, and an internal AI tool used to take control of two more engineers' machines.

My answer is 10 rules, each tied to a real incident. Most are rules you already know. What's new, in my read, is that agents run what they read, and AI makes old bugs cheap to find and exploit.

And in almost every incident a real safety check was in place, and something ran before it or went around it.

The checks were ordinary ones: a trust prompt, an approval prompt, branch protection (the GitHub setting that blocks unreviewed pushes), a sign-in page, a released fix.

What follows is the 10 rules by where your code runs: your laptop, your CI pipeline (the automation that builds and releases your code), and your servers, plus a checklist to copy.

How do you secure an AI coding agent on your laptop?

Secure what a coding agent reads and runs before it asks you anything. Five of the incidents started that way, and security researchers reported all five.

1. Don't let an agent open a project that arrived as files

A project that reaches you as a zip or a shared folder can run a program the moment your agent runs git status in it.

That's GitSpawn, published by Manifold on 1 September 2026, with eight findings across seven coding agents, Claude Code, Codex, and Cursor among them.

The setting Manifold explains is core.fsmonitor, a line in the repo's own .git/config that names a program. Git starts that program whenever it refreshes its file index, as git status does.

Now, the check in place was the workspace-trust prompt, the dialog asking whether you trust a folder. But several agents ran git status in the background before that prompt, outside the sandbox that is meant to fence in an agent's commands.

So your test today is to open .git/config in a text editor before any agent or git command touches a folder you received. Manifold's line: "Any setting that names a program can run it."

The fix is a fresh clone, which doesn't carry that config, plus an updated agent. Goose 1.44.0, Hermes v0.21.1, Qwen Code v0.23.4, and Mistral Vibe 3.0.3 carry fixes, while Claude Code's ultrareview command and Grok Build aren't confirmed fixed.

And keep outside projects in a disposable VM or container. In Binance's report, a fake job interview's "assignment" repository ran malicious code during setup on an engineer's work computer.

2. Make your agent ask before it installs what a doc told it to

A vendor's llms.txt, the file companies publish to tell AI agents what to read, which packages to install, and which domains to trust, can name a package that nobody owns.

A scan of 8,565 of those files across 6,214 domains found 237+ unclaimed packages, domains, and subdomains. When the researcher behind the scan registered a few of those names, the first install reported back from inside a Fortune 500 company in under four minutes.

In one case, Clerk's docs told agents to run a bare npx clerk-next-fix-auth-protection, a name npx fetches from the public registry when it isn't installed locally, and a third party had registered it.

So the check you'd trust here, an HTTPS file on the vendor's own domain, pointed at a name anyone could claim.

Before you approve an install, check that this vendor publishes that name on that registry. Then make your agent ask before npx, pip install, and npm install, and prefer scoped forms like Clerk's new one, npx --package @clerk/eslint-plugin clerk-next-fix-auth-protection.

The same check applies when you install by hand.

Keep reading

Don't miss what's next in AI

Join 300,000+ engineers and researchers who get the signal, not the noise. Create a free account to read the rest of this story.

  • Full access to in-depth AI research breakdowns
  • Be the first to know what's trending before it hits mainstream
  • Daily curated papers, repos, and industry moves
Trending
  • No trending articles

Comments

avatar

Next Reads