Skip to main content
Claude Managed Agents runs the agent on Anthropic’s servers. In a self-hosted environment, a worker you run answers its bash, read, write, edit, glob and grep calls. mirage_tools(ws) gives that worker Mirage’s versions, so every call runs in the workspace, under its profile, mounts and policies. The worker only connects out to Anthropic, so it can run inside your own server.

Install

Run a worker

The workspace here keeps its files in Redis next to RAM, which needs a Redis server and the redis extra:
Create a self-hosted environment and an agent with the agent_toolset_20260401 toolset as Anthropic’s guide shows, then serve its sessions from the workspace:

How it behaves

  • The tools keep the toolset’s names. One the session’s profile would always refuse is left out: a read-only workspace gets no write or edit.
  • bash runs Mirage’s shell, so a line sees the workspace’s mounts and commands, not the worker’s machine. A restart is refused, since the session keeps its directory and variables. A relative path resolves against the session’s working directory, which cd moves.
  • write overwrites a file only after the agent read all of it, and write and edit refuse a file that changed since the agent read it. stale_write_protection=False turns that off.
  • session_id= runs the tools as another session, with its profile.
  • web_search and web_fetch still run on Anthropic’s servers. Turn them off in the agent’s toolset to keep the agent to the workspace.

Example

examples/python/agents/claude_managed_agents/redis_report.py creates the agent and a session, serves the session from a RAM and Redis workspace, asks the agent to total /workspace/orders.csv into /redis/report.md, and prints the report from Redis.