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:

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.

Original post →

More from Safety

Safety channel →