# Claude Managed Agents (/integrations/managed_agent)





{/* MANUAL-CONTENT-START:intro */}

Call a [Claude Managed Agent](https://www.anthropic.com/) hosted on the Claude Platform from a Sim workflow. Select a Claude Platform account, agent, and environment, then send the task message.

Optional inputs attach credential vaults, a memory store with read or write access and usage instructions, files, and metadata tags. The &#x2A;*Run session (create, send, wait for reply)** operation waits for the reply and returns final text and a session ID, with token usage when available, for downstream processing and cost tracking. Outputs from the other operations depend on the selected action. Session actions also create, inspect, interrupt, archive, update, or delete sessions; read events; and submit custom-tool results or confirmation responses. File attachments are supported for cloud environments.

{/* MANUAL-CONTENT-END */}

## Use the block [#usage-instructions]

Run or create a session with a Claude Platform account, agent, and environment. Optionally attach vaults, a memory store, files, and metadata. The Run session operation waits for the agent’s reply and returns final text and a session ID, with token usage when available. Outputs from other operations depend on the selected action.

## Actions [#actions]

### Managed Agent Run Session [#managed-agent-run-session]

Open a Claude Platform Managed Agent session and return the assistant response as text.

<ReferenceDetails>
  #### Input [#input]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `credential` | string | Yes | Claude Platform credential (Anthropic workspace API key) to run the agent with. |
  | `agent` | string | Yes | Managed-agent id inside the linked Claude workspace. |
  | `environment` | string | Yes | Environment id inside the linked Claude workspace. |
  | `environmentType` | string | No | Environment execution model hint ('cloud' \| 'self\_hosted'); the actual type is re-resolved server-side for routing. |
  | `userMessage` | string | Yes | The user message to send to the Managed Agent. |
  | `vaults` | array | No | Zero or more vault ids for MCP tool auth. |
  | `vaultsAck` | boolean | No | Acknowledgement that the author may use the attached vaults. |
  | `memoryStoreId` | string | No | Optional Agent Memory Store id. |
  | `memoryAccess` | string | No | Memory store access mode: 'read\_write' (default) or 'read\_only'. |
  | `memoryInstructions` | string | No | Per-attachment guidance for how the agent should use the memory store. |
  | `files` | array | No | File attachments (cloud envs only), as \[\{fileId, mountPath?}]. |
  | `sessionParameters` | object | No | Key/value session metadata forwarded to the session. |

  #### Output [#output]

  | Parameter | Type | Description |
  | - | - | - |
  | `content` | string | Final assistant text from the Managed Agent session. |
  | `sessionId` | string | Anthropic session id (for logs / linking). |
  | `inputTokens` | number | Cumulative input tokens for the session. |
  | `outputTokens` | number | Cumulative output tokens for the session. |
</ReferenceDetails>

### Managed Agent Create Session [#managed-agent-create-session]

Create a Claude Platform Managed Agent session and return its id without waiting for a reply.

<ReferenceDetails>
  #### Input [#input-1]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `credential` | string | Yes | Claude Platform credential (Anthropic workspace API key) to act with. |
  | `agent` | string | Yes | Managed-agent id inside the linked Claude workspace. |
  | `environment` | string | Yes | Environment id inside the linked Claude workspace. |
  | `environmentType` | string | No | Environment execution model hint ('cloud' \| 'self\_hosted'). |
  | `userMessage` | string | No | Optional first message; seeds initial\_events and starts the agent immediately. |
  | `vaults` | array | No | Zero or more vault ids for MCP tool auth. |
  | `vaultsAck` | boolean | No | Acknowledgement that the author may use the attached vaults. |
  | `memoryStoreId` | string | No | Optional Agent Memory Store id. |
  | `memoryAccess` | string | No | Memory store access mode: 'read\_write' (default) or 'read\_only'. |
  | `memoryInstructions` | string | No | Per-attachment guidance for how the agent should use the memory store. |
  | `files` | array | No | File attachments (cloud envs only), as \[\{fileId, mountPath?}]. |
  | `sessionParameters` | object | No | Key/value session metadata forwarded to the session. |

  #### Output [#output-1]

  | Parameter | Type | Description |
  | - | - | - |
  | `sessionId` | string | Anthropic session id (sesn\_...). |
  | `started` | boolean | True when a first message was seeded, so the agent is already running. |
</ReferenceDetails>

### Managed Agent Send Message [#managed-agent-send-message]

Send a user message to an existing Claude Platform Managed Agent session.

<ReferenceDetails>
  #### Input [#input-2]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `credential` | string | Yes | Claude Platform credential (Anthropic workspace API key) to act with. |
  | `sessionId` | string | Yes | Anthropic session id (sesn\_...) to act on. |
  | `userMessage` | string | Yes | The user message to send to the session. |

  #### Output [#output-2]

  | Parameter | Type | Description |
  | - | - | - |
  | `sessionId` | string | The session the message was sent to. |
  | `sent` | boolean | True when the event was accepted by the API. |
</ReferenceDetails>

### Managed Agent Get Session [#managed-agent-get-session]

Read a Managed Agent session: status, stop reason, token usage, metadata, and any tool calls awaiting approval.

<ReferenceDetails>
  #### Input [#input-3]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `credential` | string | Yes | Claude Platform credential (Anthropic workspace API key) to act with. |
  | `sessionId` | string | Yes | Anthropic session id (sesn\_...) to act on. |

  #### Output [#output-3]

  | Parameter | Type | Description |
  | - | - | - |
  | `sessionId` | string | The session that was read. |
  | `status` | string | Session status — 'idle', 'running', 'rescheduling', or 'terminated'. |
  | `stopReason` | string | Why the session last stopped, e.g. 'end\_turn' or 'requires\_action'. |
  | `requiresAction` | boolean | True when the session is waiting on a tool confirmation or custom tool result. If this is true while pendingTools is empty, the session is blocked but the API named no blocking events — surface it rather than treating the session as done. |
  | `pendingTools` | json | Blocking tool calls — \[\{id, eventType, kind, name, input}]. Route by kind: 'confirmation' ids go to Respond To Tool Confirmation, 'custom\_tool\_result' ids go to Respond To Custom Tool. |
  | `metadata` | json | Session metadata. |
  | `title` | string | Session title. |
  | `inputTokens` | number | Cumulative input tokens. |
  | `outputTokens` | number | Cumulative output tokens. |
</ReferenceDetails>

### Managed Agent List Events [#managed-agent-list-events]

Read a Managed Agent session's event history and the agent's reply text.

<ReferenceDetails>
  #### Input [#input-4]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `credential` | string | Yes | Claude Platform credential (Anthropic workspace API key) to act with. |
  | `sessionId` | string | Yes | Anthropic session id (sesn\_...) to act on. |
  | `eventTypes` | array | No | Optional event-type filter, e.g. \['agent.message']. Omit to return every event. |
  | `limit` | number | No | Maximum events to return, keeping the most recent (default 500). |

  #### Output [#output-4]

  | Parameter | Type | Description |
  | - | - | - |
  | `sessionId` | string | The session that was read. |
  | `events` | json | Session events, oldest first. |
  | `count` | number | Number of events returned. |
  | `assistantText` | string | Concatenated text of every persisted agent.message, in order. |
  | `truncated` | boolean | True when the limit was hit and older events were dropped. |
</ReferenceDetails>

### Managed Agent Update Session [#managed-agent-update-session]

Update a Managed Agent session's title or metadata.

<ReferenceDetails>
  #### Input [#input-5]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `credential` | string | Yes | Claude Platform credential (Anthropic workspace API key) to act with. |
  | `sessionId` | string | Yes | Anthropic session id (sesn\_...) to act on. |
  | `title` | string | No | New session title. |
  | `sessionParameters` | object | No | Replacement metadata map (replaces all stored metadata, not merged). Leaving it empty leaves the stored metadata unchanged — use clearMetadata to remove it. |
  | `clearMetadata` | boolean | No | Removes all of the session's stored metadata. Overrides any map supplied above. |

  #### Output [#output-5]

  | Parameter | Type | Description |
  | - | - | - |
  | `sessionId` | string | The session that was updated. |
  | `updated` | boolean | True when the update was accepted. |
  | `metadata` | json | Metadata after the update. |
  | `title` | string | Title after the update. |
</ReferenceDetails>

### Managed Agent Interrupt Session [#managed-agent-interrupt-session]

Stop a running Managed Agent session; it stays usable afterwards.

<ReferenceDetails>
  #### Input [#input-6]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `credential` | string | Yes | Claude Platform credential (Anthropic workspace API key) to act with. |
  | `sessionId` | string | Yes | Anthropic session id (sesn\_...) to act on. |

  #### Output [#output-6]

  | Parameter | Type | Description |
  | - | - | - |
  | `sessionId` | string | The session that was interrupted. |
  | `interrupted` | boolean | True when the interrupt was accepted. |
</ReferenceDetails>

### Managed Agent Respond To Tool Confirmation [#managed-agent-respond-to-tool-confirmation]

Allow or deny the tool calls a Managed Agent session is waiting on before it can continue.

<ReferenceDetails>
  #### Input [#input-7]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `credential` | string | Yes | Claude Platform credential (Anthropic workspace API key) to act with. |
  | `sessionId` | string | Yes | Anthropic session id (sesn\_...) to act on. |
  | `toolUseIds` | array | Yes | Blocking tool-use EVENT ids, from Get Session pendingTools\[].id where kind is 'confirmation' (not toolu\_ ids). |
  | `decision` | string | Yes | 'allow' to let the tools run, or 'deny' to reject them. |
  | `denyMessage` | string | No | Reason surfaced to the agent. Only sent when the decision is deny. |

  #### Output [#output-7]

  | Parameter | Type | Description |
  | - | - | - |
  | `sessionId` | string | The session that was answered. |
  | `decision` | string | The decision applied — 'allow' or 'deny'. |
  | `confirmedToolUseIds` | json | The tool-use event ids that were answered. |
</ReferenceDetails>

### Managed Agent Respond To Custom Tool [#managed-agent-respond-to-custom-tool]

Return the result of a custom tool a Managed Agent session is waiting on so it can continue.

<ReferenceDetails>
  #### Input [#input-8]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `credential` | string | Yes | Claude Platform credential (Anthropic workspace API key) to act with. |
  | `sessionId` | string | Yes | Anthropic session id (sesn\_...) to act on. |
  | `customToolUseId` | string | Yes | The custom tool-use EVENT id being answered, from Get Session pendingTools\[].id where kind is 'custom\_tool\_result'. |
  | `result` | string | Yes | The tool's output, returned to the agent as text. |
  | `isError` | boolean | No | Mark the result as a failure so the agent can adjust its approach. |

  #### Output [#output-8]

  | Parameter | Type | Description |
  | - | - | - |
  | `sessionId` | string | The session that was answered. |
  | `answeredToolUseId` | string | The custom tool-use event id that was answered. |
</ReferenceDetails>

### Managed Agent Archive Session [#managed-agent-archive-session]

Archive a Managed Agent session, preserving its history. Not reversible.

<ReferenceDetails>
  #### Input [#input-9]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `credential` | string | Yes | Claude Platform credential (Anthropic workspace API key) to act with. |
  | `sessionId` | string | Yes | Anthropic session id (sesn\_...) to act on. |

  #### Output [#output-9]

  | Parameter | Type | Description |
  | - | - | - |
  | `sessionId` | string | The session that was archived. |
  | `archived` | boolean | True when the archive was accepted. |
</ReferenceDetails>

### Managed Agent Delete Session [#managed-agent-delete-session]

Permanently delete a Managed Agent session, its events, and its sandbox. Not reversible.

<ReferenceDetails>
  #### Input [#input-10]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `credential` | string | Yes | Claude Platform credential (Anthropic workspace API key) to act with. |
  | `sessionId` | string | Yes | Anthropic session id (sesn\_...) to act on. |

  #### Output [#output-10]

  | Parameter | Type | Description |
  | - | - | - |
  | `sessionId` | string | The session that was deleted. |
  | `deleted` | boolean | True when the delete was accepted. |
</ReferenceDetails>
