A configuration object can contain an API credential beside an ordinary region label. Serializing the whole object makes the response depend on every field that someone adds later. Deleting a single known secret leaves nested tokens and other credentials exposed.
Construct a diagnostic response from approved fields. A health check can report whether a credential is configured without returning its value. An upstream failure can return a trace identifier and a fixed error description without copying connection details. These examples use fictional configuration and return a response that you can inspect; they are not a secret manager or a real logging service. Apply the same approved-field rule to structured logs, support exports and error telemetry. Preserve the information a legitimate operator needs, rather than replacing the diagnostic endpoint with an empty response.
Project useful diagnostic data without returning credentials.