Documentation / integrations

Connect Claude Managed Agents

Connect Anthropic-hosted Claude Managed Agents to Atryum to record tool invocations, apply agent-scoped rules, and gate tools awaiting Anthropic approval.

Unlike local coding agents that send each tool call to Atryum before execution, Claude Managed Agents run on Anthropic's hosted infrastructure.

Under Anthropic's model, a(n):

  • agent is a reusable Claude configuration — such as tools, Model Context Protocol (MCP) servers, skills, and system prompts
  • environment is the hosted sandbox where sessions run
  • session is one running task
  • events are the session log and stream that Atryum watches

Atryum connects outbound to Anthropic and uses those events to record, evaluate, and gate tool calls — including built-in agent tools and MCP tools declared on the Claude agent:

  1. A session emits a tool-use event, such as agent.tool_use, agent.mcp_tool_use, or agent.custom_tool_use. Atryum records it as an invocation and evaluates it against your rules. (Rules)
  2. When the session pauses with session.status_idle and requires_action, Atryum sends Claude an allow or deny response before the tool runs.
  3. Atryum records the later tool result from the environment on the invocation log. (Invocations)

Tools configured as always_allow run without waiting for Atryum. Atryum can record those calls afterward, but it cannot block them before execution.

Prerequisites

Before connecting Atryum to Claude Managed Agents, make sure you have:

  • An Anthropic API key created in the Claude workspace that owns the managed agents you want to list and watch.
  • At least one Claude Managed Agent configured in Anthropic.
  • At least one tool on the Agent definition configured with the always_ask permission. Tools set to always_allow run immediately in the hosted agent; Atryum can record those calls after the fact, but it cannot stop them before execution.
  • Atryum running with a writable database. (Quickstart)
  • An Atryum agent record to link to the Claude Managed Agent. (Connect agents)

Enable Claude Managed Agents in Atryum

  1. Open your atryum.toml configuration file:
    • On macOS, this is typically under ~/Library/Application Support/atryum/atryum.toml.
    • On Linux, this is typically under ~/.config/atryum/atryum.toml.
  2. Add an [[managed_agents]] block for each Anthropic account or workspace API key you want Atryum to use. For example:
    [[managed_agents]]
    name = "default"
    workspace = "anthropic-workspace-name-or-id"
    api_key = "sk-ant-..."
    • name — The local Atryum account label. Use a unique value when configuring multiple Anthropic accounts.
    • workspace — A display and metadata label for the Anthropic workspace.
    • api_key — An Anthropic API key created in that workspace.
  3. Restart Atryum so it loads the updated Claude Managed Agents credentials:

    a. In the terminal where Atryum is running, press Ctrl+C to stop it. b. Start Atryum again:

        ./atryum run --init-servers
  4. Verify that the Claude Managed Agents bridge is enabled:

    a. Within Atryum, click Agents in the left sidebar. b. Open an agent record by clicking on it. c. Confirm that the Claude Managed Agents section is displayed.

  1. Within Atryum, click Agents in the left sidebar.
  2. Click to open the Atryum agent record that should own the Claude Managed Agent.
  3. Under Claude Managed Agents, select the Claude agent(s) to link from the Linked Agents drop-down menu.

    If you configured multiple [[managed_agents]] accounts, choose the Account first.

  4. Click Save to write Atryum ownership metadata to the Claude Managed Agent.

Set up Claude Managed Agents rules

Create a rule in Atryum to evaluate matching Claude Managed Agents tool invocations:

  1. Within Atryum, click Rules in the left sidebar.
  2. Click New Rule.
  3. Under Action, select your desired action. For example: AI Evaluation

    (For AI Evaluation Actions) Under Evaluation Model, select the model configuration to use for the evaluation.

  4. Under Agents, select the Atryum agent records linked to Claude Managed Agents you want this rule to apply to. Leave this empty to match all agents.
  5. Under Servers / Sources, select the servers or sources the rule should apply to. Leave this empty to match all servers.
    • For built-in Claude agent tools, use claude-managed-agents.
    • For MCP tools declared on the Claude Managed Agent, use the MCP server name, such as slack.
  6. Under Tools, select the tools the rule should apply to. Leave this empty to match all tools.
    • For built-in Claude agent tools, use the Claude tool name, such as Bash.
    • For MCP tools, use the MCP tool name, such as slack_send_message.
  7. (Optional) Enter a Description so you can remember why the rule exists.
  8. Make sure that Enabled is checked, then click Create Rule.

Manage watched sessions

Atryum discovers sessions for linked Claude Managed Agents and starts watchers automatically. A watcher is Atryum's per-session connection to a running Claude Managed Agent session. For each watched session, Atryum:

  • Streams session events from Anthropic and records tool calls as invocations.
  • Evaluates pending tool calls against your rules when the session pauses for approval.
  • Sends allow or deny responses back to Anthropic before the tool runs.
  • Persists its place in the event log so it can catch up after a restart or reconnect.

Each row in the watched sessions table is one active watcher — one Claude session Atryum is listening to.

To review or clear watchers:

  1. Within Atryum, click Settings in the left sidebar.
  2. Review the watched sessions table under Claude Managed Agents.
  3. Click Delete to remove one stale watcher, or click Clear All to remove every watcher.

Troubleshooting

The Claude Managed Agents list shows the wrong workspace

Create or use an Anthropic API key in the workspace you want Atryum to list. Changing workspace in atryum.toml will not fix a wrong agent list.

A tool call was recorded but not blocked

Check the Claude Managed Agent's tool permission policy. If the tool is always_allow, Anthropic runs it without waiting for Atryum.

A rule did not match an MCP tool

Use the MCP server name as the rule's server pattern. For example, a Slack MCP tool call uses slack as the server pattern, not claude-managed-agents.

Old watchers keep logging errors

Within Atryum, open SettingsClaude Managed Agents and click Clear All. Linked agents can rediscover active sessions afterward.