Vulnerabilities in Code Comments Can Pollute Model Output
davidmanheim · x · 2026-07-19
This post recounts an interesting security experiment: even commented-out vulnerable code can affect model outputs.
In the experiment, after researchers added a piece of commented-out vulnerable code to a secure codebase, test results showed:
- Claude Sonnet 4.5: Outputs became 100% vulnerable code
- Gemini 2.5 Pro: 44% of outputs were vulnerable code
The conclusion is straightforward: LLMs read and are influenced by all the text in a codebase, not just the active code. This has significant implications for code reviews, context feeding, and security defense.
More from Safety
- Ex-DOGE cyber researchers breach Anthropic systems with AI agents in under 12 hours — ScottNover · 2026-10-26
- Ofcom admits UK online safety laws failed to protect children in first review — gnukeith · 2026-10-26
- Sakana AI CEO Calls for Japan-US Shared Framework for AI Capability Evaluation — SakanaAILabs · 2026-10-26
- Gary Marcus backs call to outlaw voice cloning, citing scam and fraud harms over benefits — GaryMarcus · 2026-10-26
- Turing-complete malware can run in PyTorch's backward pass via a zero-valued loss — retr0jirachi · 2026-10-26
- Import AI 478: $135k math autoformalization, ProgramBench hits 18.5%, agents leak via CPU cache — Import AI (Jack Clark) · 2026-10-26