details is an allow-listed subset per code, for example field and reason for invalid_input or resourceType for not_found. Messages are safe to show to users; they never echo source diagnostics.
Codes
The TypeScript SDK exposes the same information as
RefmatterError with status, code, requestId, and retryable.