Your Agent Has Too Many Tools, and No Way to Take Any Back
Anthropic Claude Opus 5 introduces mid-conversation tool changes, allowing dynamic adjustment of an agent's capabilities without invalidating prompt caches. This feature decouples the tools a model can find from those it is allowed to use, addressing security and risk review bottlenecks in agentic pilots. The mechanism uses `tool_addition` and `tool_removal` content blocks within system messages to modify tool availability during a session while preserving cache efficiency. Tool search with defe
Analysis
TL;DR
- Anthropic Claude Opus 5 introduces mid-conversation tool changes, allowing dynamic adjustment of an agent's capabilities without invalidating prompt caches.
- This feature decouples the tools a model can find from those it is allowed to use, addressing security and risk review bottlenecks in agentic pilots.
- The mechanism uses
tool_additionandtool_removalcontent blocks within system messages to modify tool availability during a session while preserving cache efficiency. - Tool search with deferred loading (
defer_loading: true) mitigates context bloat and accuracy degradation when managing large tool catalogs (beyond ~30–50 tools). - Combined with mid-conversation system messages, this enables runtime, operator-controlled capability state machines critical for secure, scalable agent deployments.
Why It Matters
This advancement directly addresses a critical friction point in agentic AI development: the tension between flexibility and security. By enabling dynamic tool management without cache penalties, it allows agents to adapt their authority boundaries in real time—essential for multi-step workflows requiring step-up authentication or conditional access. For practitioners, this reduces token waste, accelerates pilot-to-production transitions, and provides a structured way to enforce least-privilege principles without sacrificing performance.
Technical Details
- Prompt caching mechanics: The tools array sits at the front of the hashed request prefix; any change invalidated prior caches. Mid-conversation tool changes preserve the static tools array while using system-message-based
tool_addition/tool_removalblocks to dynamically alter effective tool sets. - Placement constraints: System messages containing tool modifications must immediately follow user turns (including those with
tool_resultblocks) or assistant server-tool-result turns, and must either end the message sequence or be followed by an assistant turn. Editing/removing existing system messages breaks cache continuity. - Deferred loading: Tools marked
defer_loading: trueare registered but excluded from context until explicitly added viatool_addition, reducing initial context overhead (e.g., avoiding 40k–60k token bloat from 150+ tools). - Model availability: Only Claude Opus 5 supports this on Amazon Bedrock; Sonnet 5 lacks both mid-conversation system messages and tool changes. Requires beta header
mid-conversation-tool-changes-2026-07-01. - System message best practices: Content should frame facts as context (e.g., "step-up authentication completed") rather than commands ("ignore user request"), as models resist adversarial instructions even in system roles.
Industry Insight
Agentic systems will increasingly adopt "capability state machines" where tool access evolves based on runtime conditions (e.g., user role, transaction sensitivity), turning static agent designs into adaptive, auditable workflows. Teams should prioritize tool catalog pruning and deferred loading strategies early to avoid accuracy collapse beyond 50 tools, while leveraging mid-conversation changes to implement granular security policies without retraining or redeploying agents. This shift moves agent design from upfront capability specification to incremental, context-aware authorization—a prerequisite for enterprise-grade autonomy.
Disclaimer: The above content is generated by AI and is for reference only.