← Lab /Security & privacy

Plan mode does not consistently produce more secure code than default mode

Using plan mode in coding agents has no meaningful impact on the security of the generated applications

Security & privacy Datadog Security Labs 19 Aug 2026 Measurement Prototype evidence

Published as “Putting models to the secure coding test: Plan vs default mode”

Why it matters

Relying on plan mode alone is insufficient to improve security; prompt engineering and explicit security requirements remain essential.

Summary

The author prompted three LLM coding agents (Sonnet 5, Composer 2.5, GPT 5.5) to build a document portal in both default and plan modes, then scanned the output with Datadog Code Security and Claude's code_review. All six generations suffered a critical IDOR flaw, and overall plan mode did not reduce vulnerability counts; in some cases it introduced new severe issues. Evidence comes from the reported SAST findings and qualitative analysis of each iteration.

What they found 2

  1. A critical IDOR vulnerability appeared in every generated application

    “IDOR was present in every iteration of this experiment.”

  2. Sonnet 5 in plan mode produced zero SAST findings versus one in default mode

    “SAST findings | 1 | 29 | 2 | 0 | 2 | 3”

Caveats 4

  • Sonnet 5 plan mode reduced SAST findings from 1 to 0, suggesting a possible security benefit in that specific case
  • The prompt did not explicitly require per-document ownership checks, which likely caused the universal IDOR issue
  • Only three models and a single application specification were evaluated
  • Security assessment relied on automated tools (Datadog Code Security, Claude code_review) without manual penetration testing

What’s new here 4

  • First systematic comparison of plan vs default mode across multiple coding agents
  • Integration of Supply Chain Firewall to block vulnerable dependencies during generation
  • Quantitative SAST, IaC, and code-quality findings for each mode
  • Observation that prompt clarity, not mode, drives security outcomes