October 15, 2026
AI-generated code checks input at the front door and then quietly forgets the rule three functions later, because each function signature is treated as a finished contract rather than a claim that still needs proof.
The Details:
User or an email string, it reasons as if validation already happened upstream. That assumption is locally correct for the function in front of it, but the actual rule might live two files away, in an old pull request, or only in a developer's memory. Nothing in the visible code forces the model to re-check.JSON.stringify, a database round trip, or a cache read comes back out as a plain string with no memory of ever being checked. Developers treat these as internal plumbing, not untrusted input, so nobody re-validates there.ValidatedEmail type, TypeScript branded types, or Rust newtypes make it impossible to compile code that accepts a raw string where a checked value is required. Teams without that infrastructure can get partway there with schema libraries like Zod or Pydantic, property-based testing to surface unchecked edge cases, and a hard rule banning raw primitives across module boundaries.Bottom Line: Rules enforced only by memory eventually get forgotten by someone, human or AI; rules enforced by types travel with the data and can't be dropped.
Enjoy this article?
Listen to the Claude Code Conversations radio show or join the community.