Claude Seekho

Managed Agents and Platform Tooling

In Claude Managed Agents (beta) Anthropic both runs the agent loop and provides a sandbox container for every session. You do not need to write the loop, state files or a scheduler.

20.1 Core objects

ObjectWhat it isHow often to create
EnvironmentContainer config: networking (limited/unrestricted), packages, MCP accessOnce, reuse
AgentStored, versioned config: model, system prompt, tools, skills, MCP serversOnce, store the ID
SessionOne run; its own workspace container; events streamNew for each task
VaultCredentials (API keys, MCP OAuth) — substituted at egress, never visible in the sandboxOnce
DeploymentRun an agent on a cron schedule ("report every night")As needed
Memory storeMemory that persists across sessionsAs needed
Managed Agents flow
  1. 1.Environment: environments.create
  2. 2.Agent: agents.create (once)
  3. 3.Session: sessions.create (every run)
  4. 4.Events: send user.message, read the SSE stream
  5. 5.Result: files, messages, outcome

Create the agent once; never run agents.create in the request path

env = client.beta.environments.create(name="dev-env", config={
    "type": "cloud",
    "networking": {"type": "limited", "allow_package_managers": True, "allow_mcp_servers": True},
})

agent = client.beta.agents.create(          # create once, save the ID
    name="Code Reviewer", model="claude-opus-5-5",
    system="You are a strict code reviewer.",
    tools=[{"type": "agent_toolset_20260401",
            "default_config": {"enabled": True, "permission_policy": {"type": "auto"}},
            "configs": [{"name": "web_search", "enabled": False},
                        {"name": "web_fetch", "enabled": False}]}],
)

session = client.beta.sessions.create(
    agent={"type": "agent", "id": agent.id, "version": agent.version},
    environment_id=env.id,
)
with client.beta.sessions.events.stream(session_id=session.id) as stream:   # open the stream first
    client.beta.sessions.events.send(session_id=session.id, events=[
        {"type": "user.message", "content": [{"type": "text", "text": "review the auth module"}]}])
    for event in stream:
        if event.type == "agent.message":
            for b in event.content:
                if b.type == "text": print(b.text, end="")

20.2 Advanced Managed Agents features

FeatureWhat it does
Permission policiesalways_allow, always_ask, auto (the server stops risky calls / asks for approval)
Outcomesuser.define_outcome + rubric — a separate grader agent keeps it iterating until the rubric passes
Multi-agent / workflowsA lead agent splits the work into phases across several agents (cheaper worker model)
Scheduled deploymentsAutonomous sessions on cron; pause/unpause/archive
WebhooksNotify your server on session events
Session budgetsA hard dollar cap for one session
File mounts / GitHubWork by uploading files or mounting a repo
Self-hosted sandboxesTool execution on your own infra
Console session viewerSee each session's trace with no setup

20.3 ant CLI

Anthropic's command-line tool. Rule: the CLI is for the control plane (defining agents, environments), the SDK is for the data plane (running sessions).

ant auth login                 # browser OAuth; profile ~/.config/anthropic/ (Windows: %APPDATA%\Anthropic)
ant auth status                # which credential is active
ant auth login --profile admin --scope "... org:admin"     # privileged work on a separate profile

ant beta:agents list --transform '{id,name,model}' --format jsonl
ant beta:sessions:events list --session-id session_01...

ant apply                      # sync agents/*.md, environment.yaml... in the repo; IDs go in claude-lock.json

20.4 Admin, monitoring and auth

FeatureDetail
Admin API (beta)Members, invites, workspaces, API keys, rate limit reports, service accounts — with an Admin key (sk-ant-admin...)
Usage & Cost reportsusage_report/messages, cost_report — raw HTTP; spend tracking
OpenTelemetryThe SDK emits a span for every request (C#: AddSource("com.anthropic.sdk.csharp*")); traces in Datadog/Grafana
Workload Identity FederationCI/cloud workloads authenticate with their own identity token (JWT), without a static API key
WorkspacesSeparate keys, limits, spend for teams/projects
Credential orderANTHROPIC_API_KEY → ANTHROPIC_AUTH_TOKEN → ant profile → WIF