Skip to main content

Managed Agent Runtime SDK β€” API Contract

The SDK exposes a single Anthropic-shaped surface for every runtime (Claude Managed Agents, Cursor, Gemini Antigravity, and any future runtime). Callers use the same four-step flow regardless of which runtime is active. Provider differences are fully encapsulated inside sdk/providers/<provider>/runtime/. Reference shape: Anthropic Managed Agents API

Public flow

The flow is identical for every runtime. No match runtime or if runtime == X blocks appear in calling code.

Input types

CreateAgentParams

AgentWorkspace

CreateEnvironmentParams

CreateSessionParams

SendEventsParams

Agent CRUD

Gemini Antigravity additionally supports saved-agent management through the normalized agents resource:

Output types

ManagedAgent

Anthropic-shaped. All fields extracted from the raw response where available.

Environment

Session

Anthropic-shaped.

AgentEvent

Anthropic-shaped. Cursor events are normalized to this shape by the cursor adapter before the stream is returned to the caller. Use event.kind() β†’ AgentEventKind and event.payload() β†’ AgentEventPayload for typed access. Key event types:

Provider normalization

Each runtime maps its native response shape to the Anthropic-shaped outputs above. Callers never see provider-specific fields unless they inspect .raw.

Adapter contract

Each runtime implements RuntimeAdapter in sdk/providers/<runtime>/runtime/mod.rs. Required methods:
Optional overrides (default: None):
To add a new runtime: create sdk/providers/<name>/runtime/mod.rs, implement RuntimeAdapter, add RUNTIME_ID/RUNTIME_NAME/DEFAULT_API_BASE constants, and call registry.register(...) in the provider’s mod.rs. No other files change.