Dome Systems

SDKs

Call Dome's gateway and embed authorization in your agent from one client

Use the Dome SDK as the single client for gateway-backed MCP tool calls, LLM model calls, audit reads, and optional in-process Cedar checks. Authentication, act-as encoding, activity correlation, and typed error decoding live in the SDK so agent code stays small.

What the SDK does

The client wraps the Dome data plane and presents one surface per concern.

SurfacePurpose
client.gateway.toolsList and call MCP tools through the gateway. Bounded in-memory tools/list cache
client.gateway.llmOpenAI- and Anthropic-shaped LLM calls through the LLM gateway, with typed Dome error decoding
client.gateway.openai_client() / anthropic_client()Provider-native clients pointed at the Dome ingress, for teams that want the upstream SDK shape
client.auditCursor-paginated and streaming reads from hosted Audit v1
client.activity(...)Stamp a run with an opaque activity ID across every gateway call and audit event
client.start_policy_sync() + client.check() / client.evaluate()Opt-in local Cedar evaluation for in-process self-enforcement
dome.bootstrap.ensure_agent(...)Idempotent setup helper for developer agents and gateway keys

When to use the SDK

  • Gateway calls from agent code. The default. The SDK authenticates, encodes act-as, surfaces typed errors, and correlates activity. No infrastructure to deploy alongside the service.
  • In-process Cedar checks. Call client.start_policy_sync() to enable client.check() / client.evaluate() against a synced bundle. Microsecond decisions, fail-closed when no bundle is loaded.
  • External MCP traffic. Route through the gateway directly. Agents that don't run Python use the gateway over MCP without an SDK.

Lifecycle

flowchart LR
    A["Construct"] --> B["connect"]
    B --> C["gateway calls"]
    C -.->|optional| D["start_policy_sync + check"]
    C --> E["close"]
    D --> E
StepPurposeNetwork
ConstructValidate configuration, build transportsNone
connectPrepare credentials. Token exchange when needed for control-plane discoveryYes when exchanging
gateway callstools.list, tools.call, llm.chat, llm.messages, audit.queryYes — per call
start_policy_sync (optional)Launch background Cedar bundle sync for local checksYes — blocking initial sync
closeRelease transports, stop background sync, drain pending auditFlush only

Next steps

Python Client first. Adapters and Develop cover frameworks and credentials:

On this page

Was this page helpful?