#2884·ag-ui

[Feature]: Say what kind of artefact `encryptedValue` holds, so redacted thinking can be replayed

Author: tombeckenhamCreated Oct 1, 2026Updated Oct 1, 2026

Pre-flight Checklist

  • I have searched existing issues and this hasn't been requested yet.

Problem or Motivation

encryptedValue does not say what kind of artefact it holds. A consumer that replays history to the provider cannot always rebuild the right block from it.

Anthropic has two block types with opaque bytes, and each one must go back with its own type:

Block Bytes Text
{ type: 'thinking', thinking, signature } signature Can be empty (display: 'omitted')
{ type: 'redacted_thinking', data } data None

Both arrive in AG-UI as the same shape:

typescript
{ role: 'reasoning', content: '', encryptedValue: '<opaque bytes>' }

OpenAI Responses reasoning with no summary has the same shape too (encrypted_content).

The bytes are opaque, so a consumer cannot tell them apart. If it sends redacted data back as a thinking signature, or a signature back as redacted_thinking, Anthropic rejects the request.

The integrations in this repo already put both Anthropic kinds in the same slot:

  • LangGraph (TS and Python): resolveEncryptedReasoningContent returns redacted_thinking.data as the encrypted value. aguiReasoningMessageToBlock rebuilds every ReasoningMessage as a reasoning block with encrypted_content. The kind of the bytes is gone.
  • CrewAI (_reasoning.py): encrypted holds "any signature / redacted-thinking blobs".

ReasoningCapabilities.encrypted is set for the whole agent, so it does not help with one message.

Proposed Solution

Add an optional field that names the kind of the encrypted value, on ReasoningMessage and on REASONING_ENCRYPTED_VALUE:

typescript
type ReasoningMessage = {
  // ...
  encryptedValue?: string
  /** What `encryptedValue` is, so a consumer can replay it as the right provider block. */
  encryptedValueKind?: 'signature' | 'redacted'
}
  • Optional, so current producers and consumers keep working.
  • 'redacted': the provider hid the reasoning. content is empty, and the bytes are the whole block.
  • 'signature': the bytes verify or continue the visible content.
  • Leave it out when the producer does not know.

The exact names are open. An open string, or a provider-scoped value such as 'anthropic.redacted_thinking', would also work.

Alternatives Considered

  1. Producer-specific metadata. TanStack AI uses metadata.tanstack.redacted: true today (TanStack/ai#1579). It works between our own producer and consumer. A consumer that keeps encryptedValue but drops metadata turns redacted bytes back into a signature, and other consumers cannot read our key.
  2. Infer from empty content. Does not work. A thinking block with display: 'omitted' and OpenAI reasoning with no summary also have empty content.
  3. Prefix or wrap the bytes. The value stops being the provider's value unchanged, and every consumer must know the private format.

Additional Context

  • TanStack AI change that hit this: TanStack/ai#1579.
  • Related: #2174 (Anthropic signature dropped on Bedrock), #2421 (reasoning messages in Claude adapter snapshots).