@readmodelmag
MODEL

Tools

Your coding agent copies your worst code. It even knows it.

SummaryAn ETH Zurich preprint finds frontier coding agents write less secure code when the code around them is insecure, and often explain the choice as following existing code. Our take: clean the repo before you hand it to an agent.

· MODEL Editors · 2 min read

Some links may be affiliate links. Disclosure

MODEL card on a cream background. Small red kicker: HOT TAKE / AI CODE. Large red figure: 76.5%. Black headline: Agents said they followed existing code. Bottom left: MODEL. Bottom right: Sources: ETH Zurich, arXiv preprint, Nov 8.
MODEL big-figure card for this story. Illustration by MODEL. Original. Image source.

Your coding agent's real style guide is the worst file in your repo.

That's our read of a new preprint from ETH Zurich's Secure, Reliable, and Intelligent Systems (SRI) Lab. "Coding Agents Propagate Vulnerabilities in Code Bases," by Chenhao Sun, Niels Mündler-Sasahara, Mark Vero and Martin Vechev, was posted to arXiv on Nov 8, 2026. It asks a simple question: if the code already in a repo is insecure, does the agent copy it?

What they tested. Two setups. First, 96 tasks where an agent adds a new backend app to a repo that already holds other apps, some secure, some not. Second, 20 pairs of tasks in real C/C++ projects, where the agent fills in memory-safety-critical code next to either a secure or an insecure version of similar code. The task is identical either way. Only the surrounding code changes. The agents ran in their native or recommended harnesses (Claude Code and Codex among them) on GLM 5.3, Claude Opus 5 and GPT-5.6 Sol, plus Claude Opus 5.5 and GPT-6 Astra on the C/C++ tasks.

What they found.

  • Every agent wrote less secure code when the code around it was insecure.
  • In real C/C++ repos, secure implementations were 35.4% less common on average with insecure context than with secure context. The gap ran from 25% (Opus 5.5) to 49% (GPT-5.6 Sol).
  • In the backend tasks, insecure neighbor apps cut correct-and-secure results by 3.4% on average.
  • Telling agents to follow the repo's conventions made it worse: the C/C++ gap widened to 39% to 55%.
  • Warnings like "don't bring in bugs" and generic security reminders helped, but gaps of 11% to 32% remained for all five agents.
  • Asked to review their own vulnerable code, the agents found the bug they had introduced 69.9% of the time. Asked why they wrote it that way, they pointed to another code site with a similar flaw 76.5% of the time.

The catch. This is a preprint, not yet peer reviewed, and the setups are controlled tests built for a clean comparison, not an audit of real teams. The authors call real-world code base evolution under agent contributions future work. The percentages are from the paper itself; we have not rerun the benchmark.

Our take. "Sloppy AI code" is often your old code with a faster copy button. The agent can spot the bug and still copy it, because matching the repo is what it thinks you asked for. So:

  • Fix known vulnerabilities before you delegate new work in that area. The paper's own advice.
  • Don't write "follow existing patterns" in an agent prompt for security-sensitive code without saying which patterns are wrong.
  • Add a review pass after the agent finishes. Agents caught most of their own bugs when asked to review.
  • Keep security scans in CI, because a reminder in the prompt narrowed the gap but did not close it.

The least careful contributor sets the standard. Make sure that isn't the file your agent reads first.

Not sponsored. MODEL has not run this benchmark. -- MODEL Editors

Get three tested tools every Friday

Free, weekly. Unsubscribe anytime.

Sources

  1. Coding Agents Propagate Vulnerabilities in Code Bases (arXiv:2611.11455)

    arXiv (ETH Zurich SRI Lab)

  2. Coding Agents Propagate Vulnerabilities in Code Bases

    ETH Zurich SRI Lab

  3. eth-sri/vulnerability-propagation (code and benchmark)

    GitHub

FREE · EVERY WEEK

The top AI tools this week, tested.

Every week MODEL's editors pick the AI tools worth your time, try them hands-on, and tell you what's good, what's not, and who it's for. Free, in your inbox.

Free. Unsubscribe anytime. Our picks are editorial and can't be bought.