AI assumes inputs are valid. It generates code that crashes or misbehaves with unexpected input:
- Negative numbers where only positive expected
- Strings longer than database columns allow
- Special characters that break parsing
- Null or undefined values
Add validation at every boundary where data enters your system. Don't trust the frontend. Validate again on the backend.