The running joke online is that you end your prompt with "make no mistakes" and the agent stops making them. I usually add a line about security myself. It sounds about as hopeful, but at least it is more specific.
At the end of September I left both out on purpose. I gave 23 models the same open brief: build a REST API for bookmarks in TypeScript, with storage and tests. I counted what they made up when nobody decided: timestamps, health endpoints, a SIGTERM handler. Security I did not look at then.
So I caught up. The projects were still on disk, so I started them again and attacked them. If you say nothing about security, what is left open?
Short answer: the front door. Long answer: it depends on which model happened to be selected, and on the framework that model picked.
How I tested it
Of the 83 API runs in that experiment, 70 started at the time. 68 of those ran again now, from 21 models in five harnesses: Claude Code, Codex, Antigravity, OpenCode and Freebuff. The code dates from 28 September to 1 October 2026 and nobody has touched it since. Each API ran from a copy, so the original runs stay as they were.
Ten attacks per API. What counts as open was in the script before the first run, so I could not move the goalposts afterwards:
- Delete without logging in. A
DELETEwith no credentials at all. - A dangerous URL.
javascript:alert(1)andfile:///etc/passwdas a bookmark. - A 20 MB request. Does the API refuse it, store it or fall over?
- Broken JSON. Does a stack trace with file paths come back?
- What else faces outward. Does the server listen on every network, is CORS open, can the client pick its own id, does
..%2Freachpackage.json, does a header name the framework?
As the eleventh check I ran npm audit on the dependencies. The two results I did not believe, the stack trace and the javascript: URL, I reproduced by hand. They held.
What everyone left open
All 67 APIs I could test this on let anyone delete any bookmark. Anyone, any bookmark. The 68th returned no id after creating one, so there was nothing to delete.
That is expected. The prompt did not ask for logins, and an agent that builds an unrequested login system has a different problem.
More interesting is who mentioned it. Of the 58 projects with a README, six state that there is no authentication. "This is a local single-user API", wrote GPT-6 Astra. All six come from GPT-6 Astra and GPT-6.1 Sol, in every one of their runs, and those are the same two models that left out the unrequested timestamps the first time. The other 52 READMEs explain how to start the server. Why you would rather not do that on an open port is not in there.
Because an open port is where it already is. 65 of the 68 servers listen on every network interface of the machine. That is what Node does when you pass no host: server.listen() then takes the unspecified address, :: or 0.0.0.0. Opus 5.5, GPT-6 Astra and Solar Pro 4 each passed 127.0.0.1 in one run.
On my laptop that is a detail. On a VPS it is a public bookmark service with a delete button.
Where the model made the difference
A bookmark API exists to store URLs, and those URLs end up in an href sooner or later. A javascript: URL in an href runs code the moment someone clicks it.
24 of the 68 APIs store javascript:alert(1) without a word of complaint. How often depends mostly on the model:
| Model | Stores javascript: |
|---|---|
| Claude Sonnet 5.5 | 0 of 5 |
| Claude Opus 5.5 | 0 of 3 |
| GPT-6 Astra | 0 of 3 |
| GPT-6.1 Sol | 0 of 3 |
| DeepSeek V4.1 Flash | 1 of 5 |
| Gemini 3.7 Flash | 4 of 5 |
| Nemotron 3 Ultra | 3 of 3 |
| Claude Haiku 4.5 | 5 of 5 |
Sonnet blocks it on purpose. Every run checks the protocol and refuses with a 400, for example {"error":"url must use http or https"}.
Haiku sat in the same harness, got the same prompt and ran on the same two days. It stores both javascript: and file: in every run. The enthusiastic intern accepts whatever you hand it, and files it carefully.
That fits what Veracode found in October. In their autumn update, Claude Opus 5.5 and GPT-6-Sol share first place at 73% and Sonnet 5.5 follows at 72%, while Gemini 3.7 Flash sits at 60%. The average rose from 56% to 62%, but Veracode says that rise sits mostly in one category: cross-site scripting, where the mean went to 18%. A javascript: URL belongs there, and even after that rise the mean stays below one in five.
Veracode's prompts say nothing about security either. The difference is what gets measured: Veracode tests four known kinds of weakness, from SQL injection to XSS. I looked at an ordinary bookmark API and counted what was left open. That Sonnet and Opus catch it there anyway is a habit. You only get it if that model happens to be selected.
Where the framework did the work
51 of the 68 APIs use Express, 16 bare node:http and one Fastify. That sounds like a detail. It turned out to be a large part of the security.
Large requests. express.json() refuses anything over 100kb by default, so the 20 MB request got into none of the Express APIs. For 20 of the 51 it came back as a 500 instead of a 413, because the agent's error handler treats every error as a server error. So the server refuses politely, then reports that it is broken itself.
node:http has no default limit, so there the agent had to think for itself. It did: 14 of the 16 wrote one. The other two, from GPT-5.6 Luna and GPT-5.6 Terra, stored the 20 MB.
Stack traces. Send broken JSON and 14 of the 51 Express APIs return an HTML page with the full stack trace and the path to node_modules on my disk. Haiku did it in all five runs, Muse Spark 1.3 in all three. Express only leaves the stack trace out when NODE_ENV is production, and no start script set it. The other 37 had their own error handler that returns tidy JSON.
A header. 46 of the 51 Express APIs send X-Powered-By: Express. Five turned it off. Harmless, but every scanner knows straight away where to look.
The rest held up. No API let the client pick its own id, none gave up package.json through ..%2F, and only one, from Gemini 3.6 Flash, accepted requests from any website.
Eight weeks later
I have not changed a letter of this code since September. The internet has.
As I write this, 52 of the 69 projects with a lockfile (the 68 APIs plus one that would not start this time) carry a body-parser with a high-severity advisory: GHSA-27r3-jxmh-p828, a denial of service through compressed requests. Another 15 carry a zod with GHSA-mrhx-c7xc-m3w5.
You cannot hold that against the agents. body-parser comes with Express, and its advisory appeared on 23 October, three weeks after the last run. The agents did pick zod themselves, but its advisory came out on 1 October, the last day of the experiment. No model could have known.
It does show how fast it goes. Without anyone changing a line, three in four of these projects had a high-severity problem within eight weeks. Generated code starts to age the moment the agent finishes, and faster than anyone reads it.
What this does not show
- One brief. A small bookmark API in TypeScript, with security left out on purpose. A prompt that asks for it probably gets different code. I did not test that.
- Local attacks. I tested what I fixed up front, on my own machine. More may be open that I did not look for.
- Few runs. Two to five per model, counts and no significance tests. The differences between models are large enough to see, and too small to turn into a ranking.
What to do about it
Put security in the brief. Something a little more concrete than "make no mistakes". What you leave unsaid you only get from the right model, and only if that model happens to be selected. Five lines in the prompt or in your CLAUDE.md file cover everything that was open here:
- listen on
127.0.0.1unless I ask otherwise - accept only
httpandhttps - cap the body size
- never return a stack trace
- say in the README which access control is missing
Or better: let a hook check it. A CLAUDE.md file is a request. The agent usually reads it, but not always, and a long session pushes it into the background. A hook runs every time. I said as much before in stop asking your agent nicely: your CLAUDE.md is a suggestion, a hook is a wall. So put whatever you can check in a pre-commit hook, with Husky or something like it. That also stops the commit that bypasses the agent:
# .husky/pre-commit
if git diff --cached -U0 | grep -E '^\+.*\.listen\(' | grep -vqE '127\.0\.0\.1|localhost|host'; then
echo "listen() without a host binds every interface; bind to 127.0.0.1"
exit 1
fi
npm testThe javascript: URL, the body limit and the stack trace you will not catch with grep. For those you write one test per rule, and the same hook runs them. The lines in the brief still earn their place, because the agent needs them before it writes. The hook catches what it forgets. Only --no-verify gets past it, so block that flag for the agent with a PreToolUse hook in Claude Code.
Read the server as well as the feature. A review looks at what the code does. Look as well at the line where the server starts listening and at the error handler. Those are two places, and a checklist for AI pull requests has room for both.
Run npm audit in CI. Every version an agent picks goes bad eventually. The only question is whether you notice before someone else does.
Do not switch models quietly. The javascript: check belongs to Sonnet itself. Haiku does not have it, even in the same harness.
Last time the lesson was that an agent fills in what you leave open. This time it is about what almost nobody filled in. The missing security showed up in six READMEs and nowhere else, so the next person to start one of these servers will not know where the gap is. In May I wrote about the security debt nobody is counting. Here I could simply count it. It took an afternoon and a script.