arrow_backBack to field notes
AI Published 7 Aug 2026

How Do You Tell If Code Was AI-Generated?

Practical signals for spotting AI-generated code and writeups, from structural tells to the questions that trip up generated work.

Instructors, hiring managers, and CTF organizers keep asking some version of this. There's no single reliable detector, but there are patterns that show up often enough to be useful, especially when you're evaluating a batch of submissions rather than one isolated file.

Structural tells in generated code

Generated code tends to over-comment in a specific way: comments that restate what the line does (# increment the counter) rather than why it exists. Human code under time pressure skips obvious comments and only explains the weird parts. Generated code also tends toward uniform function length and consistent, textbook-perfect error handling everywhere, even in spots where a person would have gotten lazy or used a shortcut they'd learned from a previous bug.

Another tell: variable and function names that are slightly too descriptive and generic at the same time. calculate_total_price_with_tax instead of calc_total or whatever shorthand a real codebase converges on. Real projects accumulate naming inconsistency over time as different people touch the file. A single file with suspiciously consistent naming conventions across 300 lines, written supposedly by a beginner, is worth a second look.

Ask about the parts that don't run

The fastest practical check is to ask the person to explain a specific decision that isn't obvious from reading the code, something like

Written with AI assistance, reviewed and published by Michal Pilch (CISSP), Korra Studio.

Ready to go further?

This is one note from the Korra Studio knowledge base — the platform pairs every topic with 1-to-1 mentoring.

Get started freearrow_forward