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
- Researcher questions AI safety eval firm, citing 'blatantly sloppy' security and monitoring — Kyrannio · 2026-09-11
- Class action accuses Anthropic of overselling Claude subscriptions with deceptive usage multipliers — The Decoder · 2026-09-11
- MD shows buying lab media requires background checks, calling AI bioweapon doom scenarios implausible — Ghost_Pilot_MD · 2026-09-11
- Spotify chatbot withstands 2023-era jailbreaks but happily writes song code — AaronBergman18 · 2026-09-11
- A 99%-real doctored photo fools detectors: the earring problem in visual forensics — henkvaness · 2026-09-11
- Fields Medalist founds Mathematical AI Safety Institute to prove AI safe like cryptography — The Decoder · 2026-09-11