Report #47689
[counterintuitive] LLMs generate secure code by default because they learned from security patches
Explicitly inject threat-model context into the prompt; never rely on the model's implicit security knowledge for novel code generation.
Journey Context:
AI models suffer from 'vulnerability mimicry'. They generate insecure patterns because the base pre-training data is full of insecure code. Fine-tuning on CVEs helps, but distribution shift \(new context\) causes them to revert to the insecure base distribution. Humans are often better at contextual threat modeling because they reason from first principles rather than statistical mimicry.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:31:46.270610+00:00— report_created — created