← Blog

Anthropic Redacted Thinking Blocks Must Survive Tool Round Trips

Parminder Singh
Parminder Singh··5 min read
Summarize with AI

Anthropic can return redacted_thinking blocks when safety systems redact part of Claude’s reasoning. These blocks contain opaque encrypted data rather than readable text. Applications should preserve their exact position, include them when returning a tool-use assistant turn, separate them from omitted thinking, restrict their storage, and test serializers that often drop unknown content-block types.

Platform & Architectureai-securityllm-securitypolicy-enforcementarchitecturedevsecopsaudit
Anthropic Redacted Thinking Blocks Must Survive Tool Round Trips

Anthropic can return a redacted_thinking content block when its safety systems redact part of Claude's reasoning. The block contains opaque encrypted data and no readable thinking text. Production code still has to retain it. During a tool-use continuation, silently filtering that block out changes the assistant turn and breaks the thinking-block protocol.

This edge case catches tidy serializers. They keep text, thinking, and tool_use, then discard the one block type the developer never saw in a happy-path response.

TL;DR

  • Treat redacted_thinking as a first-class Anthropic content-block type with opaque data.
  • Preserve its exact position and bytes when returning an assistant turn during tool use.
  • Keep redacted thinking distinct from a regular thinking block whose display is omitted.
  • Test unknown-type filters, storage controls, stream assembly, and provider rejection paths before production release.

Redacted thinking is its own content type

Anthropic's thinking documentation defines redacted_thinking as a separate block returned when portions of Claude's reasoning are safety-redacted. Its shape contains type and an encrypted data field. There is no readable summary for the application to display or inspect.

That shape deserves an explicit branch in the parser. Validate that type equals the documented discriminator and that data is present as an opaque string. Preserve the original block index, message ID, provider attempt, and raw block under the route's retention policy. Avoid decoding the value, searching it for classifications, or copying it into text telemetry.

A content mapper that accepts only known user-facing types will drop this block. The failure can remain invisible until Claude requests a tool and the application reconstructs the assistant message for the next API call. The Anthropic API gateway guide provides the broader HTTP request and response path where the block enters the enterprise record.

Omitted display and safety redaction are different states

A regular thinking block can contain an empty thinking field when the request uses omitted display or when that behavior is the model default. Its signature still carries encrypted full thinking. A redacted_thinking block instead carries encrypted data under a different type. The empty display field and the redacted block therefore require separate parser branches and separate audit outcomes.

Do not normalize both cases to thinking_text_available=false. That Boolean throws away the provider's reason and the field required for round-trip continuity. Use explicit states such as thinking_summary_omitted and thinking_safety_redacted, then preserve the provider block behind each state.

The distinction also changes user-interface behavior. An omitted summary can be represented as thinking hidden by configuration. A safety-redacted block should remain opaque. Avoid placeholders that imply the application knows what was removed. AI agent observability works only when the event model retains this typed difference instead of flattening every block into a string.

Tool-use serializers must preserve the whole assistant turn

Anthropic's thinking tool-workflow guide walks through the two-call sequence. Claude returns thinking and a tool request. The application executes the approved tool, then sends back the original assistant content alongside a user message containing the tool result. Claude continues the same response.

When a redacted_thinking block appears in that assistant content, include it exactly where Anthropic placed it. A filter such as block.type == "thinking" is incomplete. A mapper that extracts only tool calls and text is also incomplete. Preserve regular thinking, redacted thinking, tool-use blocks, and their order as one protected assistant-turn artifact.

The latest assistant message cannot have its consecutive thinking sequence rearranged, edited, or partially dropped under Anthropic's documented protocol. Preflight the outbound request against the stored artifact before dispatch. The LLM parameter allowlisting guide covers the adjacent request-contract control; this check owns content-block fidelity rather than optional request parameters.

Storage should protect opaque data without erasing it

Opaque data still needs a retention decision. Keep the original block in the conversation store when tool continuation requires it. Put access controls around that store, record a digest and byte length in general audit telemetry, and avoid sending the encrypted payload to dashboards, analytics sinks, or user-visible error messages.

A useful row contains the Anthropic message ID, request attempt ID, content index, block type, encrypted-data presence, byte length, protected-object reference, digest, retention class, and later round-trip result. It should never label the data as a readable chain of thought. Anthropic exposes an encrypted protocol object, not text the enterprise can interpret.

I would reject a design that deletes redacted blocks immediately because nobody can read them. Readability is irrelevant to protocol custody. Deletion can break the next tool call, while unrestricted logging spreads an opaque provider artifact through systems that never need it.

Tie storage to the routed use case. A one-turn answer with no continuation can follow a shorter retention policy. A tool-using agent may need the block until the assistant turn reaches a terminal state. Per-route policy implementation gives that decision a named owner and retention class.

A release fixture needs a rare block on purpose

Build a controlled response fixture whose content array starts with regular thinking. Put redacted_thinking in the second position and a tool request third. Run that array through the production response parser, database mapper, queue, worker, and outbound serializer. Compare the final assistant content with the original at every index.

Then delete the redacted block, swap its position, change one character in data, duplicate it, and replace it with a regular thinking block containing an empty summary. Each mutation should produce a distinct local outcome before the request leaves. If a malformed continuation reaches Anthropic, retain the actual 400 response and request ID rather than inventing a local error category after the fact.

Print the fixture as three narrow rows on the terminal: block index, type, and digest prefix. The middle row should remain visible as redacted_thinking through every component. A blank space where row two belonged tells the reviewer exactly which serializer filtered it out.

Also test an unrecognized future block type. The safest default is to preserve the raw provider response under policy and stop a tool-use continuation for review, rather than silently dropping data required by a protocol the parser has not learned.

DeepInspect

DeepInspect can enforce a typed content-block policy on authenticated user or agent HTTP traffic deliberately routed to Claude through its proxy. It can record that a response contained redacted_thinking, preserve a protected digest and position, and reject a later routed tool-result request when the required assistant block sequence has been dropped or reordered.

The application owns tool execution, conversation storage, user-interface treatment, and retention of the complete assistant artifact. DeepInspect cannot decrypt the opaque data field, reconstruct a missing block, or observe provider calls that bypass its HTTP route.

Book a technical deep dive at deepinspect.ai.

Frequently asked questions

What is an Anthropic redacted thinking block?

It is a distinct Claude content block returned when safety systems redact part of the model's reasoning. Anthropic documents an opaque encrypted data field and no readable thinking text.

Is redacted thinking the same as omitted thinking display?

No. Omitted display returns a regular thinking block with an empty readable field and a signature. Safety redaction returns a redacted_thinking block with encrypted data. Keep their types and handling separate.

Should redacted thinking be shown to users?

The block contains no readable text to display. Keep the opaque provider data in the protected conversation artifact when protocol continuity requires it, and show only a product-approved state if the interface needs one.

Must redacted blocks be returned after a tool call?

Yes, when they are part of the assistant turn being continued. Anthropic instructs applications to pass redacted_thinking blocks back unchanged alongside the other thinking and tool-use blocks.