Putting Models to the Secure Coding Test: Plan vs Default Mode (an alert)

Datadog Security Labs tested whether running AI coding agents in "plan mode" (generating and approving a design before implementation) produces more secure code than default mode. 

Across three models (Sonnet 5, Composer 2.5, GPT 5.5) building a document portal application, the experiment found **no meaningful security improvement** from plan mode—the prompt had far more impact than the mode. 

Critically, **every iteration introduced the same Insecure Direct Object Reference (IDOR) vulnerability**, allowing any authenticated user to access any document, because the prompt never explicitly specified ownership restrictions. 

The models consistently failed to infer necessary authorization logic without explicit requirements. Other findings: all iterations used parameterized queries (some via Prisma ORM), but plan mode sometimes introduced severe regressions (e.g., Composer 2.5 hardcoded a JWT secret in plan mode, enabling full authentication forgery). 

Supply Chain Firewall blocked vulnerable dependencies (multer, nodemailer, vite) in multiple runs. The conclusion: **AI cannot autonomously derive security constraints**—formal requirements must be specified, and plan mode's architectural discussions don't automatically translate to robust authorization logic. Future experiments will test explicit security skills and prompts. 

https://securitylabs.datadoghq.com/articles/putting-models-to-the-secure-coding-test-plan-vs-default-mode

Comments

Popular posts from this blog

Prompt Engineering Demands Rigorous Evaluation

Open-SPDD proposes an open framework for Spec-Driven Development workflows

OWASP ASVS 5.0 Released - Key Updates and What You Need to Know