What problem does it solve?
Secure Go error handling and information leakage prevention. Use whenever writing Go code that handles errors in APIs, services, or any code that crosses trust boundaries — HTTP handlers, gRPC services, CLI tools with user-facing output. Also trigger when reviewing Go error handling, implementing structured logging, or when the user mentions security, error sanitization, or preventing data leaks through error messages — even if they don't explicitly say "security". Covers domain error types, trust boundary translation, log redaction with slog, and safe API responses.
Core Features & Use Cases
- Domain error types separate safe user messages from internal errors to prevent leakage.
- Trust boundary translation automatically maps DomainError to HTTP/GRPC statuses.
- Structured logging with redaction using slog to avoid exposing sensitive data.
- Contextual metadata allowlisting to prevent log bloat and leakage.
Quick Start
Apply secure Go error handling patterns to ensure errors crossing trust boundaries are translated and redacted before reaching clients.