AWS bedrock documentation change
Summary
Added documentation for new beta features: Automatic tool call clearing and Memory Tool. Updated model versions to include Claude Sonnet 4.5. Added warnings about beta service terms and notes about parameter formatting improvements.
Security assessment
The changes primarily document new beta features and model version updates. While parameter formatting improvements prevent data integrity issues, there's no explicit mention of security vulnerabilities being addressed. New features like memory tool access don't include security guidance.
Diff
diff --git a/bedrock/latest/userguide/model-parameters-anthropic-claude-messages-tool-use.md b/bedrock/latest/userguide/model-parameters-anthropic-claude-messages-tool-use.md index 29eefa633..054aa1bc1 100644 --- a//bedrock/latest/userguide/model-parameters-anthropic-claude-messages-tool-use.md +++ b//bedrock/latest/userguide/model-parameters-anthropic-claude-messages-tool-use.md @@ -5 +5 @@ -Fine-grained tool streamingComputer use (Beta)Anthropic defined toolsCost considerations for tool use +Fine-grained tool streamingComputer use (Beta)Anthropic defined toolsAutomatic tool call clearing (Beta)Memory Tool (Beta)Cost considerations for tool use @@ -8,0 +9,4 @@ Fine-grained tool streamingComputer use (Beta)Anthropic defined toolsCost consid +###### Warning + +Several functions below are offered in beta as indicated. These features are made available to you as a "Beta Service" as defined in the AWS Service Terms. It is subject to your Agreement with AWS and the AWS Service Terms, and the applicable model EULA. + @@ -14,0 +19,8 @@ We recommend that you use the Converse API for integrating tool use into your ap +###### Important + +Claude Sonnet 4.5 now preserves intentional formatting in tool call string parameters. Previously, trailing newlines in string parameters were sometimes incorrectly stripped. This fix ensures that tools requiring precise formatting (like text editors) receive parameters exactly as intended. This is a behind-the-scenes improvement with no API changes required. However, tools with string parameters may now receive values with trailing newlines that were previously stripped. + +###### Note + +Claude Sonnet 4.5 includes automatic optimizations to improve model performance. These optimizations may add small amounts of tokens to requests, but you are not billed for these system-added tokens. + @@ -96 +108 @@ In its response, the model uses the tool result to generate a response for the o -Fine-grained tool streaming is an Anthropic Claude model capability available with Claude Sonnet 4, and Claude Opus 4. With fine-grained tool streaming, Claude developers can stream tool use parameters without buffering or JSON validation, reducing the latency to begin receiving large parameters. +Fine-grained tool streaming is an Anthropic Claude model capability available with Claude Sonnet 4.5, Claude Sonnet 4, and Claude Opus 4. With fine-grained tool streaming, Claude developers can stream tool use parameters without buffering or JSON validation, reducing the latency to begin receiving large parameters. @@ -171 +183 @@ Because fine-grained streaming sends parameters without buffering or JSON valida -Computer use is an Anthropic Claude model capability (in beta) available with Claude 3.5 Sonnet v2, Claude 3.7 Sonnet, Claude Sonnet 4, and Claude Opus 4. With computer use, Claude can help you automate tasks through basic GUI actions. +Computer use is an Anthropic Claude model capability (in beta) available with Claude 3.5 Sonnet v2, Claude Sonnet 4.5, Claude 3.7 Sonnet, Claude Sonnet 4, and Claude Opus 4. With computer use, Claude can help you automate tasks through basic GUI actions. @@ -198 +210 @@ Model | Beta header -Claude Opus 4.1 Claude Opus 4 Claude Sonnet 4 Claude 3.7 Sonnet | computer-use-2025-01-24 +Claude Opus 4.1 Claude Opus 4 Claude Sonnet 4.5 Claude Sonnet 4 Claude 3.7 Sonnet | computer-use-2025-01-24 @@ -251 +263 @@ Model | Tool | Notes -Claude Claude Opus 4.1 Claude Claude Opus 4 Claude Sonnet 4 | +Claude Claude Opus 4.1 Claude Claude Opus 4 Claude Sonnet 4.5 Claude Sonnet 4 | @@ -314,0 +327,230 @@ If you want to prompt the model to use one of these tools, you can explicitly re +## Automatic tool call clearing (Beta) + +###### Warning + +Automatic tool call clearing is made available as a "Beta Service" as defined in the AWS Service Terms. + +Claude Sonnet 4.5 supports a new beta feature that automatically clears old tool use results as you approach token limits, allowing for more efficient context management in multi-turn tool use scenarios. To use tool use clearing, you need to add `context-management-2025-06-27` to the list of beta headers on the anthropic_beta request parameter. You will also need to specify the the use of `clear_tool_uses_20250919` and choose from the following configuration options. + +These are the available controls for the `clear_tool_uses_20250919` context management strategy. All are optional or have defaults: + +**Configuration Option** | **Description** +---|--- +`trigger` default: 100,000 input tokens | Defines when the context editing strategy activates. Once the prompt exceeds this threshold, clearing will begin. You can specify this value in either input_tokens or tool_uses. +`keep` default: 3 tool uses | Defines how many recent tool use/result pairs to keep after clearing occurs. The API removes the oldest tool interactions first, preserving the most recent ones. Helpful when the model needs access to recent tool interactions to continue the conversation effectively. +`clear_at_least` (optional) | Ensures a minimum number of tokens are cleared each time the strategy activates. If the API can't clear at least the specified amount, the strategy will not be applied. This is useful for determining whether context clearing is worth breaking your prompt cache for. +`exclude_tools` (optional) | List of tool names whose tool uses and results should never be cleared. Useful for preserving important context. +`clear_tool_inputs` (optional, default False) | Controls whether the tool call parameters are cleared along with the tool results. By default, only the tool results are cleared while keeping Claude's original tool calls visible, so Claude can see what operations were performed even after the results are removed. + +###### Note + +Tool clearing will invalidate your cache if your prefixes contain your tools. + +Request + + + + response = client.beta.messages.create( + betas=["context-management-2025-06-27"], + model="claude-sonnet-4-20250514", + max_tokens=4096, + messages=[ + { + "role": "user", + "content": "Create a simple command line calculator app using Python" + } + ], + tools=[ + { + "type": "text_editor_20250728", + "name": "str_replace_based_edit_tool", + "max_characters": 10000 + }, + { + "type": "web_search_20250305", + "name": "web_search", + "max_uses": 3 + } + ], + extra_body={ + "context_management": { + "edits": [ + { + "type": "clear_tool_uses_20250919", + # The below parameters are OPTIONAL: + # Trigger clearing when threshold is exceeded + "trigger": { + "type": "input_tokens", + "value": 30000 + }, + # Number of tool uses to keep after clearing + "keep": { + "type": "tool_uses", + "value": 3 + }, + # Optional: Clear at least this many tokens + "clear_at_least": { + "type": "input_tokens", + "value": 5000 + }, + # Exclude these tools uses from being cleared + "exclude_tools": ["web_search"] + } + ] + } + } + ) + +Response + + + + { + "id": "msg_123", + "type": "message", + "role": "assistant", + "content": [ + { + "type": "tool_use", + "id": "toolu_456", + "name": "data_analyzer", + "input": { + "data": "sample data" + } + } + ], + "stop_reason": "tool_use", + "usage": { + "input_tokens": 150, + "output_tokens": 50 + } + } + +Streaming Response + + + + data: {"type": "message_start", "message": {"id": "msg_123", "type": "message", "role": "assistant"}} + + data: {"type": "content_block_start", "index": 0, "content_block": {"type": "tool_use", "id": "toolu_456", "name": "data_analyzer", "input": {}}} + + data: {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "{\"data\": \"sample"}} + + data: {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": " data\"}"}} + + data: {"type": "content_block_stop", "index": 0} + + data: {"type": "message_delta", "delta": {"stop_reason": "tool_use"}} + + data: {"type": "message_stop"} + + { + "type": "message_delta", + "delta": { + "stop_reason": "end_turn", + "stop_sequence": null, + }, + "usage": { + "output_tokens": 1024 + }, + "context_management": { + "applied_edits": [...], + } + } + +When using Claude Sonnet 4.5 with automatic tool call clearing, the response includes additional context management information: + + + { + "id": "msg_013Zva2CMHLNnXjNJJKqJ2EF", + "type": "message", + "role": "assistant", + "content": [...], + ... + "usage": {...}, + "context_management": { + "applied_edits": [ + { + "type": "clear_tool_uses_20250919", + "cleared_tool_uses": 8, # Number of tool use/result pairs that were cleared + "cleared_input_tokens": 50000 # Total number of input tokens removed from the prompt + } + ] + } + } + +###### Note + +Bedrock does not currently support `clear_tool_uses_20250919` context management on the CountTokens API. + +## Memory Tool (Beta) + +###### Warning + +Memory Tool is made available as a "Beta Service" as defined in the AWS Service Terms. + +Claude Sonnet 4.5 includes a new memory tool that provide customers a way to manage memory across conversations. With this feature, customers can allow Claude to retrieve information outside the context window by providing access to a local directory. This will be available as a beta feature. To use this feature, you must use the `context-management-2025-06-27` beta header.