Make the wrong thing impossible to compile
Use discriminated unions for exclusive options, group fields that must occur together, and narrow unknown at system boundaries. Parse request bodies, environment variables, and third-party responses before use.
Strict types also constrain coding agents. If only the correct call compiles, the compiler catches plausible but invalid code before review. Type-aware linting extends that protection beyond the type system.