Back to library
AI
tutorial

A/B Test Managed Agents Using Single-Session Overrides

Test agent variations instantly using session overrides without breaking core settings.

Use the 'agent_with_overrides' parameter in Claude Managed Agents to temporarily swap system prompts or tools for specific sessions.

Claude

The Scenario

You have a production-ready Claude Managed Agent but want to test how it performs with a different system prompt for a specific user segment.

Before & after

The old way

Updating an agent's core instructions for a one-off test and then reverting them manually takes 10-15 minutes and carries the risk of forgetting to revert.

With AI

Use the new override feature to change the system prompt or tools for one session without affecting your primary agent config. Total time: 1 minute.

The Prompt

GET /v1/sessions HTTP/1.1
{
  "agent": {
    "type": "agent_with_overrides",
    "system_prompt": "[NEW_EXPERIMENTAL_PROMPT]"
  }
}

The Claude API now allows developers to pass 'agent_with_overrides' to temporarily replace the model, system prompt, or tools for a single session.

Source

Claude Platform - Claude Platform Docs
"Pass agent with type: 'agent_with_overrides' to replace the model, system prompt, tools, MCP servers, or skills for a single session."