Upgrade: error text is redacted on every outward surface
FU-RAW-ERROR-TEXT-SURFACES. Error free text can carry credentials: a database URL with its password, an API key, a bearer token, a password= pair. Until this release, several surfaces sent it to clients and remote parents as it was thrown. Now none do.
What changed
Streams hold only sanitized error text. Every stream manager (memory, Redis, the CF Durable Object's DOStreamManager, CF Workflows' stream Durable Object) sanitizes on write:
- an
errorchunk'serror/errorDetailand aforced_completionchunk'serror(run-level: one line, at most 256 characters); tool_end.error,tool_input_error.errorandtool_output_error.error(tool-level: line breaks kept, no cap);failStream's message and detail, sogetStreamInfo().metadata.error/errorDetail, the synthesized failure chunk, the DO's SSEfailframe, the WebSocket fail event and close reason.
So a browser, agent-server /sse and a remote parent reading a child's stream all see sanitized text. The raw text stays in the session row (SessionState.error / errorDetail) and in the server log.
Response fields that were raw are sanitized:
- agent-server
/statuserror(itserrorDetailalready was); - the CF DO's
/snapshotstreamError,streamErrorDetail,erroranderrorDetail; - the CF DO's late-submit answer for a superseded run;
- with
verboseValidationErrors, theINVALID_RESULTerrorandissueson the DO and agent-server (they can echo the submitted value); - ai-sdk
sendErrorToExpress, thecreateSSEStreamerror event for a thrown error, and a reloaded failed tool'serrorText(convertToUIMessages), which now matches the livetool_end.error; - the CF Workflows stream and lock Durable Objects' 500 bodies.
No more HTML escaping. sanitizeErrorMessage used to turn < / > into < / >. No framework surface emits HTML, and clients render the text as text, so a React UI showed < literally. The escaping is removed everywhere. If you inject error text into a page as HTML (innerHTML, dangerouslySetInnerHTML), escape it yourself, as you would any other text.
What you need to do
- Read the code, not the text. If you matched on error message text, for example a hostname, a path or a value in a connection string, switch to
code(anderrorDetail.code), which is unchanged. A redacted message readspostgres://[REDACTED],[token],[path],[ip],[email],password=[REDACTED]. - A long run-level message is cut at 256 characters on every surface now, including stream
errorchunks andfailStreamtext. The full text is in your server log and the session row. - HTML consumers escape the text themselves (above).
- New core API.
sanitizeErrorText,sanitizeToolErrorText,sanitizeStreamChunkandRUN_ERROR_TEXT_MAX_LENGTHare exported from@helix-agents/core. A customStreamManagershould callsanitizeStreamChunkon each written chunk and sanitizefailStream's arguments; the contract casesSR.chunk-error-text-sanitizedandSR.fail-text-sanitizedcheck it.@helix-agents/core/testingexportsSECRET_ERROR_TEXTandexpectNoSecretfor your own surface tests.
Not in this release
The model's view of a failed tool, a failed sub-agent or a failed remote child (the tool result message in its history) is still raw on every runtime. A later release redacts credentials there while keeping paths, so an agent can still recover from a "file not found" (FU-RAW-ERROR-TEXT-MODEL-SINK).
Since DI-70, a persistent companion's failure is the exception. The parent model sees a companion's failure sanitized with the client preset (sanitizeErrorMessage / sanitizeErrorDetail, paths redacted too, at most 256 characters): the hidden notice Sub-agent '<name>' failed: …, a blocking park's { status: 'failed', errorDetail } answer and every answer's priorResult.errorDetail are built that way by core's builders on runtime-js, the CF DO, CF Workflows, Temporal and DBOS. Two companion paths are still raw: Temporal's own blocking companion rows and DBOS's own spawn path (FU-TEMPORAL-DBOS-COMPANION-FAILURE-ROWS-SANITIZE). Plain sub-agent rows stay raw as above. The child session's own error / errorDetail stays raw (operator data).