---
title: "Hide internals in errors · Agent Wranglers"
url: https://agentwranglers.se/playbook/api-design/errors/no-internal-details
updated: 2026-10-20
licence: "All rights reserved"
---

# Hide internals in errors

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Errors](https://agentwranglers.se/playbook/api-design/errors)
- Rule: Never put stack traces, queries, file paths or server versions in an error. Log them, and return a reference the client can quote.
- How: Map unexpected exceptions to a 500 problem with a generic title and the [request ID](https://agentwranglers.se/playbook/operations/logs/request-ids). See [short errors](https://agentwranglers.se/playbook/adversarial-testing/data-and-secrets/short-errors).
- Check: Force a server error in staging. The body holds only the problem fields and a reference, and the log holds the trace under that reference.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers api design playbook: https://agentwranglers.se/playbook/api-design/errors/no-internal-details`.

- Previous: [Name every field that failed](https://agentwranglers.se/playbook/api-design/errors/validation-errors)
- Next: [Say when to retry](https://agentwranglers.se/playbook/api-design/errors/retry-after)
- [Errors](https://agentwranglers.se/playbook/api-design/errors)
