Blog · GPT-6.2 Astra
GPT-6.2 Astra: trained for secure code, same holes
OpenAI says GPT-6.2 Astra was trained to write secure code from the start. We asked it for new features in apps that already had a security hole, and in most runs the hole was still there when it finished.
If you build apps by describing what you want, you probably don’t read every line the agent writes. You count on the model to get security right. So when OpenAI said it had given GPT-6.2 Astra new training aimed at writing secure code from the start (Introducing GPT-6.2 Astra and Sol), we wanted to see what that changes for an app like yours.
Earlier this month we did the same with Anthropic’s newest model, Claude Fable 5.2, and found that a new model still leaves the old holes in place. We ran GPT-6.2 Astra in OpenAI’s Codex CLI through the same tasks, three times each, and compared it with GPT-6 Astra from October.
Flawed apps: the hole stays in
Most apps pick up a few security holes as they grow, whoever wrote the code. So we gave the agent 33 small apps that each already had one, and asked for a new feature in the same part of the code. In an ordinary prompt you ask for the feature and don’t know the hole is there.
GPT-6.2 Astra finished with the hole still in the app in 85 of 99 runs. GPT-6 Astra did that 86 times.
The new training made little difference here. The agent did the task it was given and didn’t go looking for problems in code it hadn’t written.
Real projects: a little better
We also gave it real open-source projects with one function taken out, the function behind a known, published vulnerability, and asked it to write that function again. Then we ran the original attack against the result.
On the 25 web projects both models ran, the attack still worked on 23% of GPT-6.2 Astra’s runs, against 29% for GPT-6 Astra, a small step in the right direction. Across all 64 projects, including 39 written in C, more than one run in four still put a known vulnerability back.
With LeoPrevent
LeoPrevent reviews what the agent wrote before it says it’s done, including the code that was already there, and tells the agent what it found. The agent then fixes it in the same turn.
With LeoPrevent, GPT-6.2 Astra left the hole in 31 apps instead of 85. Across all 64 projects the attack worked in 15% of runs instead of 27%, and on the web projects in none of the runs, down from 17 of 75.
GPT-6.2 Astra also fixed more of the other known security problems in those apps: 58 of 129 across the three runs with LeoPrevent, against 15 on its own.
Claude Fable 5.2 told the same story earlier this month. On its own it left the hole in 93 of 99 runs, and with LeoPrevent in 29.
So even a model trained for security still leaves the holes that are already in your app. If you’re not going to read every line your agent writes, something should check its work before it ships.
Try LeoPrevent with your agent
The method and the verdict of every run are on the results page.