London

June 28–29, 2027

New York

September 15–16, 2026

Berlin

November 9–10, 2026

AI coding rules matter more than your model

Treat your AI rules like code.
November 18, 2026

Estimated reading time: 3 minutes

Key takeaways:

  • Give your AI tools security rules. Curated rule sets cut measured risk in AI-generated code by up to 70%, while vague instructions did little.
  • Price is a poor guide to safety. Some budget models carry less security risk than flagship models costing more than 80 times as much per run.
  • Test before you standardize: 15 different models led in at least one of the 11 frameworks tested, so the safest choice depends on your stack.

If your team’s AI security plan is a line telling the model to “write secure code,” it’s doing very little. It’s an easy line to add on day one and forget about.

The second wave of Secure Code Warrior’s AI Trust Index, released on November 17, makes the case.

The company tested more than 30 models from OpenAI, Anthropic, Google, Alibaba, Mistral, and others, building more than 15,000 apps and 41.3 million lines of code along the way. This time it ran the models inside a harness – the setup of prompts, rules, and tools that developers use day to day.

The results vary widely. The models produced between 0.24 and 3.66 vulnerabilities per 1,000 lines of code, a 15-fold gap between the best and worst performers.

Curated AI coding rules cut the most risk

Vague security instructions made little difference. Curated rule sets cut measured risk by up to 70%, which is a big swing for what is, in the end, a text file.

The averages are more modest, but still significant. On the lower-risk half of models, curated rules cut risk by 54% on average. On the higher-risk half, the average was 34%. Rules help most where the model is already reasonably strong.

“Today’s models know approaches to secure coding, but they don’t do it by default.” says Pieter Danhieux, co-founder and CEO of Secure Code Warrior. “The harness, prompts and rules they’re given decide how secure the output is, and that behavior can shift with every new release.”

For engineering leaders, that moves security into territory you already control. Rules files, system prompts, and harness configuration sit with your team, and they don’t need a procurement cycle to change.

Most teams haven’t formalized that layer yet. In LeadDev’s AI Impact Report 2026, 32% of the 591 engineering leaders surveyed said their organization has no formal policy for AI agents, and another 25% handle it informally or ad hoc. Meanwhile, 81% said AI tools or agents already have write access to their code repositories.

The expensive model isn’t automatically safer

With no rules applied, GPT 6 Luna carried a mean risk score of 19.4 at $0.10 a run. Claude Opus 5.5 scored 43.6 at $8.17 a run. If you’ve ever had to defend an AI invoice to your finance team, that gap will catch your eye.

Paying for the flagship model doesn’t guarantee safer code, and on security a cheaper model with good rules can come out ahead.

No single model came out on top either. Fifteen different models ranked first, or tied for first, in at least one of the 11 frameworks tested. The model that led most often topped just four. A company-wide default model may be the right call for cost or convenience, and it’s worth checking how that model performs in the languages your teams use.

Read the numbers with care

Secure Code Warrior sells AI governance and secure-coding training, and its headline conclusion, that governance of the AI coding stack is what makes the difference, lines up with its business. The figures come from its own benchmark and model rankings can change within weeks of a new release.

However, the findings make intuitive sense and are worth testing on your own codebase before you rewrite your AI policy around them.

Join LeadDev events in 2027

Review is another gap worth closing. LeadDev’s upcoming AI Code Review Report 2026 found that only 14% of respondents’ organizations apply clearly defined, consistent standards for reviewing AI-generated code, while 47% rely on the coding agent to review its own work. Rules that shape the code before it’s written take some of that pressure off review.

The practical point holds either way. Treat your AI rules like code: write them for each language you use, review them, and retest whenever you change models.