Skip to content

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 error chunk's error / errorDetail and a forced_completion chunk's error (run-level: one line, at most 256 characters);
  • tool_end.error, tool_input_error.error and tool_output_error.error (tool-level: line breaks kept, no cap);
  • failStream's message and detail, so getStreamInfo().metadata.error / errorDetail, the synthesized failure chunk, the DO's SSE fail frame, 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 /status error (its errorDetail already was);
  • the CF DO's /snapshot streamError, streamErrorDetail, error and errorDetail;
  • the CF DO's late-submit answer for a superseded run;
  • with verboseValidationErrors, the INVALID_RESULT error and issues on the DO and agent-server (they can echo the submitted value);
  • ai-sdk sendErrorToExpress, the createSSEStream error event for a thrown error, and a reloaded failed tool's errorText (convertToUIMessages), which now matches the live tool_end.error;
  • the CF Workflows stream and lock Durable Objects' 500 bodies.

No more HTML escaping. sanitizeErrorMessage used to turn < / > into &lt; / &gt;. No framework surface emits HTML, and clients render the text as text, so a React UI showed &lt; 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 (and errorDetail.code), which is unchanged. A redacted message reads postgres://[REDACTED], [token], [path], [ip], [email], password=[REDACTED].
  • A long run-level message is cut at 256 characters on every surface now, including stream error chunks and failStream text. The full text is in your server log and the session row.
  • HTML consumers escape the text themselves (above).
  • New core API. sanitizeErrorText, sanitizeToolErrorText, sanitizeStreamChunk and RUN_ERROR_TEXT_MAX_LENGTH are exported from @helix-agents/core. A custom StreamManager should call sanitizeStreamChunk on each written chunk and sanitize failStream's arguments; the contract cases SR.chunk-error-text-sanitized and SR.fail-text-sanitized check it. @helix-agents/core/testing exports SECRET_ERROR_TEXT and expectNoSecret for 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).

Released under the MIT License.