Subgraph Error Masking in Hive Router
Hive Router now includes Subgraph Error Masking. Subgraphs are internal services, so their errors often carry detail that is useful for debugging but unsafe to expose: stack traces, internal hostnames, database messages, or upstream HTTP bodies. The router now rewrites these errors into a safe, generic form before they reach clients.
Because the router masks on their behalf, your subgraphs no longer need to sanitize their own errors
- they can return rich, detailed errors, and trust the router to redact them at the edge.
Masking runs last in the pipeline - after metrics, tracing, and logging. Your observability tools always see the original, unmasked error; only the client-facing response is redacted.
Enabled by Default
Out of the box, every subgraph error message is replaced with "Unexpected error". No configuration
is required, and no internal message reaches clients unless you opt out.
error_masking:
enabled: true # on by default
redacted_error_message: "Unexpected error" # customize the messageRedact Extensions and Override Per Subgraph
Beyond the message, you can control which extensions keys reach clients with an allow/deny
list, and override any setting for individual subgraphs - inheriting whatever you don't set.
error_masking:
all:
enabled: true
extensions:
mode: allow # keep only these keys
keys:
- code
subgraphs:
products:
enabled: false # trust this internal subgraph's messagesTo disable masking during local debugging without editing config, set
DISABLE_SUBGRAPH_ERROR_MASKING=true.
