Fail closed, fail safe
Two rules keep an app from hurting people:
- **Fail closed*: if something is wrong, deny access. Never let missing data silently grant it.
- **Fail safe*: never expose internal details. A stack trace tells an attacker how your app is built.
Return short, honest error messages to users and detailed ones to your logs. This split protects both the user and the app, and it is a habit that separates shipped apps from experiments.