Security rules only noticeably improve GPT 5.5 output, leaving other models unchanged
Applying Project CodeGuard security rules significantly reduces vulnerabilities for GPT 5.5 but has little effect on Sonnet 5 and Composer 2.5
AI/ML Datadog Security Labs 19 Oct 2026 Measurement Prototype evidence
Published as “Putting models to the secure coding test: Security rules”
Why it matters
Security rules can improve AI-generated code security but are not a universal fix; their impact depends on the model and prompt specificity.
Summary
The author ran three coding agents (Sonnet 5, Composer 2.5, GPT 5.5) with and without Project CodeGuard security rules, using the same prompt to generate a document portal app. Static analysis (Datadog Code Security) and manual code review were used to count SAST findings and identify specific vulnerabilities. Only GPT 5.5 eliminated the cross-user IDOR when rules were enabled, while Sonnet 5 and Composer 2.5 showed no meaningful security improvement and even introduced regressions. The evidence is limited to a single run per model and relies on generated code rather than real-world deployments.
What they found 3
- GPT 5.5 with security rules had zero SAST findings
“SAST findings | 1 | 17 | 1 | 0 | 4 | 0”
- Sonnet 5 with security rules still contains the document-ownership IDOR vulnerability
“The document-ownership IDOR vulnerability, present in all earlier iterations of this application, remains in this version.”
- Composer 2.5 with security rules still falls back to hardcoded JWT and session secrets
“Both JWT_SECRET and SESSION_SECRET fall back to hardcoded values.”
Caveats 6
- The experiment was run only once per model, acknowledging AI nondeterminism.
- The prompt did not specify document-access constraints, which limited the models' ability to avoid IDOR.
- Only a single execution per configuration; results may vary with different runs.
- Prompt omitted explicit access control requirements, influencing outcomes.
- Only three coding agents were evaluated; findings may not generalize.
- Security rules are limited to the Project CodeGuard rule set; other rule sets were not tested.
What’s new here 4
- First systematic comparison of security-rule-enabled vs default coding-agent outputs.
- Shows that security rules can close an IDOR vulnerability for GPT 5.5 but not for other models.
- Identifies regressions introduced by rules, such as limited revocation checks in Sonnet 5.
- Provides quantitative SAST finding counts and dependency metrics for each variant.