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 insidesdk/providers/<provider>/runtime/.
Reference shape: Anthropic Managed Agents API
Public flow
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 normalizedagents 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 implementsRuntimeAdapter in sdk/providers/<runtime>/runtime/mod.rs. Required methods:
None):
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.