mirage_tools(ws) gives that worker Mirage’s bash, read, write, edit, glob and grep, so every call runs in the workspace, under its profile, mounts and policies. The worker only connects out to Anthropic.
Install
Usage
Create a self-hosted environment, generate its environment key, and create an agent with theagent_toolset_20260401 toolset, as Anthropic’s guide shows. Then serve the environment’s sessions from a workspace:
Tools
- The tools keep the toolset’s names. One the session’s profile would always refuse is left out: a read-only workspace gets no
writeoredit. bashruns Mirage’s shell, so a line sees the workspace’s mounts and commands, not the worker’s machine. Arestartis refused, since the session keeps its directory and variables. A relative path resolves against the session’s working directory, whichcdmoves.writeoverwrites a file only after the agent read all of it, andwriteandeditrefuse a file that changed since the agent read it.stale_write_protection=Falseturns that off.session_id=runs the tools as another session, with its profile.web_searchandweb_fetchstill run on Anthropic’s servers. Turn them off in the agent’s toolset to keep the agent to the workspace.
Exports
Examples
redis_report.pycreates the agent and a session, serves the session from a RAM and Redis workspace, asks the agent to total/workspace/orders.csvinto/redis/report.md, and prints the report from Redis.