Skip to content
Search
paperFebruary 2026Unreviewed

Can Adversarial Code Comments Fool AI Security Reviewers -- Large-Scale Empirical Study of Comment-Based Attacks and Defenses Against LLM Code Analysis

Scott Thornton

Abstract

AI-assisted code review is widely used to detect vulnerabilities before production release. Prior work shows that adversarial prompt manipulation can degrade large language model (LLM) performance in code generation. We test whether similar comment-based manipulation misleads LLMs during vulnerability detection. We build a 100-sample benchmark across Python, JavaScript, and Java, each paired with eight comment variants ranging from no comments to adversarial strategies such as authority spoofing

Categories

Cite

@misc{thornton2026can,
  title = {{Can Adversarial Code Comments Fool AI Security Reviewers -- Large-Scale Empirical Study of Comment-Based Attacks and Defenses Against LLM Code Analysis}},
  author = {Scott Thornton},
  year = {2026},
  month = feb,
  eprint = {2602.16741},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.16741}
}