Your AI assistant just wrote 400 lines of authentication middleware. It looks clean. It passes lint. Your PR reviewer approved it in 8 minutes because who really reads middleware?

Here's what nobody told you: that code has a logic flaw in the token refresh cycle that would let an attacker maintain a session indefinitely if they ever got a single valid refresh token. I know because I spent three weeks finding this exact bug in production after a Qiita post by a Japanese security researcher made me question everything I thought I knew about AI-generated code security.

The post (in Japanese, zero English coverage, stocks=0 when I found it) laid out a systematic approach to reviewing AI-generated code that I've never seen in any Western security guide. It wasn't about tools or scanners. It was about understanding what AI actually gets wrong — not syntax, not style, but logic.

The Three Places AI Code Breaks

Japanese security research (and I spent time cross-referencing this with a few JP security consultants I know) has a specific framework for AI code review that focuses on three failure modes: