# Install (/install) Install the Dome CLI to manage agents, deploy rules, and operate the platform. The CLI also hosts the MCP server for AI assistants. You need a Dome account. [Sign up](https://app.domesystems.ai) with Google, GitHub, or GitLab, or with your company SSO. ## Install the CLI [#install-the-cli] **Homebrew (macOS and Linux)** ```bash brew trust dome-systems/tap brew install dome-systems/tap/dome ``` > **Note**: Homebrew 6 requires you to trust a third-party tap before it loads its formulae. On older Homebrew, `brew trust` is unnecessary and harmless. **Direct download** Set your platform, then extract the binary onto your `PATH`: ```bash VERSION=$(curl -fsSL https://api.github.com/repos/dome-systems/releases/releases/latest | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p') OS=darwin # or linux ARCH=arm64 # or amd64 curl -sSL "https://github.com/dome-systems/releases/releases/download/v${VERSION}/dome_${VERSION}_${OS}_${ARCH}.tar.gz" | tar xz sudo mv dome /usr/local/bin/dome ``` Each release also publishes `checksums.txt` and a per-archive SPDX SBOM. Verify a download with `shasum -a 256 -c checksums.txt --ignore-missing`. Verify the installation. ```bash dome version ``` ## Authenticate [#authenticate] Log in. ```bash dome auth login ``` This opens a browser-based SSO flow. On success, the CLI stores a session token locally. ## Select a Workspace [#select-a-workspace] List available workspaces and select an active context. ```bash dome context list dome context use ``` All subsequent commands operate within this workspace. Switch at any time with `dome context use`. ## Verify [#verify] Confirm your session and workspace: ```bash dome auth status dome context current ``` ## Next steps [#next-steps] * [Quickstart](/quickstart) to register your first agent and verify governed traffic * [Setup AI assistant](/setup-ai-assistant) to connect an assistant through MCP * [Personas](/personas) to identify your role and find relevant docs * [CLI](/cli) for the full command reference # Dome documentation (/introduction) Production agents need to know which agent acted, what it was allowed to reach, whether sensitive data left the boundary, and how to prove it afterward. Dome gives each agent an identity, applies rules, escalations, guards, and quotas as needed on every request, protects backend credentials, and records an attributable audit trail. ## Start here [#start-here] New to Dome? Run the quickstart to connect your first agent and verify a governed call. * [Run the quickstart](/quickstart): Build and verify your first governed agent, end to end. * [Install Dome](/install): Install the CLI, authenticate, and select your workspace. ## Learn the platform [#learn-the-platform] * [What is Dome?](/what-is-dome): How Dome sits between agents and resources. * [Choose your role](/personas): Find the docs that match your role. * [Core concepts](/concepts): Architecture, identities, controls, and audit. ## Explore Dome [#explore-dome] * [Connect agents and resources](/connect): Register agents, attach tools and models, and expose them through gateways. * [Govern every request](/govern): Author rules, route selected decisions through escalations, inspect content with guards, and cap spend with quotas. * [Operate governed traffic](/operate): Investigate audit events, stream live activity, and subscribe external systems. * [Manage Dome](/manage): Administer access, environments, integrations, settings, and exports. * [Develop governed agents](/develop): Wire your application to authenticate as an agent, call tools and models, and handle denials. ## Elsewhere in the docs [#elsewhere-in-the-docs] * [Learn](/learn): Understand how agents move from prototypes to production. * [Hands-on Labs](/tutorials): Work through role-based and production workflows from setup through verification. * [Reference](/cli): Look up the CLI, API, MCP, and SDK surfaces. * [Help](/help): Find the right channel for questions, bugs, and account requests. # Personas (/personas) Pick the persona that matches your job. Each path lists where to start and a hands-on tutorial. ## Developer [#developer] Developers own the agent as a workload. They register it, mint credentials, point the client at a gateway, and verify governed calls. They also wire Dome into the application when the agent runs in product code. * [Agent identity](/concepts/agents/identity) and [lifecycle](/concepts/agents/agent-lifecycle) * [Register external agents](/build/agents/external) and issue API keys * [Standing or delegated identity](/concepts/identity-patterns) when the agent acts for end users * [Develop](/develop) to authenticate, call tools and models, and handle denials * [Audit events](/operate/audit) to confirm outcomes Hands-on: [Developer tutorial](/tutorials/role/developer). ## Security [#security] Security owns what each agent may call, what content may leave a backend, and whether the audit trail can prove it. They author and simulate rules, apply guards, investigate denials, and export evidence. * [Authorization model](/concepts/architecture/authorization-model) and [scope hierarchy](/concepts/platform/scopes) * [Rules](/govern/rules), [simulate](/govern/rules/simulate), and [Guards](/govern/guards) * [Quotas](/govern/quotas) when spend is a security control * [Audit events](/operate/audit) and [Export Data](/manage/export) Hands-on: [Security tutorial](/tutorials/role/security). ## Operator [#operator] Operators own tool and model connections, gateways, grants, and the live signals that show the platform is healthy. They attach backends, expose gateways, grant agents access, and triage live traffic. * [Prepare environments](/manage/environments) and [scope hierarchy](/concepts/platform/scopes) * [Tools](/connect/tools), [models](/connect/models), and [Gateways](/build/gateways) * [Stream Live Events](/operate/observe) * [Settings](/manage/settings) and [Integrations](/operate/integrations) Hands-on: [Operator tutorial](/tutorials/role/operator). ## Platform admin [#platform-admin] Platform admins own tenancy, membership, who may administer Dome, and whether the estate stays operable and auditable as teams grow. They set access boundaries, prepare environments, and run export for oversight. * [Scopes](/concepts/platform/scopes) and [permissions](/concepts/platform/permissions) * [Manage access](/manage/access) and [Prepare environments](/manage/environments) * [Stream Live Events](/operate/observe) and [Export Data](/manage/export) * [Settings](/manage/settings) and [Integrations](/operate/integrations) Hands-on: [Platform Admin tutorial](/tutorials/role/platform-admin). ## Next steps [#next-steps] * [Tutorials](/tutorials) — Get Started and Role track * [What is Dome?](/what-is-dome) if you want the product overview first * [Setup AI assistant](/setup-ai-assistant) if you want an MCP-connected assistant while you work # Quickstart (/quickstart) # Setup AI assistant (/setup-ai-assistant) Set up an AI assistant to operate Dome alongside you. Use the CLI, MCP, docs, and skills for session, tools, and docs context: * **CLI** — install the binary, authenticate, and select the workspace the MCP server will inherit * **MCP** — `dome mcp serve` exposes role-scoped tools over JSON-RPC so the client can call Dome directly * **Docs** — a public docs MCP server, `llms.txt`, per-page `.md`, and agent-tab phrasing so the assistant follows how-tos instead of inventing steps * **Skills** — planned multi-step workflows for onboarding, policy deployment, and investigation Use the prompt below to hand setup to an assistant, or follow the sections in order yourself. Connect me to Dome from this assistant so I can operate the platform from chat. First, show me this plan and ask me to confirm before running anything: 1. Install the Dome CLI if it is missing (Homebrew with `brew trust`, or the direct download on [Install](https://docs.domesystems.ai/install)) 2. Sign me in with `dome auth login` (opens a browser), then sync contexts 3. Select a workspace with `dome context use` 4. Add the Dome MCP server to this client 5. Verify the connection (workspace + tool discovery) 6. Show me how you will use the Dome docs while we work Follow the commands at [https://docs.domesystems.ai/agent/setup-ai-assistant.md](https://docs.domesystems.ai/agent/setup-ai-assistant.md) exactly. Non-negotiable rules: * Narrate as you go. Before each step, tell me in one or two sentences what you are about to do and why it matters. Do not silently run the whole flow. * `dome auth login` opens a browser. Run it, then wait for me before continuing. After a successful sign-in, run `dome context sync`. * You cannot reload my MCP client. After writing MCP config, stop, tell me to reload if needed, and wait until I confirm Dome tools are visible. * Never print agent tokens, platform keys, or provider secrets in chat. * Prefer the Dome docs over guessing. Use [https://docs.domesystems.ai/llms.txt](https://docs.domesystems.ai/llms.txt) to find pages, and append `.md` to any docs URL for markdown. Read [https://docs.domesystems.ai/reference/mcp](https://docs.domesystems.ai/reference/mcp) for tool schemas and [https://docs.domesystems.ai/concepts/platform/permissions](https://docs.domesystems.ai/concepts/platform/permissions) for RBAC. * Missing MCP tools usually mean my workspace role, not a broken install. * Never report a step as done without showing the command or tool output. * This is setup only. Do not create workspaces, register demo agents, or deploy rules unless I ask after setup. Write MCP config for whichever client I am in: Claude Code (`claude mcp add dome -- dome mcp serve`), Cursor MCP config, Claude Desktop `claude_desktop_config.json`, Codex (`codex mcp add dome -- dome mcp serve` or `~/.codex/config.toml`), or stdio for other MCP clients. Once I confirm tools are live, verify with workspace + agent list, then offer first prompts such as listing agents, querying recent audit, or simulating a decision. ## Prerequisites [#prerequisites] Before you begin, you need: * A Dome account ([sign up](https://app.domesystems.ai)) * An MCP-compatible client (Claude Code, Claude Desktop, Cursor, or any MCP client) Refer to [Install](/install) if you prefer to install the CLI yourself first. The MCP server uses your active CLI session for auth and role. Tool discovery is permission-aware and fail-closed: it only exposes tools that role can use, so a `viewer` cannot register agents or deploy rules. Missing tools usually mean RBAC scope, not a broken install. Refer to [Permissions](/concepts/platform/permissions) concept for the role-to-tool mapping. ## CLI [#cli] The CLI is how you install Dome locally, sign in, and pick the workspace context the MCP server inherits. There is no separate MCP token. Switch workspaces or roles at any time and the tool list updates on the next request. ```bash dome auth login dome context sync dome context use ``` Refer to [Install](/install) for Homebrew and direct binary download instructions. ## MCP [#mcp] `dome mcp serve` speaks JSON-RPC 2.0 over stdio. Your client launches that process and discovers tools filtered by the active workspace role. Pick the integration that matches your client: **Claude Code** Sign in, pick a workspace, then register the server with Claude Code: ```bash dome auth login dome context use claude mcp add dome -- dome mcp serve ``` Restart or reload Claude Code if tools do not appear. Tools auto-discover. **Claude Desktop** Add to `~/Library/Application Support/Claude/claude_desktop_config.json`: ```json { "mcpServers": { "dome": { "command": "dome", "args": ["mcp", "serve"] } } } ``` Restart Claude Desktop to connect. **Cursor** Add to your Cursor MCP configuration: ```json { "mcpServers": { "dome": { "command": "dome", "args": ["mcp", "serve"] } } } ``` **Codex** Sign in, pick a workspace, then register the server with Codex: ```bash dome auth login dome context use codex mcp add dome -- dome mcp serve ``` Codex stores this in `~/.codex/config.toml`. You can also write it by hand: ```toml [mcp_servers.dome] command = "dome" args = ["mcp", "serve"] ``` Confirm with `codex mcp list`, then type `/mcp` in a Codex session. **Other MCP Client** Sign in, pick a workspace, then start the server on stdio and point your client at stdin/stdout: ```bash dome auth login dome context use dome mcp serve ``` Any MCP-compatible client that launches a stdio process works. ### Verify the connection [#verify-the-connection] Single-tool round-trips are the cheapest sanity check. If the assistant returns your workspace name and an agent list, auth and discovery both work. ```text title="Verify MCP connection" What workspace am I in? List the available agents. ``` The assistant calls `dome_context_current` and `dome_agents_list`. Each call lands in the audit trail with the same MCP attribution as any other modality. ### Example prompts [#example-prompts] Once MCP is connected, every CLI command has a prompt equivalent. The assistant fills defaults from the tool schema. Ask for specific values when you need them. ```text title="Register an agent" Register an agent named "my-first-agent". ``` ```text title="Create an API key" Create an API key named "default" for agent "my-first-agent". ``` The API key is returned exactly once. Ask the assistant to display it in full and store it before continuing. It cannot be retrieved again. ```text title="Deploy a Cedar rule" Deploy a Cedar rule that permits my-first-agent to call any tool: permit( principal == Dome::Agent::"my-first-agent", action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"*" ); ``` ```text title="Simulate an authorization decision" Simulate whether my-first-agent can mcp:call on the database-query tool. ``` ```text title="Query recent audit" Show the last 5 audit events. ``` ### Compose multi-step workflows [#compose-multi-step-workflows] Single-tool prompts work, but the value of an MCP-connected assistant is composition: chaining audit, rule lookup, simulation, and registry queries inside one request. ```text title="Investigate denied requests" Query audit events with result denied from the last 24 hours. For each event, look up the agent (by agent_id) and the matched rule (from the active bundle). Pick one event and run a simulation with the same agent, action, and resource to confirm the denial would still happen against the current policy. ``` Other useful compositions: ```text title="Onboard a new agent end-to-end" Run these four steps in order: (1) register an agent named "research-bot", (2) create an API key named "primary" for it, (3) deploy a Cedar bundle permitting principal == Dome::Agent::"research-bot" to mcp:call resource == Dome::MCPTool::"search-docs", (4) simulate that exact action and resource and confirm the decision is ALLOW. ``` ```text title="Switch workspaces" Switch to the staging workspace. ``` The tool list refreshes automatically. Tools outside the new workspace's role are hidden. ### Tool groups [#tool-groups] The Dome MCP server exposes tools in these groups, filtered by your workspace role: | Group | Description | | ------------------------------------------- | -------------------------------------------------------------------------------- | | [Context](/reference/mcp/context) | Switch workspaces, manage aliases, check auth status | | [Agents](/reference/mcp/agents) | Register, update, suspend, revoke agents and API keys | | [Rules](/reference/mcp/rules) | Deploy, validate, simulate, rollback Cedar policies | | [Audit](/reference/mcp/audit) | Query, inspect, export audit events | | [Platform](/reference/mcp/platform) | Platform status, API keys, configuration | | [Workspaces](/reference/mcp/workspaces) | Create workspaces, manage members, configure act-as | | [Tools](/reference/mcp/tools) | MCP server connections, catalogs, and managed authentication | | [Gateways](/reference/mcp/gateway) | Group tools and models behind named endpoints, grant agent access, set cost caps | | [Verification](/reference/mcp/verification) | OIDC and HMAC verification providers | ### Role to tool exposure [#role-to-tool-exposure] | Role | tools available | | ------------- | ---------------------------------------------------------------------------------------------- | | **admin** | Every workspace tool: agents, gateway, rules, audit, members, configuration | | **operator** | agents, gateway, rules (deploy and rollback), audit (view, no export), API keys, configuration | | **security** | rules (deploy, rollback, simulate), audit (view and export), agent suspend, gateway view | | **developer** | agents, agent keys, rules view, audit view, gateway view | | **viewer** | Read-only queries and listings | See the [MCP Server Reference](/reference/mcp) for the complete tool list with parameters. The AI assistant itself can be a registered Dome agent. Connecting Claude Code (or any MCP client) as a registered agent with its own credentials means every action it takes is governed by Cedar and recorded in audit. Refer to [Interactive app](/tutorials/examples/interactive-agent) for an end-to-end pattern. ## Docs [#docs] These docs are published for AI consumption. Prefer them when the assistant needs bulk or targeted context instead of guessing CLI flags or MCP schemas. | Format | URL | Use case | | ---------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------- | | **llms.txt** | [`/llms.txt`](/llms.txt) | Index of pages with titles and URLs | | **Full text** | [`/llms-full.txt`](/llms-full.txt) | Complete documentation as plain text | | **Per-page markdown** | Append `.md` to any docs URL | Targeted context injection | | **agent setup instructions** | [`/agent/setup-ai-assistant.md`](/agent/setup-ai-assistant.md) | Confirm-first CLI + MCP setup this page hands to an assistant | ### Connect the docs MCP server [#connect-the-docs-mcp-server] The public docs server is a separate MCP endpoint from `dome mcp serve`: * `https://docs.domesystems.ai/mcp` searches and reads public documentation. It needs no account and cannot operate a workspace. * `dome mcp serve` uses your signed-in CLI session to operate the Dome Platform. Its tools are filtered by your workspace role. Connect the docs server when you want the assistant to look up current product guidance as it works: **Cursor** Add to your project or user MCP configuration: ```json { "mcpServers": { "dome-docs": { "url": "https://docs.domesystems.ai/mcp" } } } ``` **Claude Code** ```bash claude mcp add --transport http dome-docs https://docs.domesystems.ai/mcp ``` **Codex** Add to `~/.codex/config.toml`, or `.codex/config.toml` for a single trusted project: ```toml [mcp_servers.dome-docs] url = "https://docs.domesystems.ai/mcp" ``` Confirm with `codex mcp list`, then type `/mcp` in a Codex session. **Other MCP Client** Point any Streamable HTTP MCP client at: ```text https://docs.domesystems.ai/mcp ``` For clients that only launch stdio servers, bridge the endpoint with `mcp-remote`: ```json { "mcpServers": { "dome-docs": { "command": "npx", "args": ["-y", "mcp-remote", "https://docs.domesystems.ai/mcp"] } } } ``` The server exposes three read-only tools: | tool | Use | | ------------ | ------------------------------------------------------ | | `search` | Find relevant pages and passages | | `get_page` | Read one page as Markdown by path or URL | | `list_pages` | Browse the page index, optionally under one URL prefix | Verify it with: `Search the Dome docs for delegated identity, then read the most relevant page.` ### Contextual menu [#contextual-menu] Every page includes a contextual menu (top-right) for one-click AI integration: * **Copy page** copies the current page as Markdown * **Open in Claude / ChatGPT / Cursor** starts a conversation with the page URL preloaded ### Agent tab in documentation [#agent-tab-in-documentation] Every operation page includes an **agent** tab alongside CLI, MCP, and API tabs. The agent tab shows the natural-language prompt in full (same titled text codeblock pattern as the examples above). Use those as guidance when building prompts or agent workflows. ### Run a governed demo with an agent [#run-a-governed-demo-with-an-agent] [Govern your first agent](/tutorials/get-started/govern-your-first-agent) carries a prebuilt Studio demo prompt for an AI agent: create a workspace, deploy rules, then give you the questions that prove allow, redact, and deny. Agent-facing instructions live at [`/agent/tutorials/get-started/govern-your-first-agent`](/agent/tutorials/get-started/govern-your-first-agent). ## Skills [#skills] Skills are multi-step workflows for agent onboarding, policy deployment, and incident investigation. They are unavailable. Use the CLI and MCP surfaces above for full platform access. ## Next steps [#next-steps] * [MCP](/reference/mcp) reference for the full tool catalog * [Govern your first agent](/tutorials/get-started/govern-your-first-agent) for a governed Studio demo * [Permissions](/concepts/platform/permissions) concept for the role-to-tool mapping * [Interactive app](/tutorials/examples/interactive-agent) to govern the assistant as a first-class Dome agent # What is Dome? (/what-is-dome) Dome is the governance layer between AI agents and the tools and models they use. It gives each agent an identity, controls what it can reach and do, protects credentials and sensitive data, and records activity. ## How does Dome work? [#how-does-dome-work] An agent sends each request to a gateway, a named endpoint that exposes a selected group of tools and models. Dome identifies the agent, checks gateway access, evaluates authorization rules and quotas, applies request guards, calls the resource with protected backend credentials, applies response guards, and records what happened. AI agents access tools and models through Dome, which connects, governs, operates, and manages the request path Refer to [Architecture](/concepts/architecture) concept for the component model and the stage-by-stage request pipeline. Dome's pillars support this flow: 1. **[Connect](/connect).** Configure agents, tools, models, and gateways so workloads can reach resources under governance. 2. **[Govern](/govern).** Control which resources agents can reach and what actions they may perform. Set quotas, protect credentials, and apply guards. 3. **[Operate](/operate).** Investigate audit events, stream live events, and subscribe to events. **[Manage](/manage)** and **[Develop](/develop)** support those pillars. Manage administers the platform around them (access, environments, integrations, settings, and export). Develop wires an agent into product code: authenticate, call tools and models through a gateway, and handle denials. ## Next steps [#next-steps] Once you know what Dome is, pick a path in: * [Install](/install) the CLI and select a workspace * [Quickstart](/quickstart) to register an agent and verify governed traffic * [Personas](/personas) to identify your role and find relevant docs * [Architecture](/concepts/architecture) concept for the component model and request path * [Develop](/develop) when you are ready to wire the application # Help (/help) Help runs through a few clearly separated channels. Pick the one that matches what you have so the request lands with the people who can answer it. ## Where to go [#where-to-go] | Where | For | What to expect | | ----------------------------------------------- | -------------------------------------------- | --------------------------------------------------- | | [Docs and search](/introduction) | Anything already written down | First stop | | [`#ask-dome`](https://discord.gg/d4m6C2SwU) | How-to questions, configuration, rule syntax | Best-effort and community-first. Staff triage daily | | Report an issue | Bugs, docs errors, and product feedback | Reaches the team with the page attached | | [Direct support](mailto:support@domesystems.ai) | Account, billing, and access | Contract SLA | | [Security](mailto:security@domesystems.ai) | Vulnerability disclosure | Coordinated disclosure | > **Warning**: Never paste API keys, agent credentials, or unredacted audit payloads into Discord. Send anything sensitive to [support@domesystems.ai](mailto:support@domesystems.ai). ## Start with the docs [#start-with-the-docs] Search covers every page, including the CLI, MCP, and API references. ## Ask in Discord [#ask-in-discord] [`#ask-dome`](https://discord.gg/d4m6C2SwU) is the place for how-to questions, configuration, and rule syntax. It is community-first and answered on a best-effort basis; staff read the channel daily. Post in the channel rather than in DMs so the answer helps the next person. Include: * What you are trying to do, and the surface you are on: CLI, MCP, API, or dashboard * The command or request, with secrets removed * What you expected, and what happened instead ## Report an issue [#report-an-issue] Use **Report an issue** on any page, including this one. It reaches the team with the page attached. Use it for reproducible bugs, docs that are wrong or incomplete, and product feedback. Describe the problem rather than the implementation — what you are blocked on tells us more than a specific API shape. A good report carries: * Output of `dome version` * The steps to reproduce, in order * Your workspace and context, from `dome context current` * The timestamp, and the audit event ID if the call reached a gateway Denials are usually not bugs. A rule that blocks a call writes an audit event explaining why, so check [Audit events](/operate/audit) first and bring the event ID if the outcome still looks wrong. ## Account, billing, and access [#account-billing-and-access] For provisioning, seats, plan changes, invoices, or a workspace you cannot reach, email [support@domesystems.ai](mailto:support@domesystems.ai) with your workspace name. These requests follow the SLA in your contract. ## Report a vulnerability [#report-a-vulnerability] Send security reports to [security@domesystems.ai](mailto:security@domesystems.ai). Do not post details in Discord until we have coordinated a disclosure. # Setup AI assistant — agent instructions (/agent/setup-ai-assistant) These are the instructions an AI agent follows to connect a user to Dome through the CLI and MCP, and to use the Dome docs while operating the platform. Read [Setup AI assistant](/setup-ai-assistant) instead if you are running the steps yourself. ## Goal [#goal] Install and authenticate the Dome CLI if needed, connect the user's MCP client to `dome mcp serve`, verify the connection, and leave the user able to operate Dome in natural language while reading the docs correctly. This is setup only. Do not create workspaces, register demo agents, or deploy rules unless the user asks after setup. ## Rules [#rules] Follow these even if the rest of this page is unreachable. * **Confirm before you start.** Before running any commands, present the plan below and wait for the user to say proceed. * **Narrate as you go.** Before each step, tell the user in one or two sentences what you are about to do and why it matters. Do not silently run the whole flow. * **Never invent credentials.** Do not print, log, or paste agent tokens, platform keys, or provider secrets into chat. * **Stop for browser auth.** `dome auth login` opens a browser. Run it, then wait for the user before continuing. * **You cannot reload their MCP client.** After writing MCP config, stop and wait for them to confirm the Dome tools appear. * **Prefer docs over guessing.** When a Dome concept, CLI flag, MCP tool, or permission is unclear, fetch the matching docs page (see Docs below) before improvising. * **RBAC is the boundary.** The MCP tool list is filtered by the user's workspace role. Missing tools usually mean role, not a broken install. * **Show your evidence.** Never report a step as done without the command or tool output that proves it. * **Expect re-runs.** Check for an existing CLI install and MCP config before overwriting. ## Quick setup [#quick-setup] Before running any commands, present the user with this checklist and wait for confirmation: ``` Here's what I'll do to connect you to Dome from this assistant. 1. Install the Dome CLI if it is missing (Homebrew with `brew trust`, or the direct download on [Install](https://docs.domesystems.ai/install)) 2. Sign you in with `dome auth login` (opens your browser), then sync contexts 3. Select a workspace with `dome context use` 4. Add the Dome MCP server to this client 5. Verify the connection (workspace + tool discovery) 6. Show you how I will use the Dome docs while we work Shall I proceed? ``` Do not start step 1 until the user confirms. ## Docs [#docs] Treat the published docs as source of truth while operating Dome. * **Human page:** [Setup AI assistant](https://docs.domesystems.ai/setup-ai-assistant) * **Install:** [Install](https://docs.domesystems.ai/install) * **MCP tool catalog:** [MCP](https://docs.domesystems.ai/reference/mcp) * **Permissions / roles:** [Permissions](https://docs.domesystems.ai/concepts/platform/permissions) Machine-readable surfaces (prefer these when you need bulk context): | Format | URL | Use | | ----------------- | --------------------------------------------------------- | ------------------------------------------- | | Index | `https://docs.domesystems.ai/llms.txt` | Discover pages by title | | Full text | `https://docs.domesystems.ai/llms-full.txt` | Broad offline context | | Per-page markdown | Append `.md` to any docs URL | Targeted page context | | Docs MCP | `https://docs.domesystems.ai/mcp` | Search, list, and read public documentation | | This file | `https://docs.domesystems.ai/agent/setup-ai-assistant.md` | These instructions | When the user asks how to do something in Dome, open the relevant how-to or concept page (or its `.md` twin) before inventing steps. Operation pages include CLI / MCP / API / agent tabs; use the agent tab phrasing when calling MCP tools. The public docs MCP server is not `dome mcp serve`. The docs server is unauthenticated and read-only. It exposes `search`, `get_page`, and `list_pages`. `dome mcp serve` uses the user's authenticated CLI session and operates their workspace. ## Steps [#steps] ### 1\. Install the CLI [#1-install-the-cli] ```bash command -v dome && dome version || echo "Dome CLI not installed" ``` If missing, install with Homebrew (`brew trust dome-systems/tap && brew install dome-systems/tap/dome`) or the direct download on [Install](https://docs.domesystems.ai/install). There is no `npx` package. Confirm `dome version` prints a version. ### 2\. Authenticate and sync [#2-authenticate-and-sync] ```bash dome auth login dome auth status dome context sync dome context list ``` `dome auth status` should report authenticated. If the user was invited to a non-default stack, pass `--server` (for example `dome auth login --server https://app.glint-8c.domesystems.ai`). ### 3\. Select a workspace [#3-select-a-workspace] Ask which workspace to use if more than one exists, then: ```bash dome context use dome context current ``` Record the workspace name and gateway host for later prompts. ### 4\. Add the MCP server [#4-add-the-mcp-server] Write config for whichever client the user is in. Prefer the client's native MCP registration when available. **Claude Code:** ```bash claude mcp add dome -- dome mcp serve ``` **Cursor** — project or user MCP config: ```json { "mcpServers": { "dome": { "command": "dome", "args": ["mcp", "serve"] } } } ``` **Claude Desktop** — `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS: ```json { "mcpServers": { "dome": { "command": "dome", "args": ["mcp", "serve"] } } } ``` **Codex:** ```bash codex mcp add dome -- dome mcp serve ``` Or write `~/.codex/config.toml` (TOML, not JSON): ```toml [mcp_servers.dome] command = "dome" args = ["mcp", "serve"] ``` **Other MCP clients:** start `dome mcp serve` on stdio and point the client at it. Codex is not this case — it uses `config.toml`, not a JSON `mcpServers` block. After writing config, stop. Tell the user to reload or restart the client if needed, then wait until they confirm Dome tools are visible. ### 5\. Verify the connection [#5-verify-the-connection] Once the user confirms tools are live, run a cheap round-trip: * Call `dome_context_current` (or ask "What workspace am I in?") * Call `dome_agents_list` (or ask "List the available agents") If tools are missing, check `dome context current` and explain that RBAC hides tools the role cannot use. Link [Permissions](https://docs.domesystems.ai/concepts/platform/permissions). ### 6\. Hand off [#6-hand-off] Tell the user they can now operate Dome in natural language from this chat. Offer useful first prompts, for example: * "What workspace am I in? List the available agents." * "Show the last 5 audit events." * "Simulate whether agent X can mcp:call tool Y." Point them at [Setup AI assistant](https://docs.domesystems.ai/setup-ai-assistant) for client tabs, example prompts, and machine-readable docs, and at [Govern your first agent](https://docs.domesystems.ai/tutorials/get-started/govern-your-first-agent) if they want a full governed demo next. Do not start that tutorial unless they ask. # September 8, 2026 (/changelog/09-08-2026) ## Self-serve plans and billing [#self-serve-plans-and-billing] * Choose and purchase a self-serve Pro or Team plan from Dashboard. * Add a billing contact and payment method as part of a purchase, then manage saved payment methods from Billing. * Review the price before confirming a plan or capacity change, including the amount due today and the next recurring charge. * Manage purchased workspace or user capacity from Billing. Dome warns you when you are paying for unused workspace capacity. * Compare plans with clearer limits and billing terminology, including organization-wide user limits. # September 10, 2026 (/changelog/09-10-2026) ## Dashboard and audit [#dashboard-and-audit] * Open Dashboard pages and resources from the command palette. * Read clearer audit timestamps, outcome badges, and recovery status for events with non-fatal errors. * Follow canonical URLs when navigating between resource detail tabs. # October 28, 2026 (/changelog/10-28-2026) ## MCP sign-in and sessions [#mcp-sign-in-and-sessions] * Connect Claude and other MCP clients to the hosted Dome MCP server by signing in with your Dome account instead of a platform API key. * Switch between your organizations, tenants, and workspaces in each signed-in conversation. The hosted server also answers on `/mcp`. * As an organization admin, turn MCP sign-in off for your members with `dome orgs mcp-sign-in set` or the MCP tools. * See everywhere you're signed in to Dome, including dashboard browsers, CLI installs, and MCP clients, and sign out of any session or all but your current one. * Manage sessions in Settings → Sessions, from the user menu, with `dome sessions`, or through the MCP tools. MCP sign-in now explains where new conversations start. * The dashboard no longer occasionally signs you out while your session is still valid. ## Managed agents [#managed-agents] * Managed agent runs now open with a "Run context (from Dome)" block giving the time, what started the run, its schedule, and last successful run. Preview on all plans. * Reference run variables such as `{{dome.now}}`, `{{dome.today}}`, and `{{dome.last_successful_run}}` in system prompts and trigger or Run now input, using the Insert variable menu. Preview on all plans. * Rotate the key Dome holds for a managed agent from its Security tab, `dome managed-agents rotate-runner-key`, or the MCP tools. Runs in progress keep running. Preview on all plans. * Run managed agents on any Gateway, including ones that list tools as `connection/tool`, without turning on safe tool names. Preview on all plans. * Retry a failed managed agent create: creation is now all-or-nothing and no longer leaves an unusable agent holding the name. Preview on all plans. * Filter audit events on `permission_escalation` to include managed agent creates refused for needing `rules.deploy`. Preview on all plans. ## Tools, models, and OAuth [#tools-models-and-oauth] * Add tools from more MCP servers, including GitHub, Datadog, Airtable, and Google Workspace, with OAuth settings filled in once you pick OAuth. * Leave and return to adding a tool without losing your service pick, so a REST adapter still installs as a managed connection. * Rely on OAuth connections: disconnecting removes the stored credential, tokens refresh once per lifetime, and per-user credential changes show in the tool list right away. * Pick Kimi K3.1 Pro and GPT-6.1 Terra in the model picker. GPT-4.1 nano is removed, and new Fireworks connections prefill `glm-5p3-flash`. ## Verification, rules, and plans [#verification-rules-and-plans] * Required claims on OIDC verification providers are now enforced on every data plane. Data planes that can't check them refuse act-as; upgrade them or remove the claims. * Register agents as a workspace developer in workspaces that require act-as. An agent's own act-as setting no longer changes with the workspace requirement. * See a Retry on the workspace Verification tab when its settings can't load, instead of defaults you could save. * Use rules page toolbar buttons such as Simulate and Add rule without overlap, including on narrow screens. Gateways now follows Callers in the sidebar. * See directory sync (SCIM) marked Coming soon for Team and Enterprise on the Plans page and in CLI and MCP plan listings. The seat limit row is labeled Users again. # October 30, 2026 (/changelog/10-30-2026) ## Identity provider claims and act-as [#identity-provider-claims-and-act-as] * Use the groups and roles in end-user tokens in rules; Cognito, Keycloak, and Zitadel work without setup. Map other claims with `--oidc-claim-map` or Custom claim mappings. * Expect rules that check groups to refuse a user whose groups the identity provider leaves out of the token, instead of treating them as having none. * Act-as verification now accepts valid end-user tokens after your identity provider rotates its signing key under the same key id, recovering on a following request. ## Tool and model connections [#tool-and-model-connections] * Set the cloud identity an Amazon Bedrock or Google Vertex workload identity connection expects in its Expected identity field. The gateway refuses model calls running as any other identity. * Look up the redirect URI for your own OAuth client with `dome tools oauth-redirect-uri` or `dome models oauth-redirect-uri` in CLI v1.5.0, or the `dome_oauth_redirect_uri` MCP tool. * The Redirect URI shown when you bring your own OAuth client is now Dome's actual callback address, so your authorization server accepts the sign-in. * Request the `mcp` scope that gateways advertise on the `client_credentials` grant and receive a token instead of a refusal. ## Dashboard and triggers [#dashboard-and-triggers] * Show managed agent names instead of ids: trigger targets now include the agent's current name when you read a trigger. In preview on all plans. * Work in settings detail panels at full width; the section navigation hides while a panel is open and returns when you close it. * Scroll dashboard pages without the header shaking; it now scrolls away with the content until only its compact bar remains. ## Escalations [#escalations] * Define Escalations in a workspace, a trigger plus the workflow steps that run when it fires, available as a preview on all plans. * Create, edit, and delete Escalations in Dashboard with a graphical workflow editor and JSON view, or with `dome escalations`, the Dome MCP server, and the API. * Review each Escalation's version history and roll back with `dome escalations rollback --to-version`. Every config change deploys a new version. * Include Escalations when you import and export a workspace. * Let Escalations decide gateway calls: when an escalate rule matches, any deny or pending escalation denies the call, and only all-allow permits it. * Identify calls an Escalation decided by the `escalation_denied` or `escalation_pending` denial reason. * Approve or deny the judgments an Escalation's Judgment step waits on with `dome escalations judgments resolve --verdict approve|deny`, the MCP tools, or the API. Verdicts are final. * Control access with the `escalations.view`, `escalations.manage`, and `escalations.resolve` permissions. Admins and operators hold `escalations.resolve` by default. ## Managed-agent webhook triggers [#managed-agent-webhook-triggers] * Rely on managed-agent webhook triggers to act on each delivery once. Repeats of a `webhook-id` accepted in the last 24 hours start no new run. Preview on all plans. * Follow the updated signing instructions in the dashboard, CLI, and MCP server and use a fresh `webhook-id` for every distinct message. Preview on all plans. ## Gateways and identity providers [#gateways-and-identity-providers] * Check whether your latest rules have reached a gateway: `GET /admin/status` now reports your workspace's rules version, empty until applied, and connection health. * See the identity-provider claims Dome reads groups and roles from automatically in the OIDC verification provider form's System-managed mappings section. * See which system-managed mappings your own groups or roles mapping replaces, including the standard `groups` or `roles` claim. # November 4, 2026 (/changelog/11-04-2026) ## Guards and rules [#guards-and-rules] * Bind Guards to an agent or a gateway with `dome agents guards` or `dome gateways guards`. Connection Guards run first, then gateway, then agent, each at most once per request. * Grant Rules: Deploy as well as Config: Manage to change verification providers or a scope's default or required providers. Built-in roles are unaffected. * Replace a verification provider's HMAC secret with `dome verification-providers update --hmac-secret`. Assertions signed with the old secret stop verifying right away. * See a warning when validating or deploying rules that match a tool by connection name in `resource.name`, with the `resource.connection_name` form to use instead. ## Gateways and connections [#gateways-and-connections] * Google-backed tool connections, such as Google Calendar, now keep working after the first hour. People see Google's consent screen each time they connect an account. * List and retrieve models through a Dome gateway with the Anthropic SDK's `models.list()` and `models.retrieve()`. OpenAI clients can now retrieve a single model too. * Revoking, suspending, or deleting an agent now takes effect on every gateway instance faster. * Checking or syncing an MCP server whose URL points to a private or internal address now fails with a clear message, and connection errors read more simply. ## Usage, import and export, and managed agents [#usage-import-and-export-and-managed-agents] * View caller usage grouped by model provider and tool connection, with group totals and Dome charges per model and per agent. Tools and models show logos throughout Dashboard. * Export and import disabled triggers, paused audit streams, inactive webhooks, disabled quotas, model-pool members, and scheduled jobs, and they stay disabled. * Import workspace, tenant, and organization settings exactly as exported, and import scheduled jobs with a `time_of_day` anchor, with offsets such as `09:00+02` honored. * Browse managed-agent lists in pages ordered by name, in preview on all plans. `dome managed-agents list` still prints every agent. * The trigger page, in preview on all plans, now shows a target as off after you switch it off from the agent's page. # November 5, 2026 (/changelog/11-05-2026) ## Model connections and integrations [#model-connections-and-integrations] * See what depends on a model connection or pool, including managed agents, granted agents, gateways, and pools, with `dome models usage` or `dome models pool usage` in CLI v1.7.0. * Move dependent agents to another model connection or pool as part of a delete with `--reassign-to` on `dome models rm` or `dome models pool rm`, or delete without moving them. * Rename a model connection or pool and the managed agents that run on it now stay pointed at the new name. * See each integration's last observed connection status, such as Connected, Invalid credentials, or Unreachable, on its page, the catalog, and the audit overview and Export menu. * Check connection status in the STATUS column of `dome integrations list`, which replaces CONNECTED. Dome re-checks credentials in the background after you connect or edit an integration. * Resume a scheduled audit export that stopped after failing for 72 hours or losing its destination. The export dialog says why it stopped. ## Verification providers and sign-in [#verification-providers-and-sign-in] * Require your Google Workspace domain as the `hd` claim on Google verification providers. Existing ones without `hd` stop verifying and show Inactive: needs hd until you add it. * Point an agent's act-as settings at a verification provider that requires `hd` instead of Google's issuer. Add the claim with `--oidc-required-claim hd=`. * Deleting an act-as verification provider now works however many agents use it. Pinned agents and defaulting workspaces, tenants, and organizations move to their next default. * Stay signed in on your first browser or computer when you sign in on another; each device keeps its own session. * Run `dome auth login` again without leaving the previous session active; it now signs out the login it replaces on the same machine. * The Dome MCP server now refuses a malformed value for an optional setting instead of silently clearing it, and passing `null` leaves a setting unchanged. ## Organizations and SSO [#organizations-and-sso] * Organizations Dome sets up for you now start with auto-join off for their email domain. Invite people, or turn it on under Single Sign-On → Domains. * Renaming your organization now also updates the name in the single sign-on setup portal and on sign-in screens. On Team and Enterprise plans. * See when the Single Sign-On page's domain list comes from a recent rather than fresh identity provider check, and check again. On Team and Enterprise plans. * Find an audit log entry each time Dome links one of your domains to your identity provider's record of it. On Team and Enterprise plans. * Organization exports now work on every plan, including organizations without custom SSO. ## Triggers [#triggers] * Read trigger lists in pages so they stay fast in workspaces with many triggers; `dome triggers list` still prints every trigger. Preview on all plans. * Update older Dome CLI, MCP server, and dashboard versions, which are refused once a workspace holds more than 500 triggers. Preview on all plans. # Changelog (/changelog) Explore the latest features, improvements, and fixes available across Dome. # CLI Overview (/cli) The `dome` CLI is the primary command-line interface for the Dome Platform. ## Installation [#installation] ```bash title="macOS (Homebrew)" brew trust dome-systems/tap brew install dome-systems/tap/dome ``` Homebrew 6 requires the `brew trust` line before it loads a third-party tap's formulae. Refer to [Install](/install) for the full walkthrough, including a direct-download alternative. ## Global flags [#global-flags] All commands support these flags: | Flag | Type | Description | | ------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--context` | string | Use a specific context (overrides active context) | | `--server` | string | Target a different Dome Platform host. Resolves a [context](/cli/session/context) for that host (credential and scope), not just the URL. | | `--activity` | string | Stable activity ID this run asserts. Every Connect RPC carries `X-Dome-Activity-Id` so audit events from the run share one [activity chain](/operate/audit#list-activity-chains). Overrides `DOME_ACTIVITY_ID`. | | `--format` | string | Output format: `text`, `json`, or `quiet` | | `--json` | bool | Output as JSON | | `--quiet` | bool | Minimal output (IDs only) | | `--no-color` | bool | Disable colored output | `--server` does not send the active context's token to a new host. Exactly one stored context for that host is adopted. Several matching contexts is an error that names the candidates — pick one with `--context`. None falls back to the stored session for that host with the previous workspace cleared. Auth and context commands are exempt, so `dome auth login --server` still works before any context exists. Naming the same host the active context already uses is a no-op. ## Environment variables [#environment-variables] | Variable | Description | | ------------------ | --------------------------------------------------------------- | | `DOME_API_KEY` | Sets the active context's token. Useful for CI and scripts. | | `DOME_ACTIVITY_ID` | Default activity ID for the process. `--activity` overrides it. | ## Command groups [#command-groups] ### Build [#build] | Command | Description | | --------------------------------------------- | --------------------------------------------------------------- | | [`agents`](/cli/build/agents) | Manage agent registrations, lifecycle, and API keys | | [`managed-agents`](/cli/build/managed-agents) | Create, configure, and run agents that Dome hosts | | [`gateways`](/cli/build/gateway) | Manage gateways, membership, and agent access | | [`triggers`](/cli/build/triggers) | Schedule managed-agent runs and start them from signed webhooks | ### Connect [#connect] | Command | Description | | --------------------------------------------------------------- | ------------------------------------------------------------------ | | [`callers`](/cli/connect/callers) | Inspect and erase verified end users projected from audit activity | | [`verification-providers`](/cli/connect/verification-providers) | Manage the OIDC and HMAC providers that verify end-user identity | | [`tools`](/cli/connect/tools) | Manage MCP server connections the gateway proxies | | [`models`](/cli/connect/models) | Manage LLM model connections and routing pools | ### Govern [#govern] | Command | Description | | ---------------------------------------- | ----------------------------------------------------------------------------------------- | | [`rules`](/cli/govern/rules) | Deploy, validate, simulate, and rollback authorization rules | | [`guards`](/cli/govern/guards) | Create and assign content filters and tool validators | | [`escalations`](/cli/govern/escalations) | Create review workflows for selected authorization decisions | | [`quotas`](/cli/govern/quota) | Cap spend, tokens, or calls for workspace, agent, pool, model, gateway, and tool subjects | ### Operate [#operate] | Command | Description | | ------------------------------------------- | ------------------------------------------------------------------------ | | [`audit`](/cli/operate/audit) | Query, stream, and export audit events | | [`integrations`](/cli/operate/integrations) | List integrations connected to the active workspace | | [`webhooks`](/cli/operate/webhooks) | Manage webhook subscriptions, delivery history, and the provider catalog | | [`usage`](/cli/operate/usage) | Show LLM token usage and estimated cost for the active workspace | | [`usage-caps`](/cli/operate/usage-caps) | Show free-tier monthly allowances for the active workspace | ### Manage [#manage] | Command | Description | | ---------------------------------------------- | ---------------------------------------------------------------- | | [`config`](/cli/settings/config) | Platform configuration | | [`import`](/cli/manage/import) | Plan and apply reviewed configuration to the active target scope | | [`export`](/cli/manage/export) | Write reviewed configuration from the active source scope | | [`platform-keys`](/cli/settings/platform-keys) | Manage platform API keys | | [`tenants`](/cli/settings/tenants) | List, inspect, and create tenants | | [`tenant`](/cli/settings/tenant) | Manage tenant-level Act-As provider selection | | [`orgs`](/cli/settings/org) | Manage organization-level Act-As provider selection | | [`workspaces`](/cli/settings/workspace) | Manage workspaces, members, Act-As, and verification providers | | [`billing`](/cli/manage/billing) | Manage organization plans, seats, invoices, and payment methods | ### Developer [#developer] | Command | Description | | --------------------------------------------- | ----------------------------------- | | [`quickstart`](/cli/developer/quickstart-cmd) | Scaffold a new Dome-enabled project | ### Session [#session] | Command | Description | | --------------------------------- | --------------------------------------------------- | | [`auth`](/cli/session/auth) | Authentication management | | [`context`](/cli/session/context) | Manage CLI contexts (org/tenant/workspace sessions) | ### Standalone [#standalone] | Command | Description | | ------------------------------------ | ------------------------ | | [`mcp`](/cli/standalone/mcp) | MCP server for AI agents | | [`version`](/cli/standalone/version) | Show CLI version | ## Next steps [#next-steps] Authenticate first, then scaffold — or drive the same jobs from MCP: * [Install](/install) to authenticate and select a workspace * [Quickstart](/quickstart) to scaffold and verify governed traffic * [MCP](/reference/mcp) when you prefer tool-based access from an assistant * [API](/api) for the management and data-plane HTTP surfaces # Build (/build) **Build** defines the runtime surface in Dome. An agent is the identity that Dome authenticates and audits. A [gateway](/build/gateways) is the governed endpoint that admits that agent and exposes the tools and models it can call. ## What you build [#what-you-build] * [Agents](/build/agents): Register agents and manage their identity, lifecycle, and credentials. * [Managed agents](/build/agents/managed): Configure agents that Dome runs for you. * [Gateways](/build/gateways): Create the governed runtime endpoint that admits agents and exposes connected tools and models. * [Triggers](/build/triggers): Start managed agents manually, on a schedule, or from signed webhooks. External and managed agents use the same agent identity, gateway grants, rules, lifecycle, and audit trail. Choose between them based on where the worker runs: an external agent runs in your own runtime, while Dome runs a managed agent. Use [triggers](/build/triggers) to start managed agents manually, on a schedule, or from signed webhooks. The gateway connects this runtime surface to the resources in [Connect](/connect). It lets an admitted agent reach the tools and models you expose without holding their upstream credentials. [rules](/reference/glossary#rule), [guards](/reference/glossary#guard), and [quotas](/reference/glossary#quota) still determine what each request can do after admission. ## Typical workflow [#typical-workflow] 1. Configure the [tools](/connect/tools), [models](/connect/models), and [pools](/connect/pools) that agents need to reach. 2. Create a [gateway](/build/gateways) that exposes those resources. 3. Register an [external agent](/build/agents/external), or create a [managed agent](/build/agents/managed) for a worker Dome runs. 4. Add [triggers](/build/triggers) when a managed agent should start on a schedule or from a signed webhook. 5. Continue to [Govern](/govern) to define what admitted agents may do. ## Next steps [#next-steps] * [Connect](/connect) to configure callers, tools, models, and pools. * [Govern](/govern) to authorize actions, inspect content, and cap spend. * [Operate](/operate) to investigate audit events, stream live activity, and subscribe external systems. * [Develop](/develop) to send credentials and gateway endpoints from your application. # Triggers (/build/triggers) Use triggers to decide when managed agents run. A trigger is a workspace resource that can start one or more managed agent runs manually, on a schedule, or from a signed webhook. ## Requirements [#requirements] Before you begin: * Ask an organization owner or administrator to [enable public preview](/manage/public-preview) for the organization. * Create a [managed agent](/build/agents/managed) and run it manually before automating it. * Authenticate the Dome CLI and select a workspace. Trigger operations require the `managedagents.manage` permission. Firing a trigger also requires `managedagents.invoke`. ## Create schedule [#create-schedule] Create a schedule trigger after the managed agent succeeds in a manual run. A schedule belongs to the trigger, not to the agent. > **Note**: Requires `managedagents.manage`. **CLI** ```bash dome triggers create \ --name nightly-triage \ --kind schedule \ --cron "0 2 * * *" \ --timezone America/Los_Angeles \ --input "Triage issues filed since the previous run." \ --target nightly-triage \ --max-concurrent 1 ``` > **Note**: Reference: [`dome triggers create`](/cli/build/triggers#create-trigger) **MCP** Tool: `dome_triggers_create` ```json { "name": "nightly-triage", "kind": "schedule", "cron": "0 2 * * *", "timezone": "America/Los_Angeles", "input": "Triage issues filed since the previous run.", "targets": ["nightly-triage"], "max_concurrent_runs": 1 } ``` > **Note**: Reference: [`dome_triggers_create`](/reference/mcp/triggers) **API** ```http POST /v1/triggers Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "name": "nightly-triage", "kind": "schedule", "config": { "cron": "0 2 * * *", "timezone": "America/Los_Angeles" }, "input": "Triage issues filed since the previous run.", "max_concurrent_runs": 1, "targets": [{ "kind": "managed_agent", "id": "{{AGENT_ID}}", "enabled": true }] } ``` > **Note**: Reference: [`CreateTrigger`](/api/tag/triggers/create-trigger) **Agent** ```text title="Schedule a managed agent" Create a schedule named "nightly-triage" that runs the "nightly-triage" managed agent at 2:00 AM every day in America/Los_Angeles. ``` The cron expression follows the selected timezone's wall clock, including daylight-saving changes. Omit `--timezone` to use UTC. Schedules have a five-minute minimum interval. Use `--catch-up once|all|skip` to control occurrences missed while the scheduler cannot queue work. Use `--catch-up-deadline` to set how late a missed occurrence may run. Use `--max-retries` to control retries after infrastructure failures. `--max-concurrent` limits concurrent runs across every target on the trigger. Runs over that limit remain pending until a slot is available. Use a [run quota](/govern/quotas#limit-managed-agent-runs) when you also need a fixed daily or monthly limit on how many runs the trigger queues. A run quota refuses a run before it enters the queue; it does not replace `--max-concurrent`. ## Create signed webhook [#create-signed-webhook] Create a webhook trigger when another system should start a managed agent run. > **Note**: Requires `managedagents.manage`. **CLI** ```bash dome triggers create \ --name github-issue-triage \ --kind webhook \ --target nightly-triage ``` > **Note**: Reference: [`dome triggers create`](/cli/build/triggers#create-trigger) **MCP** Tool: `dome_triggers_create` ```json { "name": "github-issue-triage", "kind": "webhook", "targets": ["nightly-triage"] } ``` > **Note**: Reference: [`dome_triggers_create`](/reference/mcp/triggers) **API** ```http POST /v1/triggers Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "name": "github-issue-triage", "kind": "webhook", "targets": [{ "kind": "managed_agent", "id": "{{AGENT_ID}}", "enabled": true }] } ``` > **Note**: Reference: [`CreateTrigger`](/api/tag/triggers/create-trigger) **Agent** ```text title="Create a webhook trigger" Create a signed webhook trigger named "github-issue-triage" that starts the "nightly-triage" managed agent. ``` The response contains the endpoint URL and signing secret. Store the secret immediately: Dome shows it once and never returns it again. Sign every request with Standard Webhooks v1 using `webhook-id`, `webhook-timestamp`, and `webhook-signature` headers. Use a fresh `webhook-id` for every distinct message. Reuse that ID only when retrying the same delivery: Dome accepts repeated IDs for 24 hours but starts no additional run. Webhook request bodies become the first user message for the run. A webhook trigger has unlimited concurrency by default; set `--max-concurrent` when downstream capacity needs a limit. ## Fire a trigger [#fire-a-trigger] Start a run for every enabled target. Add `--input` to override the trigger's configured input for this fire. **CLI** ```bash dome triggers fire nightly-triage \ --input "Triage issues filed since the previous run." ``` > **Note**: Reference: [`dome triggers fire`](/cli/build/triggers#fire-trigger) **MCP** Tool: `dome_triggers_fire` ```json { "trigger_id": "{{TRIGGER_ID}}", "input": "Triage issues filed since the previous run." } ``` > **Note**: Reference: [`dome_triggers_fire`](/reference/mcp/triggers) **API** ```http POST /v1/triggers/{{TRIGGER_ID}}/fire Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "input": "Triage issues filed since the previous run." } ``` > **Note**: Reference: [`FireTrigger`](/api/tag/triggers/fire-trigger) **Agent** ```text title="Fire a trigger" Fire the "nightly-triage" trigger with this input: "Triage issues filed since the previous run." ``` ## Pause a trigger [#pause-a-trigger] Pause every target on a trigger without deleting its configuration. Use `--enabled` to resume the trigger. **CLI** ```bash dome triggers update nightly-triage --disabled ``` > **Note**: Reference: [`dome triggers update`](/cli/build/triggers#update-trigger) **MCP** Tool: `dome_triggers_update` ```json { "trigger_id": "{{TRIGGER_ID}}", "enabled": false } ``` > **Note**: Reference: [`dome_triggers_update`](/reference/mcp/triggers) **API** ```http PATCH /v1/triggers/{{TRIGGER_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "enabled": false } ``` > **Note**: Reference: [`UpdateTrigger`](/api/tag/triggers/update-trigger) **Agent** ```text title="Pause a trigger" Pause the "nightly-triage" trigger. ``` ## Disable a target [#disable-a-target] Disable one target when other targets on the same trigger should continue to run. The target stays attached to the trigger. **CLI** ```bash dome triggers targets disable nightly-triage nightly-triage ``` Use `dome triggers targets enable nightly-triage nightly-triage` to enable it again. > **Note**: Reference: [`dome triggers targets disable`](/cli/build/triggers#disable-target) **MCP** Tool: `dome_triggers_target_set_enabled` ```json { "trigger": "nightly-triage", "target": "nightly-triage", "enabled": false } ``` > **Note**: Reference: [`dome_triggers_target_set_enabled`](/reference/mcp/triggers) **API** ```http PATCH /v1/triggers/{{TRIGGER_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "targets": [ { "kind": "managed_agent", "id": "{{AGENT_ID}}", "enabled": false } ] } ``` The API replaces the target list. Include every target you want to retain. > **Note**: Reference: [`UpdateTrigger`](/api/tag/triggers/update-trigger) **Agent** ```text title="Disable a trigger target" Disable the "nightly-triage" managed agent target on the "nightly-triage" trigger. ``` ## Inspect trigger runs [#inspect-trigger-runs] Inspect the runs a trigger started. **CLI** ```bash dome triggers runs nightly-triage --limit 50 ``` > **Note**: Reference: [`dome triggers runs`](/cli/build/triggers#list-trigger-runs) **MCP** Tool: `dome_triggers_runs` ```json { "trigger_id": "{{TRIGGER_ID}}", "limit": 50 } ``` > **Note**: Reference: [`dome_triggers_runs`](/reference/mcp/triggers) **API** ```http GET /v1/triggers/{{TRIGGER_ID}}/runs?workspaceId={{WORKSPACE_ID}}&limit=50 ``` > **Note**: Reference: [`ListTriggerRuns`](/api/tag/triggers/list-trigger-runs) **Agent** ```text title="Inspect trigger runs" List the 50 most recent runs started by the "nightly-triage" trigger. ``` A changed schedule, paused trigger, removed target, or suspended agent can cancel a pending schedule run. ## Next steps [#next-steps] * [Configure managed agents](/build/agents/managed) to change the worker that a trigger starts. * [Inspect audit events](/operate/audit) to investigate managed agent activity. # Identity patterns (/concepts/identity-patterns)

{identityPatterns}

## Three human identity paths [#three-human-identity-paths] Keep these paths separate. They authenticate different actors and produce different credentials. | Path | Human signs in to | Identity used at runtime | | --------------------- | --------------------- | -------------------------------------------------------------------------------- | | **Platform-user SSO** | Dome Dashboard or CLI | A platform session for administering Dome | | **Delegated Act-As** | Your application | The application carries `X-Dome-Act-As` beside its agent credential | | **Interactive OAuth** | A human MCP client | A short-lived token lets the human ride one designated agent through one gateway | Enterprise SSO controls who can administer Dome. It does not configure an agent's Act-As provider or grant an MCP client runtime access. Delegated Act-As and interactive OAuth both create human-attributed traffic. The difference is who starts the flow: your application carries delegated identity, while an MCP client starts interactive OAuth and obtains its own short-lived gateway token. ## Standing and delegated authorization [#standing-and-delegated-authorization] Dome supports two runtime authorization models: * **Standing identity** means the agent is the principal: it acts as itself and authorizes on its own grants. * **Delegated identity** means the agent still authenticates as itself, but every governed call also carries a human and authorization reads that human's claims. The diagram and table below compare how each model reaches a tool or model through the gateway. Standing identity authorizes on the agent. Delegated identity carries an act-as assertion and authorizes on the human | | Standing identity | Delegated identity | | ----------------------- | ------------------------- | ----------------------------------------------------------------- | | **The agent** | Acts as itself | Acts for a human ([Delegated agents](/build/agents/delegated)) | | **Authorization reads** | The agent's own grants | The human's roles (`principal.act_as`) | | **Credential** | agent Bearer JWT | agent Bearer JWT + `X-Dome-Act-As`, or an interactive OAuth token | | **Audit answers** | "What can this agent do?" | "What did this agent do, and for whom?" | | **Choose when** | The agent does a job | The agent acts on someone's behalf | The choice is independent of agent type and of how the agent attaches to a gateway. External and managed agents can both use standing or delegated identity, with the same Registry, Cedar, gateway, and audit primitives. ### Standing identity [#standing-identity] Give an agent standing identity when it does a job. A revenue analyzer reading customer data needs the same permissions regardless of which analyst triggers it. The agent is itself, acts as itself, and its permissions are its own: a governed service account. ### Delegated identity [#delegated-identity] Give an agent delegated identity when it acts for a person. Your application can carry `X-Dome-Act-As`, or an interactive MCP client can ride a designated agent. Authorization evaluates against the resulting human context. This unlocks something standing identity cannot express: the same agent, calling the same tool on the same record, allowed for one person and denied for another. Authorization reads the human on the token, so your rules can encode conflicts of interest or need-to-know: ```cedar title="information-barrier.cedar" // A person screened from a deal cannot open its records, whichever agent acts for them. forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) when { principal has act_as && principal.act_as.roles.contains("barrier_screened") && resource.name like "*open_deal*" }; ``` The audit trail then names the human. That is often the reason the workflow could be automated at all. > **Tip**: If the agent does a job, give it standing identity. If it acts for someone, have it borrow theirs. A fat standing identity on an acting-for-someone agent cannot be reconstructed into who it was really for. ## Common examples [#common-examples] These two shapes show how standing and delegated identity usually look when you run many agents on one platform. ### Self-service agent platform [#self-service-agent-platform] A self-service agent platform is a common example of **standing identity**. Any team declares an agent (instructions plus a tool list), and your platform builds, governs, and runs it. Governance is automatic and invisible to the author. Standing identity fits because the agent does a job, not a person's job. Permissions come from the declared tools, not from who triggered the run. Behind the manifest, your platform [registers the external agent](/build/agents/external#register-agent), compiles those tools into a least-privilege [rule bundle](/govern/rules), admits it to a [Gateway](/concepts/gateways), and runs it. The author never writes a policy or holds a credential. Each agent is a service account whose permissions are exactly its declared tools. Audit answers "What can this agent do?" ### Purpose-built agent service [#purpose-built-agent-service] A purpose-built agent service is a common example of **delegated identity**. Engineers build one high-stakes workflow so domain rules are exact, and the agent acts for a specific person. Delegated identity fits because authorization must follow the human, not a shared service account. A generic least-privilege grant from a manifest cannot express conflicts of interest or need-to-know. Authored policy reads the human's roles on `principal.act_as` instead: * **Finance:** an adviser agent that may act for one client's book but is walled off from a deal it is screened from. * **Healthcare:** a case agent held to minimum-necessary access: the records of patients in its care team, decided by the clinician it acts for. * **Multi-tenant SaaS:** a support agent scoped to one customer's data boundary, where the tenant is a property of the human on the token, not a parameter the model can change. Because identity is delegated, the audit trail names the human. Audit answers "What did this agent do, and for whom?" ## Next steps [#next-steps] With standing vs delegated identity in mind, continue with: * [Agent Identity](/concepts/agents/identity) concept for how agents authenticate and carry act-as context * [Delegated agents](/build/agents/delegated) to configure verification so agents can act for a verified person * [Authorization Model](/concepts/architecture/authorization-model) concept for Cedar entities, permit and forbid semantics, and rule evaluation * [Rules](/govern/rules) to author, simulate, and deploy Cedar rule bundles # Core concepts (/concepts) **Core concepts** explain what each Dome piece is, how the pieces fit together, and when to choose one design over another. Dome separates **components** you define (agents, resources, gateways), **controls** you apply to traffic (rules, escalations, guards, quotas), and **audit** that records what happened. Agents reach tools and models through a gateway while Dome holds the upstream credentials. On each call, the controls decide what is allowed, what needs review, what content may pass, and how much spend is left. If you have not picked a role yet, start with [Personas](/personas) or [What is Dome?](/what-is-dome). ## Read in dependency order [#read-in-dependency-order] From the system map down to the evidence trail: 1. **[Architecture](/concepts/architecture)** covers components, controls, audit, and the request path. 2. **[Scopes](/concepts/platform/scopes)** explains organization → tenant → workspace isolation. 3. **[Identity Patterns](/concepts/identity-patterns)** compares standing vs delegated identity. 4. **[Agents](/concepts/agents)**, **[Resources](/concepts/resources)**, and **[gateways](/concepts/gateways)** are the components you define. 5. **[rules](/concepts/controls/rules)**, **[escalations](/concepts/controls/escalations)**, **[guards](/concepts/controls/guards)**, and **[quotas](/concepts/controls/quotas)** are the controls that govern traffic. 6. **[Audit events](/concepts/audit)** is the evidence trail across both planes. ## Architecture [#architecture] The system map and request path. * [Architecture](/concepts/architecture): How agents, resources, gateways, controls, and audit relate. * [Authorization model](/concepts/architecture/authorization-model): Cedar permit and forbid, effective policy, and fail-closed evaluation. * [Data plane](/concepts/architecture/dataplane): The hot-path runtime that enforces configuration synced from Dome. ## Identity [#identity] Choose how an agent presents itself before you wire credentials. * [Identity patterns](/concepts/identity-patterns): Standing identity versus delegated identity (act-as) at design time. * [Agent identity](/concepts/agents/identity): API keys, session tokens, and verified end-user claims on the wire. ## Components [#components] Things you define so a workload can reach tools and models. * [Agents](/concepts/agents): The principals for authentication, authorization, and audit. * [Agent lifecycle](/concepts/agents/agent-lifecycle): The states an agent moves through, and what each state permits. * [Resources](/concepts/resources): Tools, models, and pools. Dome stores the upstream credentials; agents never hold them. * [Gateways](/concepts/gateways): Membership and agent grants behind one URL. * [Tools gateway](/concepts/gateways/tools-gateway): The MCP ingress on that URL, not a separate gateway type. * [LLM gateway](/concepts/gateways/llm-gateway): The model ingress on that URL, not a separate gateway type. ## Controls [#controls] Things you apply after a call is admitted. * [Rules](/concepts/controls/rules): Scoped Cedar bundles that authorize what an agent may do. * [Escalations](/concepts/controls/escalations): Review selected authorization decisions before a request proceeds. * [Guards](/concepts/controls/guards): Content inspection on request and response paths. * [Quotas](/concepts/controls/quotas): Spend caps over a window, including pool spillover. ## Platform and audit [#platform-and-audit] Tenancy boundaries, who may administer Dome, and the evidence left behind. * [Scopes](/concepts/platform/scopes): The organization, tenant, and workspace hierarchy. * [Permissions](/concepts/platform/permissions): Platform RBAC for people and API clients, separate from Cedar for agents. * [Audit events](/concepts/audit): One trail across configuration changes and runtime decisions. * [Webhooks](/concepts/audit/webhooks): Signed copies of selected events delivered to your endpoints. ## Next steps [#next-steps] * [Connect](/connect): Register agents, attach resources, and grant gateway access. * [Govern](/govern): Write rules, configure escalations, assign guards, and set quotas. * [Operate](/operate): Investigate audit events, stream live activity, and subscribe to webhooks. * [Develop](/develop): Send credentials, gateway URLs, and Act-As claims from the application. # Integrations (/concepts/integrations) Connect providers and services to route governed agent traffic, authenticate platform users, and deliver audit evidence. Choose the integration surface that matches the system you are connecting. ## Models [#models] Connect LLM providers to a gateway, then control access through rules and quotas. Native providers include OpenAI, Anthropic, Google, Azure OpenAI, and Amazon Bedrock; OpenAI-compatible and custom endpoints are also supported. [Connect a model provider](/connect/models) to add a model connection, configure credentials, and attach it to a gateway. ## Tools [#tools] Connect remote MCP servers, local stdio processes, or Dome-managed REST adapters. Store a shared credential or authorize each verified end user independently. [Connect a tool](/connect/tools) to add a tool connection, manage its discovered catalog, and attach it to a gateway. ### Pre-approved native MCP servers [#pre-approved-native-mcp-servers] The following official vendor-hosted MCP servers are pre-approved and seeded into the catalog. They configure a Streamable HTTP MCP connection. You provide the authorization your provider requires. | Category | Services | | ---------------------------------------- | ----------------------------------------------------------------------------------- | | CRM, sales, and support | HubSpot, Intercom, Klaviyo, Adobe Marketo Engage, Mailchimp Transactional | | Collaboration, productivity, and storage | Slack, Asana, ClickUp, Calendly, Box, Dropbox, Gmail, Google Drive, Google Calendar | | Project management | Shortcut, Wrike, Smartsheet | | Design and creative | Canva, Adobe Creative | | Payments and finance | Plaid, Brex, Ramp, Mercury | | Cloud and infrastructure | AWS Knowledge, Azure DevOps, Netlify, DigitalOcean | | Observability and developer quality | Datadog, Sentry, PagerDuty, SonarQube Cloud, Buildkite | | Databases and backend | Supabase, Neon | Use **Custom MCP server** for any compatible endpoint not in the catalog. ## Identity providers [#identity-providers] Enterprise SSO connects your existing identity provider to the Dome Dashboard and CLI. Use guided setup for Okta, Microsoft Entra ID, Google, Auth0 and more. Otherwise, you can configure a custom SAML 2.0 or OpenID Connect connection. [Configure identity providers](/operate/integrations#identity-providers) to set up organization single sign-on, verified domains, and provider enforcement. ## Audit destinations [#audit-destinations] Connect Datadog, Grafana Loki, Amazon S3, or Google Cloud Storage to export or stream audit evidence. These destinations are separate from agent-facing gateway connections. [Configure audit destinations](/operate/integrations#supported-integrations) to review each supported destination and configure it from the dashboard. # Callers (/connect/callers)

{caller}

## Overview [#overview] An agent is the workload. A caller is the person that workload acts for. Callers are the human side of [delegated agents](/build/agents/delegated): your application sends the person's identity in `X-Dome-Act-As`, Dome verifies it against a verification provider, and rules, quotas, egress, and audit read the verified claims. This page covers both halves of that entity: * **Verification.** Create the OIDC and HMAC providers that prove who a caller is, and set the workspace floor that decides whether verified identity is required and which methods are allowed. * **The registry.** Inspect the callers Dome has actually observed, and erase a projected record when a person must be forgotten. Callers are projected from audit evidence, so a caller appears only after Dome accepts delegated traffic carrying a verified identity. Nothing here creates a caller by hand. Interactive OAuth users are not added to the registry. Their identity and revocable access belong to the interactive grant that lets a person ride an agent through an MCP client. Refer to [Identity Patterns](/concepts/identity-patterns). ### Provider hierarchy [#provider-hierarchy] Verification providers can belong to an organization, tenant, or workspace. A workspace can see its own providers plus providers inherited from its tenant and organization. Dome resolves one effective provider for each non-bound agent: 1. A **required provider** pins the method and provider and forces Act-As on. The broadest configured scope wins: organization, then tenant, then workspace. 2. Otherwise, an agent's explicit provider reference wins. 3. Otherwise, the agent's inline OIDC or HMAC material wins. 4. Otherwise, a **default provider** supplies missing material. The nearest configured scope wins: workspace, then tenant, then organization. A nearest default with the wrong method fails closed. Dome does not fall through to a farther provider. Bound agents bypass this hierarchy because enrollment already established their identity. Use required providers for enforceable baselines. Use defaults to reduce repeated configuration without overriding an explicit agent choice. ## Requirements [#requirements] Before you begin, authenticate to Dome and select a workspace. ### Permissions [#permissions] | Default roles | Permission | Grants | | -------------------------------------------- | ------------------------- | ---------------------------------------------------------------------------- | | `admin`, `operator` | Workspace `config.manage` | Manage workspace providers, workspace Act-As enforcement, and caller erasure | | Tenant `admin`, `operator` | Tenant `config.manage` | Read tenant providers and set tenant default or required providers | | Org `owner`, `admin` | Org `config.manage` | Read org providers and set org default or required providers | | `admin`, `operator`, `security`, `developer` | `audit.view` | Read the Callers registry | Per-agent Act-As configuration uses agent register permissions instead. Refer to [External agents](/build/agents/external#change-end-user-identity). ## Create a verification provider [#create-a-verification-provider] Create a workspace-scoped verification provider that agents with delegated identity can share. Assign the returned provider ID when registering or updating an agent with `--actas-provider` / `actas_provider_id`. Agents can instead use an inherited provider or inline OIDC/HMAC material. The method you pick here must match what your application puts in `X-Dome-Act-As`. Refer to [Verification methods](/build/agents/delegated#verification-methods). How to send the header is on [Pass identity for delegated agents](/develop#pass-identity-for-delegated-agents). In the dashboard, open **Callers → Verification** and add a provider. > **Note**: Requires `config.manage`. ### OIDC [#oidc] Use OIDC when end users sign in through an IdP and your application sends their JWT as `X-Dome-Act-As`. **CLI** ```bash dome workspaces verification-providers create \ --name workforce-oidc \ --method oidc \ --oidc-discovery-url https://auth.example.com \ --oidc-expected-audience {{YOUR_APP_CLIENT_ID}} ``` > **Note**: Reference: [`dome workspaces verification-providers create`](/cli/settings/workspace#create-provider) **MCP** Tool: `dome_verification_providers_create` ```json { "name": "workforce-oidc", "method": "oidc", "oidc_discovery_url": "https://auth.example.com" } ``` > **Note**: Reference: [`dome_verification_providers_create`](/reference/mcp/verification#verification-providers-create) **API** ```http POST /v1/workspaces//verification-providers Content-Type: application/json { "name": "workforce-oidc", "method": "oidc", "oidc_discovery_url": "https://auth.example.com" } ``` > **Note**: Reference: [`CreateVerificationProvider`](/api/tag/workspaces/create-verification-provider) **Agent** ```text title="Create an OIDC verification provider" Create an OIDC verification provider named "workforce-oidc" using the issuer https://auth.example.com. ``` Dome appends `/.well-known/openid-configuration` to the issuer base URL. ### Harden OIDC verification [#harden-oidc-verification] Pin the audience, require tenant claims, and map non-standard IdP claims before accepting caller tokens. These checks prevent a token for another application or tenant from becoming a verified Act-As identity. Use the scope-aware command when you need the full OIDC configuration: ```bash dome verification-providers create \ --name workforce-oidc \ --method oidc \ --oidc-url https://auth.example.com \ --oidc-expected-audience {{YOUR_APP_CLIENT_ID}} \ --oidc-required-claim tenant_id={{YOUR_TENANT_ID}} \ --oidc-claim-map 'app_groups=groups' \ --oidc-claim-map 'app_roles=roles' ``` `--oidc-expected-audience` requires the JWT's `aud` claim to name your application. Set it to the client ID or another audience your IdP issues only for the application that sends Act-As assertions. Use `--oidc-required-claim name=value` for each exact claim that establishes the token's tenant or domain. Google issuers require `--oidc-required-claim hd={{YOUR_GOOGLE_WORKSPACE_DOMAIN}}`; without it, any Google account could satisfy the shared issuer. Use `--oidc-claim-map` when your IdP stores group, role, or custom authorization data outside Dome's built-in claim locations. The format is `CLAIM=TARGET[;type=set][;split=SEP]`: * Map to `groups` or `roles` to populate those verified attributes. A mapping replaces Dome's built-in lookup for that attribute. * Map to a custom target, such as `department`, to expose `principal.act_as.claims.department` to rules. * Add `;type=set;split=,` when one string claim contains a comma-separated set. For example: ```bash dome verification-providers update {{PROVIDER_ID}} \ --oidc-claim-map 'https://example.com/groups=groups' \ --oidc-claim-map 'teams=teams;type=set;split=,' ``` Update flags replace the complete required-claim or claim-mapping set. Include every value you want to keep. Use `--clear-oidc-required-claims` or `--clear-oidc-claim-maps` only when you intend to remove the respective checks. ### HMAC [#hmac] Use HMAC when a trusted service constructs and signs the Act-As envelope with a shared secret. **CLI** ```bash dome workspaces verification-providers create \ --name internal-signer \ --method hmac \ --hmac-secret ``` > **Note**: Reference: [`dome workspaces verification-providers create`](/cli/settings/workspace#create-provider) **MCP** Tool: `dome_verification_providers_create` ```json { "name": "internal-signer", "method": "hmac", "hmac_secret": "" } ``` > **Note**: Reference: [`dome_verification_providers_create`](/reference/mcp/verification#verification-providers-create) **API** ```http POST /v1/workspaces//verification-providers Content-Type: application/json { "name": "internal-signer", "method": "hmac", "hmac_secret": "" } ``` > **Note**: Reference: [`CreateVerificationProvider`](/api/tag/workspaces/create-verification-provider) **Agent** ```text title="Create an HMAC verification provider" Create an HMAC verification provider named "internal-signer" with my shared secret. ``` ## List verification providers [#list-verification-providers] List the verification providers in the workspace. Widen the result to the visible organization and tenant chain when selecting an inherited provider. > **Note**: Requires `config.manage`. **CLI** ```bash dome workspaces verification-providers list dome verification-providers list --include-chain ``` > **Note**: Reference: [`dome workspaces verification-providers list`](/cli/settings/workspace#list-providers) **MCP** Tool: `dome_verification_providers_list` ```json { "name": "dome_verification_providers_list", "arguments": {} } ``` > **Note**: Reference: [`dome_verification_providers_list`](/reference/mcp/verification#verification-providers-list) **API** ```http GET /v1/workspaces//verification-providers ``` > **Note**: Reference: [`ListVerificationProviders`](/api/tag/workspaces/list-verification-providers) ## Delete a verification provider [#delete-a-verification-provider] Delete a verification provider when you no longer need it. Dome clears direct references to the provider and moves affected agents and scope defaults to the next applicable default provider. > **Note**: Requires `config.manage`. > **Warning**: Review the agents and workspace, tenant, and organization defaults that use the provider before deleting it. If no applicable default remains after deletion, delegated requests that need a provider can no longer verify. **CLI** ```bash dome workspaces verification-providers delete ``` > **Note**: Reference: [`dome workspaces verification-providers delete`](/cli/settings/workspace#delete-provider) **MCP** Tool: `dome_verification_providers_delete` ```json { "provider_id": "" } ``` > **Note**: Reference: [`dome_verification_providers_delete`](/reference/mcp/verification#verification-providers-delete) **API** ```http DELETE /v1/workspaces//verification-providers/ ``` > **Note**: Reference: [`DeleteVerificationProvider`](/api/tag/workspaces/delete-verification-provider) ## Require verified identity [#require-verified-identity] Update the workspace Act-As floor so every agent must present a verified end-user identity (every agent in the workspace uses delegated identity at the edge), and optionally restrict which verification methods are allowed. When the workspace requires verified Act-As: * Every request must include a valid identity envelope. * The verification method must be allowed by the workspace. * An agent configured with `actas_method=none` is rejected. * Invalid, expired, malformed, or unverifiable identity fails closed before authorization. Agent settings can be stricter than the workspace floor, but cannot weaken it. An agent can require Act-As when the workspace does not, or narrow which verified identities it may present by group, email, or subject. Set per-agent options on [External agents](/build/agents/external#change-end-user-identity). > **Note**: Requires `config.manage`. **CLI** ```bash dome workspaces actas update --required ``` ```bash dome workspaces actas update --allowed-methods oidc,hmac ``` > **Note**: Reference: [`dome workspaces actas update`](/cli/settings/workspace#update-act-as-config) **MCP** Tool: `dome_workspaces_actas_update` ```json { "actas_required": true, "actas_allowed_methods": ["oidc", "hmac"] } ``` > **Note**: Reference: [`dome_workspaces_actas_update`](/reference/mcp/workspaces#workspace-actas-update) **API** ```http PATCH /v1/workspaces//actas Content-Type: application/json { "actas_required": true, "actas_allowed_methods": ["oidc", "hmac"] } ``` > **Note**: Reference: [`UpdateWorkspaceActAs`](/api/tag/workspaces/update-workspace-act-as) **Agent** ```text title="Require verified identity" Require verified Act-As on every request in this workspace and allow only oidc and hmac. ``` Read the current floor with `dome workspaces actas get`, `dome_workspaces_actas_get`, or [`GetWorkspaceActAs`](/api/tag/workspaces/get-workspace-act-as). Tightening allowed methods can strand agents that already use an excluded method. The dashboard's **Verification** tab previews which agents would start failing at the gateway before you save. Review the configured method with `dome agents get` first when you change the floor from the CLI, MCP, or API. ### Select default and required providers [#select-default-and-required-providers] Set provider selections independently at each scope. Update commands use full-replace semantics: an omitted selection clears that field. ```bash # Nearest default wins: workspace > tenant > organization dome workspaces actas update --default-provider {{PROVIDER_ID}} dome tenant actas update --default-provider {{PROVIDER_ID}} dome orgs actas update --default-provider {{PROVIDER_ID}} # Broadest requirement wins: organization > tenant > workspace dome orgs actas update --required-provider {{PROVIDER_ID}} ``` Tenant selections accept tenant- or org-scoped providers. Organization selections accept org-scoped providers. Workspace selections accept any provider visible in the workspace's scope chain. Provider reads are scope-aware: ```bash dome verification-providers list --scope workspace --include-chain dome verification-providers get {{PROVIDER_ID}} --scope org dome verification-providers list --scope tenant ``` CLI and MCP provider writes currently target workspace scope. The dashboard's **Callers → Verification** tab manages workspace providers and workspace policy, and shows inherited tenant and organization policy read-only. Manage organization providers from **Settings → Single Sign-On**; an active SSO connection can create a matching org-scoped OIDC provider that Act-As can reuse. Tenant provider creation is not exposed in those customer surfaces yet. ## Inspect callers [#inspect-callers] In the dashboard, open **Callers**. Search by subject or email, or filter by group, claim, or verification provider. Select a row to inspect: * identity claims and every observed verification method * first-seen and last-seen timestamps * agents, models, and tools attributed to the caller * lifetime and current-month activity Current-month sections appear only when the caller had activity during the current UTC calendar month. Lifetime totals remain available independently. > **Note**: Requires `audit.view`. You can read the same projection from the CLI or MCP: **CLI** ```bash # List callers in the active workspace dome callers list # Filter by a group and an exact claim dome callers list --group support --attribute region=us # Inspect one caller dome callers get {{CALLER_ID}} ``` Use a caller record UUID when the same subject appears under more than one verification provider. > **Note**: Reference: [`dome callers`](/cli/connect/callers) **MCP** Use `dome_callers_list` to find caller records and `dome_callers_get` to inspect one record. ```json title="Inspect one caller" { "name": "dome_callers_get", "arguments": { "caller": "{{CALLER_ID}}" } } ``` > **Note**: Reference: [Caller MCP tools](/reference/mcp/callers) ## Erase a projected caller record [#erase-a-projected-caller-record] Caller erasure is a CLI and MCP compliance operation; the dashboard does not expose a delete action. > **Note**: Requires `config.manage`. **CLI** ```bash dome callers delete {{CALLER_ID}} ``` The CLI asks for confirmation. Pass `--yes` for non-interactive use. **MCP** ```json title="Erase one caller projection" { "name": "dome_callers_delete", "arguments": { "caller": "{{CALLER_ID}}" } } ``` Erasure removes the projected identity record and its per-agent activity rows. It does not delete the underlying audit evidence. If later delegated traffic carries the same verified identity, Dome creates the projection again. ## Next steps [#next-steps] * [delegated agents](/build/agents/delegated) to configure an agent to act for a caller and write claim-aware rules * [Configure Act-As on an agent](/build/agents/external#change-end-user-identity) for method, required flag, provider, and allow-lists * [Pass identity for delegated agents](/develop#pass-identity-for-delegated-agents) from your application * [Identity Patterns](/concepts/identity-patterns) to compare delegated Act-As with interactive OAuth * [Audit events](/operate/audit) to investigate the retained evidence behind caller activity # Connect (/connect) **Connect** attaches callers and AI resources to the runtime surface you built in Dome. Configure tools, models, and pools; Dome stores their upstream credentials, so agents authenticate to Dome rather than to every backend. ## What you connect [#what-you-connect] * [Callers](/connect/callers): Configure trusted callers and end-user verification when access depends on the person an agent represents. * [Tools](/connect/tools): Attach MCP servers and related backends as resources a gateway can expose. * [Models](/connect/models): Connect LLM providers and hold their credentials server-side. * [Pools](/connect/pools): Group model connections behind one name with routing and failover. An agent reaches these resources only through a [gateway](/build/gateways) that admits it, and never holds their upstream credentials. [rules](/reference/glossary#rule), [guards](/reference/glossary#guard), and [quotas](/reference/glossary#quota) still decide what the call may do, what content may pass, and how much spend is allowed after admission. Choose between standing and delegated identity on [Identity Patterns](/concepts/identity-patterns). Refer to [Build](/build) for agents, gateways, and triggers, or [Architecture](/concepts/architecture) for the full request path. ## Typical workflow [#typical-workflow] 1. Add [tools](/connect/tools), [models](/connect/models), and [pools](/connect/pools) when you need a stable name, routing, or failover. 2. Add those resources to a [gateway](/build/gateways) you created in [Build](/build). 3. Configure [callers](/connect/callers) or [delegated agents](/build/agents/delegated) when access needs verified end-user identity. 4. Continue to [Govern](/govern) to define what the agent may do after the gateway admits it. ## Next steps [#next-steps] * [Build](/build) to create agents, gateways, and managed-agent triggers. * [Govern](/govern) to authorize actions, inspect content, and cap spend. * [Operate](/operate) to investigate audit events, stream live activity, and subscribe external systems. * [Develop](/develop) to send credentials, gateway endpoints, and Act-As envelopes from your application. # Models (/connect/models)

{modelConnection}

## Overview [#overview] A model connection represents one upstream model in Dome. The connection stores the configuration and credentials Dome needs to call that model. An agent selects the connection by putting its name in the request's `model` field. A [pool](/connect/pools) groups multiple models behind one name. Dome selects one member for each request. Prefer a pool when you need routing, traffic distribution, or failover. Refer to [Pools](/concepts/resources/model-pools) concept. The typical workflow is: 1. [Choose a provider](#providers) and model identifier. 2. [Add the model](#add-model) with its upstream credentials. 3. Attach the model directly to a [gateway](#attach-to-a-gateway) or add it to a [model pool](/connect/pools). 4. Allow the gateway on the [external agent](/build/agents/external#allowed-resources). 5. [Verify the route](#verify-model) with that agent's API key. ### Providers [#providers] The provider determines how Dome translates requests and where Dome places the upstream credential. You cannot change the provider after adding the model. Provider IDs fall into three groups. * **Native providers.** Dome translates between the gateway request and the provider's native wire format: `openai`, `anthropic`, `google`, `azure_openai`, and `bedrock`. * **Hosted OpenAI-compatible providers.** Dome sends requests through the provider's OpenAI-compatible API (for example `mistral`, `groq`, `together`, `moonshot`, `openrouter`, `databricks`). * **Bring your own endpoint.** Use `openai_compatible` for an OpenAI-shaped endpoint such as vLLM or Ollama. Use `custom` when Dome should forward provider-specific requests without translating them. Dome supplies a base URL for hosted providers that have a default. For Google, Azure OpenAI, Bedrock, Databricks, `openai_compatible`, and `custom`, you must provide an endpoint or the provider-specific details needed to locate the model. The full provider ID list is on the [Models](/reference/resources/models#providers) reference. Discover valid provider and model ids from the same catalog the dashboard picker uses: [`dome models providers`](/cli/connect/models#list-providers) or [`dome_models_providers`](/reference/mcp/models#dome_models_providers). Curated lists exist for providers with stable public ids (OpenAI, Anthropic, Google) and always include a default. Other providers return an empty model list and accept any model string the upstream accepts. A model your upstream supports but the catalog does not list is still valid — pass it as `--model `. ### Credentials [#credentials] Agent API keys authenticate inbound requests to Dome. Model credentials authenticate Dome's outbound requests to the provider, and agents never receive them. | Authentication method | Credential type | What Dome sends | | --------------------- | --------------- | ------------------------------------------------------- | | `none` | `none` | No provider credential | | `api-key` | `shared` | One workspace-managed API key for every call | | `api-key` | `per-user` | An API key linked to the verified end user | | `oauth` | `shared` | One administrator-authorized OAuth grant for every call | | `oauth` | `per-user` | An OAuth grant linked to the verified end user | When the provider requires no authentication, set both the authentication method and credential type to `none`. When the provider uses an API key or OAuth, the credential type must be `shared` or `per-user`. If you omit both settings, Dome uses `api-key` with `shared`. With per-user credentials, Dome uses the verified act-as identity on each request to select the provider credential. If that end user has not connected a credential, Dome returns HTTP `401` with a short-lived `provision_url`. The end user opens the URL to enter an API key or complete OAuth consent, then retries the request. Refer to [Errors and denials](/develop#errors-and-denials) for runtime handling. Google models with shared credentials use a service account. On a self-hosted gateway, Google and Bedrock models can instead use the gateway's cloud-native identity. A Dome-hosted gateway cannot assume a role or workload identity from your cloud account. Model API keys and OAuth client secrets are write-only. Dome uses them for outbound requests but does not return their raw values after you create or update a connection. ### Attributes [#attributes] Attributes add trusted metadata to a model for [rules](/govern/rules) to evaluate. For example, a rule can allow models with `region=eu` for a European workload or deny models whose `data_class` does not match the request. Attributes do not change how Dome calls the provider. You can set attributes when you [add a model](#add-model) or [change them later](#change-attributes). ### Filter window [#filter-window] A model can change how much streamed output Dome buffers before applying outbound guards. Dome uses the largest window configured on the workspace, model, or request. A model can therefore increase inspection coverage but cannot reduce the workspace minimum. A value of `0` uses the workspace setting. A model can buffer at most 1 MiB or 4,096 tokens. You can set a filter window when you [add a model](#add-model) or [change it later](#change-filter-window). ## Requirements [#requirements] Before you begin: * Authenticate to Dome and select a workspace * Have the provider, model identifier, and provider-specific configuration * Have a provider credential unless the model uses no authentication or workload identity * Have a [Gateway](/build/gateways) ready when you want the model reachable ### Permissions [#permissions] Model connection operations require platform permissions. Each operation states its required permission inline. | Default roles | Permission | Grants | | ------------------- | ----------------- | ------------------------------ | | All workspace roles | `gateways.view` | List and inspect models | | `admin`, `operator` | `gateways.manage` | Add, update, and remove models | ## Add model [#add-model] Add a model for one provider endpoint. You can attach the model directly to a gateway during this operation. If you do not attach it, agents cannot call the model until you attach it later. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome models add claude-prod \ --provider anthropic \ --model claude-sonnet-4-6 \ --api-key "$ANTHROPIC_API_KEY" \ --gateway prod-llms ``` Add `--endpoint` or `--provider-config` when the provider requires more configuration. > **Note**: Reference: [`dome models add`](/cli/connect/models#add-connection) **MCP** Tool: `dome_models_add` ```json { "name": "claude-prod", "provider": "anthropic", "provider_config": { "model": "claude-sonnet-4-6" }, "api_key": "{{ANTHROPIC_API_KEY}}", "gateways": ["prod-llms"] } ``` > **Note**: Reference: [`dome_models_add`](/reference/mcp/models#dome_models_add) **API** ```http POST /v1/models Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "name": "claude-prod", "provider": "anthropic", "provider_config": { "model": "claude-sonnet-4-6" }, "auth_method": "api-key", "credential_type": "shared", "secret_values": { "x-api-key": "{{ANTHROPIC_API_KEY}}" } } ``` The endpoint returns the model's UUID. The other management endpoints use this UUID to identify the model. Attach the model to a gateway in a separate operation. > **Note**: Reference: [`CreateLLMModelConnection`](/api/tag/models/create-llm-model-connection) **Agent** ```text title="Connect an LLM model" Add an Anthropic model named "claude-prod" for claude-sonnet-4-6 using my API key. Attach it to the "prod-llms" Gateway. ``` Agents cannot call a model until you attach it directly to a gateway or add it to a pool attached to one. ## Update model [#update-model] Update a model to change its name, model identifier, endpoint, authentication, attributes, or filter window. You cannot change the provider after creating the model. To switch providers, add a new model and replace the old connection in any pools or gateways. When you rename a model, managed agents configured to run on it follow the new name. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome models update claude-prod \ --model claude-sonnet-4-6 ``` Only the flags you pass change. `--provider-config` replaces the full provider configuration instead of merging with it. > **Note**: Reference: [`dome models update`](/cli/connect/models#update-connection) **MCP** Tool: `dome_models_update` ```json { "name": "claude-prod", "provider_config": { "model": "claude-sonnet-4-6" } } ``` Only the parameters you send change. `provider_config` and `attributes` each replace the existing object. > **Note**: Reference: [`dome_models_update`](/reference/mcp/models#dome_models_update) **API** ```http PATCH /v1/models/{{CONNECTION_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "provider_config": { "model": "claude-sonnet-4-6" } } ``` Omitted fields keep their stored values. When present, `provider_config` replaces the full object. To replace or clear attributes, headers, credentials, or the filter window, send the new value and set its corresponding `*_provided` field to `true`. > **Note**: Reference: [`UpdateLLMModelConnection`](/api/tag/models/update-llm-model-connection) **Agent** ```text title="Update a model" Update the "claude-prod" model to use claude-sonnet-4-6. Keep its provider, credentials, attributes, and Gateway membership unchanged. ``` ### Change credentials [#change-credentials] You can change the authentication method, credential type, or shared API key. Switching authentication methods deletes the previously stored provider credential. **CLI** ```bash dome models update claude-prod \ --auth-method api-key \ --credential-type per-user ``` Rotate a shared API key with the same command: ```bash dome models update claude-prod \ --api-key "$NEW_ANTHROPIC_API_KEY" ``` The new value replaces the shared key. Dome never returns the stored key, and other stored secrets keep their values. > **Note**: Reference: [`dome models update`](/cli/connect/models#update-connection) **MCP** Tool: `dome_models_update` ```json { "name": "claude-prod", "auth_method": "api-key", "credential_type": "shared", "api_key": "{{ANTHROPIC_API_KEY}}" } ``` > **Note**: Reference: [`dome_models_update`](/reference/mcp/models#dome_models_update) **API** ```http PATCH /v1/models/{{CONNECTION_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "auth_method": "api-key", "credential_type": "shared", "secret_values": { "x-api-key": "{{ANTHROPIC_API_KEY}}" }, "secret_values_provided": true } ``` > **Note**: Reference: [`UpdateLLMModelConnection`](/api/tag/models/update-llm-model-connection) **Agent** ```text title="Rotate a model credential" Replace the shared API key on "claude-prod" with my new Anthropic API key. ``` ### Use cloud workload identity [#use-cloud-workload-identity] Use a self-hosted gateway's cloud identity for Google Vertex AI or Amazon Bedrock. Pin the identity that gateway must run as, so Dome refuses calls when the cloud credential resolves to another identity. For Bedrock, use a 12-digit AWS account ID or an IAM role ARN: ```bash dome models add bedrock-prod \ --provider bedrock \ --model anthropic.claude-sonnet-4-5 \ --use-workload-identity \ --expected-workload-identity arn:aws:iam::123456789012:role/dome-gateway \ --gateway self-hosted-models ``` For Google, set `--expected-workload-identity` to the service account email. Dome requires both workload-identity flags for Google and Bedrock connections. Other providers do not support this authentication path. Workload identity is available only on self-hosted gateways. It uses the gateway's default cloud credential chain instead of a Vault credential bundle. Update the pin with `dome models update {{MODEL_NAME}} --expected-workload-identity {{IDENTITY}}`; pass `--use-workload-identity=false` to turn workload identity off. ### Change attributes [#change-attributes] You can replace the trusted attributes that rules evaluate for this model. Send an empty object to clear them. **CLI** ```bash dome models update claude-prod \ --attributes '{"region":"eu","data_class":"restricted"}' ``` > **Note**: Reference: [`dome models update`](/cli/connect/models#update-connection) **MCP** Tool: `dome_models_update` ```json { "name": "claude-prod", "attributes": { "region": "eu", "data_class": "restricted" } } ``` > **Note**: Reference: [`dome_models_update`](/reference/mcp/models#dome_models_update) **API** ```http PATCH /v1/models/{{CONNECTION_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "attributes": { "region": "eu", "data_class": "restricted" }, "attributes_provided": true } ``` > **Note**: Reference: [`UpdateLLMModelConnection`](/api/tag/models/update-llm-model-connection) **Agent** ```text title="Change model attributes" Replace the attributes on "claude-prod" with region "eu" and data class "restricted". ``` ### Change filter window [#change-filter-window] You can change how much streamed output Dome buffers for outbound guard inspection. A model can buffer at most 1 MiB or 4,096 tokens. Set both values to `0` to use the workspace minimum. **CLI** ```bash dome models update claude-prod \ --filter-window-bytes 65536 \ --filter-window-tokens 1024 ``` > **Note**: Reference: [`dome models update`](/cli/connect/models#update-connection) **API** ```http PATCH /v1/models/{{CONNECTION_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "filter_window_bytes": 65536, "filter_window_tokens": 1024, "filter_window_provided": true } ``` > **Note**: Reference: [`UpdateLLMModelConnection`](/api/tag/models/update-llm-model-connection) ## Get model [#get-model] Retrieve a model to inspect its provider configuration, authentication, attributes, filter window, and gateway membership. Use this information before an update or when troubleshooting routing. > **Note**: Requires `gateways.view`. **CLI** ```bash dome models get claude-prod ``` > **Note**: Reference: [`dome models get`](/cli/connect/models#get-connection) **MCP** Tool: `dome_models_get` ```json { "name": "claude-prod" } ``` > **Note**: Reference: [`dome_models_get`](/reference/mcp/models#dome_models_get) **API** ```http GET /v1/models/{{CONNECTION_ID}}?workspace_id={{WORKSPACE_ID}} ``` The management API addresses a model by UUID. If you know only its name, call `ListLLMModelConnections` to find the corresponding ID. > **Note**: Reference: [`GetLLMModelConnection`](/api/tag/models/get-llm-model-connection) **Agent** ```text title="Get a model" Get the "claude-prod" model and confirm its provider, model identifier, authentication method, and Gateway membership. ``` ## List models [#list-models] Retrieve the models in a workspace with their providers and configurations. Use the list to find a model to inspect, update, add to a pool, or remove. > **Note**: Requires `gateways.view`. **CLI** ```bash dome models list ``` > **Note**: Reference: [`dome models list`](/cli/connect/models#list-connections) **MCP** Tool: `dome_models_list` ```json {} ``` > **Note**: Reference: [`dome_models_list`](/reference/mcp/models#dome_models_list) **API** ```http GET /v1/models?workspace_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`ListLLMModelConnections`](/api/tag/models/list-llm-model-connections) **Agent** ```text title="List models" List the models in this workspace with their providers and model identifiers. ``` ## Remove model [#remove-model] Remove a model to delete its connection and provider credentials from the workspace. > **Note**: Requires `gateways.manage`. > **Warning**: Removing a model also removes it from model pools and gateways. Check what depends on it before deleting it. Without reassignment, managed agents configured to run on it cannot run, and agents with no other model grant lose model access. Inspect dependencies before deleting or renaming a model: ```bash dome models usage claude-prod ``` The result identifies dependent managed agents, agents granted the model, gateways, and pool membership. Names can be omitted when you cannot view the corresponding agent type. Use `dome_models_usage` for the same check through MCP. **CLI** ```bash dome models rm claude-prod --reassign-to gpt-prod ``` > **Note**: Reference: [`dome models rm`](/cli/connect/models#remove-connection) **MCP** Tool: `dome_models_remove` ```json { "name": "claude-prod", "reassign_to": "gpt-prod" } ``` > **Note**: Reference: [`dome_models_remove`](/reference/mcp/models#dome_models_remove) **API** ```http DELETE /v1/models/{{CONNECTION_ID}}?workspace_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`DeleteLLMModelConnection`](/api/tag/models/delete-llm-model-connection) **Agent** ```text title="Remove a model" Remove the "claude-prod" model after confirming no pools or Gateways still depend on it. ``` `--reassign-to` (or `reassign_to`) moves dependent managed agents to a replacement model or pool and grants it to agents that held the deleted model. Omit it only when you intend to remove that access. The CLI asks for confirmation when dependents exist; use `--yes` only in an unattended workflow that has already checked usage. ## Attach to a Gateway [#attach-to-a-gateway] Attach a model directly to a gateway when its name should always route to that one connection. The attachment makes the model reachable at the gateway endpoint but does not authorize an agent to call it. The agent must allow the gateway, and rules must permit the request. When a route needs failover or weighted distribution across multiple models, add the model to a [model pool](/connect/pools) and attach the pool instead. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways models add prod-llms claude-prod ``` > **Note**: Reference: [`dome gateways models add`](/cli/build/gateway#add-model) **MCP** Tool: `dome_gateways_model_add` ```json { "gateway": "prod-llms", "model": "claude-prod" } ``` > **Note**: Reference: [`dome_gateways_model_add`](/reference/mcp/gateway#dome_gateways_model_add) **Agent** ```text title="Publish a direct model" Add the "claude-prod" model directly to the "prod-llms" Gateway. ``` ### Verify model [#verify-model] Call the model through the gateway with an agent API key. A successful response confirms the model is reachable, rules permit the request, and the upstream accepted the configured credential. ```python title="OpenAI-compatible client" from openai import OpenAI client = OpenAI( api_key="{{DOME_AGENT_KEY}}", base_url="https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/v1", ) response = client.chat.completions.create( model="claude-prod", messages=[{"role": "user", "content": "Return OK."}], ) ``` If the model is missing or denied, check gateway membership, the agent's allowed resources, and rules. If the upstream rejects the call, check the model's provider configuration and credentials. ## Manage OAuth [#manage-oauth] With shared OAuth, an administrator completes consent once and Dome uses the resulting provider tokens for every call. With per-user OAuth, each verified end user completes consent separately. When an end user has not connected OAuth, the first request returns a `provision_url` where the user can complete consent. Configure the OAuth client when you add or update the model. If the provider publishes OAuth metadata, Dome can discover the required endpoints. Otherwise, you must provide the authorization, token, revocation, and registration URLs. A manually registered client requires a client ID and secret. With dynamic client registration, Dome obtains them from the provider. ### Register a manual OAuth client [#register-a-manual-oauth-client] Register Dome's callback URI with your authorization server before configuring a manual OAuth client. Ask the connected server for the exact URI: ```bash dome models oauth-redirect-uri ``` Then set the client configuration. The OAuth client secret is write-only; omit `--oauth-client-secret` on later updates to keep the current value. ### Connect OAuth [#connect-oauth] Connect OAuth after adding a model configured to use shared OAuth. Dome returns a one-time URL that remains valid for about ten minutes. Open the URL to complete consent at the provider. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome models oauth-connect claude-prod ``` > **Note**: Reference: [`dome models oauth-connect`](/cli/connect/models#connect-oauth) **MCP** Tool: `dome_models_oauth_connect` ```json { "name": "claude-prod" } ``` > **Note**: Reference: [`dome_models_oauth_connect`](/reference/mcp/models#dome_models_oauth_connect) **API** ```http POST /v1/models/{{CONNECTION_ID}}/oauth/connect Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}" } ``` > **Note**: Reference: [`BeginLLMOAuthConnect`](/api/tag/models/begin-llm-oauth-connect) **Agent** ```text title="Connect model OAuth" Start shared OAuth consent for the "claude-prod" model. ``` ### Disconnect OAuth [#disconnect-oauth] Disconnect shared OAuth to revoke the stored provider tokens. The OAuth client configuration remains, so you can reconnect without configuring the client again. Disconnecting an already disconnected model has no effect. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome models oauth-disconnect claude-prod ``` > **Note**: Reference: [`dome models oauth-disconnect`](/cli/connect/models#disconnect-oauth) **MCP** Tool: `dome_models_oauth_disconnect` ```json { "name": "claude-prod" } ``` > **Note**: Reference: [`dome_models_oauth_disconnect`](/reference/mcp/models#dome_models_oauth_disconnect) **API** ```http POST /v1/models/{{CONNECTION_ID}}/oauth/disconnect Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}" } ``` > **Note**: Reference: [`DisconnectLLMOAuth`](/api/tag/models/disconnect-llm-oauth) **Agent** ```text title="Disconnect model OAuth" Disconnect shared OAuth credentials from the "claude-prod" model. ``` ## Next steps [#next-steps] * [Models](/concepts/resources/models) concept for how connections and attributes work and [Models](/reference/resources/models) reference for providers and credentials * [Create a model pool](/connect/pools) for routing, traffic distribution, and failover * Manage membership and grants in [Gateways](/build/gateways) * Authenticate clients and route model traffic in [Develop](/develop#authenticate) # Pools (/connect/pools)

{modelPool}

## Overview [#overview] A pool contains one or more [models](/connect/models). When an agent puts the pool name in a request's `model` field, Dome orders the members according to the routing strategy. Dome sends the request to the first eligible member. If that attempt fails, Dome can try the remaining eligible members. The typical workflow is: 1. [Connect the models](/connect/models#add-model) that can serve the traffic. 2. [Create a pool](#create-pool). 3. [Add the models as members](#add-member). 4. Configure the pool's [routing strategy](#routing-strategies) and [failover](#failover). 5. [Attach the pool to a gateway](#attach-to-a-gateway). 6. Allow the gateway on the [external agent](/build/agents/external#allowed-resources). 7. [Verify the pool](#verify-pool) with that agent's API key. ### Members [#members] Each member represents one model connection in the pool. With priority-weighted routing, the priority places the member in a failover tier. The weight determines how often Dome selects the member within that tier. Round-robin, least-loaded, and most-quota-remaining routing treat every member equally, so they ignore priority and weight. A model can belong to more than one pool. Removing a member changes only that pool and leaves the model connection available elsewhere. > **Warning**: The management interfaces store an `enabled` value, but the current gateway routes to members regardless of that value. To stop sending traffic to a member, remove it from the pool. ### Routing strategies [#routing-strategies] The routing strategy chooses the primary model and orders any failover candidates. | Strategy | Primary selection | Member fields it uses | | ---------------------- | ------------------------------------------------------------------------------------------------------ | --------------------- | | `priority_weighted` | Chooses by weight from the lowest priority tier | Priority and weight | | `round_robin` | Rotates through all members in order | Neither | | `least_loaded` | Chooses the member with the fewest in-flight requests and breaks ties randomly | Neither | | `most_quota_remaining` | Chooses the member with the most remaining per-model cost-quota headroom; unmetered members serve last | Neither | Use `priority_weighted` when some models should take traffic before others. Use `round_robin` or `least_loaded` when members are peers. Use `most_quota_remaining` when members carry different per-model cost caps and you want to drain the highest-headroom member first. Exhausted members are locked out by the quota barrier before this strategy orders the survivors. With no per-model quotas, every member ties and the strategy degrades to round-robin — meter every member for the ordering to have effect. The `strategy_scope` setting determines whether round-robin rotation, least-loaded request counts, and `most_quota_remaining` tiebreaks are shared across the workspace or tracked per agent. Priority-weighted routing does not use this setting. For `most_quota_remaining`, scope only affects the tiebreak — not the primary ordering. You can choose a strategy when you [create a pool](#create-pool) or [change it later](#change-routing). ### Failover [#failover] The failover limit controls how many additional members Dome may try when the request to the primary member fails. | Value | Runtime behavior | | ----------------- | ------------------------------------------------ | | No limit or `all` | Try every eligible member until one succeeds | | `0` | Try only the primary | | `N` | Try the primary and up to `N` additional members | Dome authorizes the primary before sending the request. If the primary fails, Dome authorizes each remaining member before trying it and skips any member that rules deny. A streaming request can fail over only before Dome sends the first response data to the caller. An error after streaming begins terminates the response. You can set failover when you [create a pool](#create-pool) or [change it later](#change-failover). ### Pool resolution [#pool-resolution] When a request reaches a gateway, Dome resolves its `model` value in this order: 1. A pool with that exact name 2. A direct model connection with that exact name 3. A direct connection whose upstream model identifier matches 4. The first pool in the configured order whose `match_when` predicate matches 5. The workspace default pool An exact pool or model name takes precedence over conditional routing. When the requested name does not match directly, a `match_when` condition can select a pool based on the request or verified identity (for example `prompt_tokens.gt`). The full `match_when` dialect is on the [Pools](/reference/resources/model-pools#pool-resolution) reference. You can set a condition when you [create a pool](#create-pool), [change it later](#change-request-routing), and [move the pool](#move-pool) to control evaluation order. ### Response caching [#response-caching] Pool records store a cache TTL and cache scope for reusing responses to identical requests. > **Warning**: The gateway does not read these settings during model dispatch. Setting `cache_ttl_secs` or `cache_scope` does not cache responses. ## Requirements [#requirements] Before you begin: * Authenticate to Dome and select a workspace * Connect at least one [model](/connect/models) * Have a [Gateway](/build/gateways) ready when you want the pool reachable ### Permissions [#permissions] Pool operations require platform permissions. Each operation states its required permission inline. | Default roles | Permission | Grants | | ------------------- | ----------------- | -------------------------------------------- | | All workspace roles | `gateways.view` | List and inspect pools | | `admin`, `operator` | `gateways.manage` | Create, update, and remove pools and members | ## Create pool [#create-pool] Create a pool with a name that clients can put in the request's `model` field. A new pool has no members until you add them. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome models pool create production \ --routing-strategy priority_weighted \ --failover-max all \ --gateway prod-llms ``` By default, the CLI uses priority-weighted routing and shares routing state across the workspace. It sets the cache TTL to `0` and allows Dome to try every eligible member after a failure. > **Note**: Reference: [`dome models pool create`](/cli/connect/models#create-pool) **MCP** Tool: `dome_models_pool_create` ```json { "name": "production", "routing_strategy": "priority_weighted", "failover_max": "all", "gateways": ["prod-llms"] } ``` > **Note**: Reference: [`dome_models_pool_create`](/reference/mcp/pools#dome_models_pool_create) **API** ```http POST /v1/models/pools Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "name": "production", "routing_strategy": "priority_weighted", "strategy_scope": "workspace" } ``` Omit `failover_max` to let Dome try every eligible member after a failure. The endpoint returns the pool's UUID. The other management endpoints use this UUID to identify the pool. Attach the pool to a gateway in a separate operation. > **Note**: Reference: [`CreateLLMPool`](/api/tag/model-pools/create-llm-pool) **Agent** ```text title="Create a model pool" Create a model pool named "production" with priority-weighted routing and no failover limit. Attach it to the "prod-llms" Gateway. ``` Agents cannot call a pool until it has at least one model member and belongs to a gateway. ## Update pool [#update-pool] Update a pool to change its name, description, routing strategy, conditional routing criteria, cache settings, or failover limit. Setting a different default pool and changing the order of conditional routes are separate operations. When you rename a pool, managed agents configured to run on it follow the new name. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome models pool update production \ --description "Production chat routing" ``` Only the flags you pass change. > **Note**: Reference: [`dome models pool update`](/cli/connect/models#update-pool) **MCP** Tool: `dome_models_pool_update` ```json { "name": "production", "description": "Production chat routing" } ``` Only the parameters you send change. > **Note**: Reference: [`dome_models_pool_update`](/reference/mcp/pools#dome_models_pool_update) **API** ```http PATCH /v1/models/pools/{{POOL_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "description": "Production chat routing" } ``` Omitted fields keep their stored values. An empty description does not clear the existing description. To clear `match_when`, set `match_when_provided` to `true`. To set the cache TTL to `0`, set `cache_ttl_secs_provided` to `true`. To let Dome retry every eligible member, set `failover_max_clear` to `true`. > **Note**: Reference: [`UpdateLLMPool`](/api/tag/model-pools/update-llm-pool) **Agent** ```text title="Update a model pool" Change the description of "production" to "Production chat routing". Keep its members and routing configuration unchanged. ``` ### Change routing [#change-routing] You can change how the pool selects its primary member. Refer to [Routing strategies](#routing-strategies) for when to use each strategy. When switching away from priority-weighted routing, existing priorities and weights remain stored but no longer affect selection. **CLI** ```bash dome models pool update production \ --routing-strategy most_quota_remaining \ --strategy-scope workspace ``` > **Note**: Reference: [`dome models pool update`](/cli/connect/models#update-pool) **MCP** Tool: `dome_models_pool_update` ```json { "name": "production", "routing_strategy": "most_quota_remaining", "strategy_scope": "workspace" } ``` > **Note**: Reference: [`dome_models_pool_update`](/reference/mcp/pools#dome_models_pool_update) **API** ```http PATCH /v1/models/pools/{{POOL_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "routing_strategy": "most_quota_remaining", "strategy_scope": "workspace" } ``` > **Note**: Reference: [`UpdateLLMPool`](/api/tag/model-pools/update-llm-pool) **Agent** ```text title="Change pool routing" Change "production" to caller-scoped round-robin routing. ``` ### Change request routing [#change-request-routing] You can replace the conditions that select this pool during conditional routing. Send an empty `match_when` object to remove those conditions. **CLI** ```bash dome models pool update long-context \ --match-when '{"prompt_tokens":{"gt":50000}}' ``` > **Note**: Reference: [`dome models pool update`](/cli/connect/models#update-pool) **MCP** Tool: `dome_models_pool_update` ```json { "name": "long-context", "match_when": { "prompt_tokens": { "gt": 50000 } } } ``` > **Note**: Reference: [`dome_models_pool_update`](/reference/mcp/pools#dome_models_pool_update) **API** ```http PATCH /v1/models/pools/{{POOL_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "match_when": { "prompt_tokens": { "gt": 50000 } }, "match_when_provided": true } ``` > **Note**: Reference: [`UpdateLLMPool`](/api/tag/model-pools/update-llm-pool) **Agent** ```text title="Change conditional routing" Route prompts over 50,000 tokens through the "long-context" pool. ``` ### Change failover [#change-failover] You can change how many additional members Dome may try after the primary fails. Refer to [Failover](#failover) for limit values and streaming behavior. After setting a numeric limit, you can use the API to let Dome try every eligible member again. **CLI** ```bash dome models pool update production \ --failover-max 2 ``` > **Note**: Reference: [`dome models pool update`](/cli/connect/models#update-pool) **MCP** Tool: `dome_models_pool_update` ```json { "name": "production", "failover_max": "2" } ``` > **Note**: Reference: [`dome_models_pool_update`](/reference/mcp/pools#dome_models_pool_update) **API** ```http PATCH /v1/models/pools/{{POOL_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "failover_max": 2 } ``` To let Dome try every eligible member, send a separate update with `failover_max_clear`. ```http PATCH /v1/models/pools/{{POOL_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "failover_max_clear": true } ``` > **Note**: Reference: [`UpdateLLMPool`](/api/tag/model-pools/update-llm-pool) **Agent** ```text title="Change pool failover" Allow the "production" pool to retry up to two additional models. ``` ## Get pool [#get-pool] Retrieve a pool with its routing configuration and members. Check this information before an update or when you need to determine which models can serve requests to the pool. > **Note**: Requires `gateways.view`. **CLI** ```bash dome models pool get production ``` > **Note**: Reference: [`dome models pool get`](/cli/connect/models#get-pool) **MCP** Tool: `dome_models_pool_get` ```json { "name": "production" } ``` > **Note**: Reference: [`dome_models_pool_get`](/reference/mcp/pools#dome_models_pool_get) **API** ```http GET /v1/models/pools/{{POOL_ID}}?workspace_id={{WORKSPACE_ID}} ``` The API returns the pool and its members. > **Note**: Reference: [`GetLLMPool`](/api/tag/model-pools/get-llm-pool) **Agent** ```text title="Get a model pool" Get the "production" pool with its routing configuration and members. ``` ## List pools [#list-pools] Retrieve the pools in a workspace with their routing strategies, conditional routing criteria, and default status. Use the list to find a pool to inspect, reorder, update, or remove. > **Note**: Requires `gateways.view`. **CLI** ```bash dome models pool list ``` > **Note**: Reference: [`dome models pool list`](/cli/connect/models#list-pools) **MCP** Tool: `dome_models_pool_list` ```json {} ``` > **Note**: Reference: [`dome_models_pool_list`](/reference/mcp/pools#dome_models_pool_list) **API** ```http GET /v1/models/pools?workspace_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`ListLLMPools`](/api/tag/model-pools/list-llm-pools) **Agent** ```text title="List model pools" List the model pools in this workspace with their routing strategy, predicate, and default state. ``` ## Set default pool [#set-default-pool] Set a pool as the workspace default. Dome uses the default only when a request does not match an exact model name, exact pool name, or conditional route. Setting a new default removes the previous default. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome models pool set-default production ``` > **Note**: Reference: [`dome models pool set-default`](/cli/connect/models#set-default-pool) **MCP** Tool: `dome_models_pool_set_default` ```json { "name": "production" } ``` > **Note**: Reference: [`dome_models_pool_set_default`](/reference/mcp/pools#dome_models_pool_set_default) **API** ```http POST /v1/models/pools/{{POOL_ID}}/default Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}" } ``` Send an empty `pool_id` to clear the default without setting another pool. > **Note**: Reference: [`SetDefaultLLMPool`](/api/tag/model-pools/set-default-llm-pool) **Agent** ```text title="Set the default model pool" Set "production" as the default model pool for this workspace. ``` ## Move pool [#move-pool] Move a conditional pool earlier or later in the order Dome checks `match_when` predicates. This order affects only conditional routing and does not change routes that use an exact model or pool name. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome models pool move long-context \ --before production ``` Pass exactly one of `--before` or `--after`. > **Note**: Reference: [`dome models pool move`](/cli/connect/models#move-pool) **MCP** Tool: `dome_models_pool_move` ```json { "name": "long-context", "before": "production" } ``` > **Note**: Reference: [`dome_models_pool_move`](/reference/mcp/pools#dome_models_pool_move) **Agent** ```text title="Move a conditional pool" Evaluate "long-context" immediately before "production". ``` ## Manage members [#manage-members] Pool members are the model connections that Dome can select to serve requests to the pool. ### Add member [#add-member] Add a model to a pool. For a priority-weighted pool, priority defaults to `0` and weight defaults to `1`. Round-robin and least-loaded pools reject explicit priority or weight values. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome models pool member add production claude-prod \ --priority 0 \ --weight 4 ``` Run a separate command for each model because each member can have a different priority and weight. > **Note**: Reference: [`dome models pool member add`](/cli/connect/models#add-member) **MCP** Tool: `dome_models_pool_member_add` ```json { "pool": "production", "connection": "claude-prod", "priority": 0, "weight": 4 } ``` > **Note**: Reference: [`dome_models_pool_member_add`](/reference/mcp/pools#dome_models_pool_member_add) **API** ```http POST /v1/models/pools/{{POOL_ID}}/members Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "llm_model_connection_id": "{{CONNECTION_ID}}", "priority": 0, "weight": 4, "enabled": true } ``` > **Note**: Reference: [`CreateLLMPoolMember`](/api/tag/model-pools/create-llm-pool-member) **Agent** ```text title="Add a pool member" Add "claude-prod" to "production" at priority zero with weight four. ``` ### List members [#list-members] Retrieve the models in a pool with each member's priority, weight, and stored `enabled` value. > **Note**: Requires `gateways.view`. **CLI** ```bash dome models pool member list production ``` > **Note**: Reference: [`dome models pool member list`](/cli/connect/models#list-members) **MCP** Tool: `dome_models_pool_member_list` ```json { "pool": "production" } ``` > **Note**: Reference: [`dome_models_pool_member_list`](/reference/mcp/pools#dome_models_pool_member_list) **API** ```http GET /v1/models/pools/{{POOL_ID}}/members?workspace_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`ListLLMPoolMembers`](/api/tag/model-pools/list-llm-pool-members) **Agent** ```text title="List pool members" List the members of "production" with their priority and weight. ``` ### Update member [#update-member] Update the priority or weight of a member in a priority-weighted pool. To move a model to another pool, remove it from the current pool and add it to the destination pool. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome models pool member update production claude-prod \ --priority 1 \ --weight 1 ``` > **Note**: Reference: [`dome models pool member update`](/cli/connect/models#update-member) **MCP** Tool: `dome_models_pool_member_update` ```json { "pool": "production", "connection": "claude-prod", "priority": 1, "weight": 1 } ``` > **Note**: Reference: [`dome_models_pool_member_update`](/reference/mcp/pools#dome_models_pool_member_update) **API** ```http PATCH /v1/models/pools/{{POOL_ID}}/members/{{MEMBER_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "priority": 1, "weight": 1 } ``` > **Note**: Reference: [`UpdateLLMPoolMember`](/api/tag/model-pools/update-llm-pool-member) **Agent** ```text title="Update a pool member" Change "claude-prod" in "production" to priority one and weight one. ``` ### Remove member [#remove-member] Remove a model from a pool to stop the pool from sending requests to that model. Removing the member does not delete the model connection, so other pools and direct gateway routes can still use it. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome models pool member rm production claude-prod ``` > **Note**: Reference: [`dome models pool member rm`](/cli/connect/models#remove-member) **MCP** Tool: `dome_models_pool_member_remove` ```json { "pool": "production", "connection": "claude-prod" } ``` > **Note**: Reference: [`dome_models_pool_member_remove`](/reference/mcp/pools#dome_models_pool_member_remove) **API** ```http DELETE /v1/models/pools/{{POOL_ID}}/members/{{MEMBER_ID}}?workspace_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`DeleteLLMPoolMember`](/api/tag/model-pools/delete-llm-pool-member) **Agent** ```text title="Remove a pool member" Remove "claude-prod" from "production" without deleting the model. ``` ## Remove pool [#remove-pool] Remove a pool to delete its routing configuration and memberships. Removing the pool does not delete its model connections. > **Note**: Requires `gateways.manage`. > **Warning**: Removing a pool also removes it from every gateway. Check what depends on it before deleting it. Without reassignment, managed agents configured to run on it cannot run, and agents with no other model grant lose model access. Inspect dependencies before deleting or renaming a pool: ```bash dome models pool usage production ``` The result identifies dependent managed agents, agents granted the pool, and gateways. Names can be omitted when you cannot view the corresponding agent type. Use `dome_models_pool_usage` for the same check through MCP. **CLI** ```bash dome models pool rm production --reassign-to fallback ``` > **Note**: Reference: [`dome models pool rm`](/cli/connect/models#remove-pool) **MCP** Tool: `dome_models_pool_remove` ```json { "name": "production", "reassign_to": "fallback" } ``` > **Note**: Reference: [`dome_models_pool_remove`](/reference/mcp/pools#dome_models_pool_remove) **API** ```http DELETE /v1/models/pools/{{POOL_ID}}?workspace_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`DeleteLLMPool`](/api/tag/model-pools/delete-llm-pool) **Agent** ```text title="Remove a model pool" Remove the "production" pool after confirming no clients still use its name. ``` `--reassign-to` (or `reassign_to`) moves dependent managed agents to a replacement model or pool and grants it to agents that held the deleted pool. Omit it only when you intend to remove that access. The CLI asks for confirmation when dependents exist; use `--yes` only in an unattended workflow that has already checked usage. ## Pool activity metrics [#pool-activity-metrics] Read pool operational metrics from `GET /api/v1/metrics/pools/{pool_id}` (workspace-scoped; same time-range params as other metrics routes). The response includes `failover_served_calls`, `request_failures`, a `members` breakdown, and time-series buckets for the window. Use `failover_served_calls` to see how often traffic landed on a non-primary member after a failure. LLM audit events also carry `pool_id` so you can filter spend and denials by pool. Workspace and per-agent totals are on [Token usage and cost](/operate/observe#token-usage-and-cost). ## Attach to a Gateway [#attach-to-a-gateway] Attach a pool to a gateway so agents can request the pool by name at that gateway's model endpoints. The attachment makes the pool reachable but does not authorize an agent to call it. The agent must allow the gateway, and rules must permit both the pool and selected model. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome models pool gateways add production prod-llms ``` > **Note**: Reference: [`dome models pool gateways add`](/cli/connect/models#gateway-membership) **MCP** Tool: `dome_gateways_model_pool_add` ```json { "gateway": "prod-llms", "pool": "production" } ``` > **Note**: Reference: [`dome_gateways_model_pool_add`](/reference/mcp/gateway#dome_gateways_model_pool_add) **Agent** ```text title="Publish a model pool" Add the "production" model pool to the "prod-llms" Gateway. ``` ### Verify pool [#verify-pool] Call the pool through the gateway with an agent API key. A successful response confirms the pool is reachable, rules permit the route, and at least one member can serve the request. ```python title="OpenAI-compatible client" from openai import OpenAI client = OpenAI( api_key="{{DOME_AGENT_KEY}}", base_url="https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/v1", ) response = client.chat.completions.create( model="production", messages=[{"role": "user", "content": "Return OK."}], ) ``` If Dome cannot find the pool for the request, check the pool's gateway membership and model members. If Dome denies the request, check the agent's allowed resources and rules. Audit events record which model served the request and whether Dome attempted failover. ## Next steps [#next-steps] * [Pools](/concepts/resources/model-pools) concept for how routing and failover work and [Pools](/reference/resources/model-pools) reference for strategies and `match_when` * [Connect more models](/connect/models) to add providers or failover capacity * Manage membership and grants in [Gateways](/build/gateways) * Configure model and pool spend limits in [Cost Quotas](/govern/quotas) # Tools (/connect/tools)

{tool}

## Overview [#overview] Tools are one of the resource types Dome makes available to agents, alongside [models](/connect/models). When you add a tool, Dome stores its server endpoint, credentials, and egress headers. Dome records the operations the server exposes once the gateway connects to it. The typical workflow is: 1. [Add a tool](#add-tool) for the upstream MCP server. 2. If the server requires credentials, configure [upstream authentication](#upstream-authentication). 3. [Attach the tool to a gateway](#attach-to-a-gateway) to make it available through a Dome endpoint. 4. Allow the gateway on the [external agent](/build/agents/external#allowed-resources). 5. [Verify discovery](#verify-discovery) to confirm which operations the agent can use. ### Upstream authentication [#upstream-authentication] The gateway authenticates to the upstream with credentials you configure on the tool. Agent API keys authenticate inbound requests to Dome and never pass through as upstream credentials. Dome stores upstream secrets and injects them only at egress. Two settings control which credential the gateway sends. 1. The authentication method defines how the server verifies a request. | Auth method | When the upstream | | ----------- | ---------------------------------------- | | `none` | Requires no credential | | `api-key` | Accepts a static API key or bearer token | | `oauth` | Supports OAuth 2.0 or 2.1 | 2. The credential type defines whose credential the gateway sends. With shared credentials, every request reaches the upstream under the same service account. With per-user credentials, each request uses a credential linked to the verified end user, so the upstream applies that user's permissions. | Credential type | What the gateway sends | | --------------- | ----------------------------------------------- | | `none` | No credential | | `shared` | One workspace-managed credential for every call | | `per-user` | One credential per verified act-as subject | The two settings are not independent. The `none` method accepts only the `none` credential type, and `api-key` and `oauth` each require `shared` or `per-user`. When you omit the credential type, Dome pairs it with the method: `none` with `none`, `api-key` with `shared`, and `oauth` with `per-user`. OAuth also requires the `streamable-http` protocol, so a stdio tool cannot use it. You can set authentication when you [add a tool](#add-tool) or [change it later](#change-upstream-authentication). ### Secret handling [#secret-handling] Connection secrets are write-only. Dome stores their values for egress, but never returns them from a tool read, list, or header listing. When you update a tool, `--authorization` and `--secret-value` change only the keys you name. Omitted stored secrets keep their values. To remove a secret-sourced header and its stored value, use `dome tools header remove`. ### Egress headers [#egress-headers] Egress headers are values the gateway adds on the outbound request to the upstream. A header can be a literal string, a stored secret, or the verified act-as identity from the inbound request. Only a Streamable HTTP tool can carry them, because a stdio tool has no HTTP request to attach them to. An act-as header forwards the end-user assertion that the workspace admitted. The gateway does not apply a second strength ranking at egress: configure the accepted methods or required provider in the workspace Act-As policy. The call fails closed when no raw assertion is available, including bound and interactive session identity. An act-as header is not valid on a tool that authenticates with OAuth. You can set headers when you [add a tool](#add-tool), [change them on update](#change-egress-headers), or [manage them individually](#manage-egress-headers). ### Discovered tools [#discovered-tools] After the gateway connects to an upstream server, every operation that server exposes appears in the tool's catalog. You can change the status of one operation without removing the entire tool. For example, you can block `delete_page` while keeping `create_page` available to agents. | Status | Behavior | | ------------ | ---------------------------------------------- | | `active` | Discoverable and callable when rules allow | | `deprecated` | Callable, with a catalog warning | | `blocked` | Hidden from discovery and denied on invocation | Blocking an operation denies it even if another rule would permit it. Status persists when the gateway observes the operation again. Only a restore returns it to `active`. Refer to [Manage discovered tools](#manage-discovered-tools) for the operations that change these statuses. ## Requirements [#requirements] Before you begin: * Authenticate to Dome and select a workspace * Have the upstream MCP endpoint (URL for Streamable HTTP, or a local command for stdio) * Have upstream credentials when the server requires them * Have a [Gateway](/build/gateways) ready when you want the tool reachable ### Permissions [#permissions] Tool connection operations require platform permissions. Each operation states its required permission inline. | Default roles | Permission | Grants | | ------------------- | ----------------- | -------------------------------------------------------------- | | All workspace roles | `gateways.view` | List tools and inspect discovered operations | | `admin`, `operator` | `gateways.manage` | Add, update, and remove tools and manage discovered operations | ## Add tool [#add-tool] Add a tool for one upstream MCP server. Use Streamable HTTP for a remote server or stdio for a local process. You can set [upstream authentication](#upstream-authentication), [egress headers](#egress-headers), and gateway membership in the same call. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome tools add \ --name notion \ --url "https://mcp.notion.com/mcp" \ --protocol streamable-http \ --gateway prod-tools ``` If you do not define `--gateway`, the tool stays unreachable until you attach it. Add `--auth-method`, `--credential-type`, and header flags if the upstream needs them. > **Note**: Reference: [`dome tools add`](/cli/connect/tools#add-connection) **MCP** Tool: `dome_tools_add` ```json { "name": "notion", "url": "https://mcp.notion.com/mcp", "protocol": "streamable-http", "gateways": ["prod-tools"] } ``` > **Note**: Reference: [`dome_tools_add`](/reference/mcp/tools#dome_tools_add) **API** ```http POST /v1/tools Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "name": "notion", "protocol": "streamable-http", "protocol_config": { "url": "https://mcp.notion.com/mcp" } } ``` The endpoint returns the new tool's UUID, which every other management call uses to address it. > **Note**: Reference: [`CreateMCPServerConnection`](/api/tag/tools/create-mcp-server-connection) **Agent** ```text title="Attach an MCP server" Add a Streamable HTTP tool named "notion" at https://mcp.notion.com/mcp. Attach it to the "prod-tools" Gateway. ``` A tool remains unavailable to agents until you attach it to a gateway. You can configure authentication and headers before attaching it. ## Install a catalog adapter [#install-a-catalog-adapter] Install a Dome-managed REST adapter — Slack, GitHub, Notion, and other bundled integrations — as a workspace tool. The catalog hides the REST→MCP mapping: pick a slug, name the connection, and supply the upstream credential. Use catalog install when an adapter exists for your upstream. Direct creation with `protocol=rest` is rejected; the install RPC is the only path that produces a catalog-backed connection. For upstreams that already speak MCP, use [Add tool](#add-tool) with `streamable-http` or `stdio`. > **Note**: Requires `gateways.manage`. **Dashboard** 1. Open **tools → Add tool**. 2. Browse **Popular** (top adapters by popularity) or **All**, or search by name. 3. Pick an adapter, or choose the pinned **Custom MCP server** row for a direct MCP connection. 4. Name the connection, paste the upstream token, and choose **shared** or **per-user** credentials when the adapter supports both. 5. Optionally narrow the exposed tools with the tool filter. **API** ```http POST /dome.mgmt.v1.Management/InstallCatalogConnection Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "slug": "github", "name": "github-prod", "secret_values": { "Authorization": "Bearer {{GITHUB_TOKEN}}" }, "credential_type": "shared", "tool_filter": ["create_issue", "list_pull_requests"] } ``` | Field | Description | | ----------------- | ----------------------------------------------------------------------------------------------- | | `slug` | Catalog adapter slug. The latest enabled version is installed and pinned. | | `name` | Connection name (unique within the workspace). | | `secret_values` | Map of Vault secret key → value. Empty for adapters with `auth_method=none`. | | `credential_type` | `shared` (default) or `per-user`. Only honored when the adapter advertises `supports_per_user`. | | `tool_filter` | Optional subset of adapter tools to expose. Empty exposes all. | Browse adapters with [`ListCatalogServices`](/api/tag/tool-catalog/list-catalog-services). Each entry advertises `slug`, `auth_method`, the managed `auth_header_name`, and whether `supports_per_user` is allowed. ### Catalog adapter lifecycle [#catalog-adapter-lifecycle] | Operation | RPC | Effect | | --------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | Install | `InstallCatalogConnection` | Copies the latest catalog row onto a new `protocol=rest` connection, writes the credential to Vault, and pins the slug for upgrades. | | Upgrade | `UpgradeCatalogConnection` | Re-copies the adapter definition from the latest catalog version. Preserves the connection name, tool filter, and stored credential. | | Uninstall | `UninstallCatalogConnection` | Removes the connection and its Vault credential bundle. | ## Update tool [#update-tool] Update a tool to change its connection or security settings. You can change its URL, protocol, authentication, headers, or the operations Dome treats as writes. Switching between `api-key` and `oauth` clears the previously stored credentials. A header list always replaces the existing list rather than merging into it. How the other fields merge depends on the interface you use. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome tools update notion \ --url "https://mcp.notion.com/mcp" ``` Only the flags you pass change. > **Note**: Reference: [`dome tools update`](/cli/connect/tools#update-connection) **MCP** Tool: `dome_tools_update` ```json { "name": "notion", "url": "https://mcp.notion.com/mcp" } ``` Only the parameters you send change. > **Note**: Reference: [`dome_tools_update`](/reference/mcp/tools#dome_tools_update) **API** ```http PATCH /v1/tools/{{CONNECTION_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "protocol": "streamable-http", "protocol_config": { "url": "https://mcp.notion.com/mcp" } } ``` Send the record's full state. The endpoint overwrites `protocol`, `protocol_config`, `field_classifications`, and `write_tools` with whatever the request carries, so omitting `protocol_config` clears the URL and headers. Read the tool with `GetMCPServerConnection` first and send back everything you want to keep. `auth_method`, `credential_type`, `auth_config`, and `name` are the exceptions, where an empty value preserves the stored one. > **Note**: Reference: [`UpdateMCPServerConnection`](/api/tag/tools/update-mcp-server-connection) **Agent** ```text title="Update a tool" Update the "notion" tool URL to https://mcp.notion.com/mcp. ``` ### Change upstream authentication [#change-upstream-authentication] You can change how the gateway authenticates to the upstream. Refer to [Upstream authentication](#upstream-authentication) for the methods and credential types. #### Shared API key [#shared-api-key] Use a shared bearer token when every call should present the same upstream credential. Dome stores the secret and injects it at egress. Agents never receive the raw upstream credential. **CLI** ```bash dome tools update internal-search \ --auth-method api-key \ --credential-type shared \ --authorization "Bearer $SEARCH_TOKEN" ``` On create, the same flags work with `dome tools add`. Rotate a shared credential by sending its replacement value: ```bash dome tools update internal-search \ --authorization "Bearer $NEW_SEARCH_TOKEN" ``` The stored value is never shown again. Other stored secrets keep their values. > **Note**: Reference: [`dome tools update`](/cli/connect/tools#update-connection) **MCP** Tool: `dome_tools_update` ```json { "name": "internal-search", "auth_method": "api-key", "credential_type": "shared", "authorization": "Bearer {{SEARCH_TOKEN}}" } ``` > **Note**: Reference: [`dome_tools_update`](/reference/mcp/tools#dome_tools_update) **API** ```http PATCH /v1/tools/{{CONNECTION_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "auth_method": "api-key", "credential_type": "shared", "secret_values": { "Authorization": "Bearer {{SEARCH_TOKEN}}" } } ``` Send `protocol` and `protocol_config` alongside these fields, as described in [Update tool](#update-tool). > **Note**: Reference: [`UpdateMCPServerConnection`](/api/tag/tools/update-mcp-server-connection) **Agent** ```text title="Set shared API-key authentication" Set the "internal-search" tool to shared API-key authentication with my bearer token. ``` #### Shared OAuth [#shared-oauth] Configure the OAuth client on the tool, then [connect OAuth](#connect-oauth) to complete admin consent. When the upstream publishes RFC 8414 metadata, the gateway discovers its OAuth endpoints. Otherwise, you can provide the authorization, token, revocation, and registration URLs. The gateway supports manual and dynamic client registration. #### Per-user credentials [#per-user-credentials] You can set credential type to `per-user` when upstream authorization must follow the end user. Each request must include a verified act-as identity. Configure runtime act-as authentication in [Develop](/develop). When an end user has no credential yet, Dome returns `401` with a short-lived `provision_url`. The user opens that URL to enter an API key or complete OAuth consent, and the call succeeds on retry. Discovery flags the tool as needing credentials until provisioning finishes. Refer to [Errors and denials](/develop#errors-and-denials) for how a runtime should surface the prompt and retry. For per-user tools, [sync the catalog](#sync-catalog) after the admin attaches a per-user credential, so observed operations appear before agent traffic. ### Change egress headers [#change-egress-headers] You can change which egress headers the gateway sends, including an act-as header when the upstream needs the verified end user. Refer to [Egress headers](#egress-headers). An act-as header is not valid on a tool that authenticates with OAuth, and the update fails when you combine them. **CLI** ```bash dome tools update crm \ --header-actas X-Verified-User ``` To append without replacing the full list, use [Add headers](#add-headers). > **Note**: Reference: [`dome tools update`](/cli/connect/tools#update-connection) **MCP** Tool: `dome_tools_update` ```json { "name": "crm", "headers": [ {"name": "X-Verified-User", "source": "actas"} ] } ``` > **Note**: Reference: [`dome_tools_update`](/reference/mcp/tools#dome_tools_update) **API** ```http PATCH /v1/tools/{{CONNECTION_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "protocol": "streamable-http", "protocol_config": { "url": "https://crm.example.com/mcp", "headers": [ {"name": "X-Verified-User", "source": "actas"} ] } } ``` Headers live inside `protocol_config`, which the endpoint overwrites, so send the URL and any headers you want to keep in the same call. > **Note**: Reference: [`UpdateMCPServerConnection`](/api/tag/tools/update-mcp-server-connection) **Agent** ```text title="Forward verified act-as identity" Update the "crm" tool to forward verified act-as identity in X-Verified-User. ``` ## Get tool [#get-tool] Retrieve a tool by name to inspect its endpoint, protocol, authentication, and gateway membership. This information helps you verify its configuration before an update or troubleshoot why agents cannot reach it. > **Note**: Requires `gateways.view`. **CLI** ```bash dome tools get notion ``` > **Note**: Reference: [`dome tools get`](/cli/connect/tools#get-connection) **MCP** Tool: `dome_tools_get` ```json { "name": "notion" } ``` > **Note**: Reference: [`dome_tools_get`](/reference/mcp/tools#dome_tools_get) **API** ```http GET /v1/tools/{{CONNECTION_ID}}?workspace_id={{WORKSPACE_ID}} ``` The management API addresses a tool by UUID rather than by name. Call `ListMCPServerConnections` to resolve a name to its ID. > **Note**: Reference: [`GetMCPServerConnection`](/api/tag/tools/get-mcp-server-connection) **Agent** ```text title="Get a tool" Get the "notion" tool and confirm its auth method and Gateway membership. ``` ## List tools [#list-tools] Retrieve the tools in a workspace with their protocols and authentication methods. Use the list to find the tool you want to update or remove. > **Note**: Requires `gateways.view`. **CLI** ```bash dome tools list ``` > **Note**: Reference: [`dome tools list`](/cli/connect/tools#list-connections) **MCP** Tool: `dome_tools_list` ```json {} ``` > **Note**: Reference: [`dome_tools_list`](/reference/mcp/tools#dome_tools_list) **API** ```http GET /v1/tools?workspace_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`ListMCPServerConnections`](/api/tag/tools/list-mcp-server-connections) **Agent** ```text title="List tools" List the tools in this workspace. ``` ## Remove tool [#remove-tool] Remove a tool to delete its upstream record from the workspace, along with the authentication and header configuration stored on it. > **Note**: Requires `gateways.manage`. > **Warning**: Removing a tool disconnects every agent currently routing through it. Update or re-route agents first. **CLI** ```bash dome tools remove notion ``` > **Note**: Reference: [`dome tools remove`](/cli/connect/tools#remove-connection) **MCP** Tool: `dome_tools_remove` ```json { "name": "notion" } ``` > **Note**: Reference: [`dome_tools_remove`](/reference/mcp/tools#dome_tools_remove) **API** ```http DELETE /v1/tools/{{CONNECTION_ID}}?workspace_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`DeleteMCPServerConnection`](/api/tag/tools/delete-mcp-server-connection) **Agent** ```text title="Remove a tool" Remove the "notion" tool after confirming no agents still depend on it. ``` ## Manage discovered tools [#manage-discovered-tools] Catalog status lets you block or deprecate individual operations without removing the entire tool. Status persists when the gateway observes the operation again. Only a restore returns it to `active`. Refer to [Discovered tools](#discovered-tools) for the behavior of each status. You can block, deprecate, and restore operations through the CLI and MCP. The API reference documents catalog sync only. ### List catalog [#list-catalog] Retrieve the operations Dome has recorded for a tool. Because Dome stores the catalog, you can inspect it when the upstream server is unavailable. The result covers everything Dome discovered on the server, not what one agent can call. > **Note**: Requires `gateways.view`. **CLI** ```bash dome tools catalog list notion --seen-since 7d ``` Blocked entries are hidden unless you pass `--show-blocked`. Use `--with-schema` when you need input schemas. > **Note**: Reference: [`dome tools catalog list`](/cli/connect/tools#list-tools) **MCP** Tool: `dome_tools_for_connection` ```json { "name": "notion", "with_schema": false } ``` > **Note**: Reference: [`dome_tools_for_connection`](/reference/mcp/tools#dome_tools_for_connection) **Agent** ```text title="List discovered operations" List the operations Dome has discovered on the "notion" tool. ``` ### Sync catalog [#sync-catalog] Sync the catalog to discover operations on a per-user tool before agent traffic begins. The gateway calls upstream `tools/list` with the administrator's per-user credential, so that credential must already be attached. Shared tools sync when the gateway starts and reject manual sync. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome tools catalog sync notion ``` > **Note**: Reference: [`dome tools catalog sync`](/cli/connect/tools#sync-tools) **API** ```http POST /v1/tools/{{CONNECTION_ID}}/catalog/sync Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}" } ``` Add `act_as_sub` when the administrator's act-as subject is not their email. Dome resolves the credential by that subject, and the call fails when no credential is stored for it. > **Note**: Reference: [`SyncMCPServerConnectionTools`](/api/tag/tools/sync-mcp-server-connection-tools) ### Block [#block] Block a discovered operation to hide it from agents and deny calls to it. A block overrides any rule that would otherwise permit the operation. A blocked operation drops out of the catalog listing, so confirming a block means asking for blocked entries as well. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome tools catalog block notion delete_page \ --message "Use archive_page instead" ``` > **Note**: Reference: [`dome tools catalog block`](/cli/connect/tools#block-tool) **MCP** Tool: `dome_tools_block` ```json { "connection": "notion", "tool": "delete_page", "message": "Use archive_page instead" } ``` > **Note**: Reference: [`dome_tools_block`](/reference/mcp/tools#dome_tools_block) **Agent** ```text title="Block a discovered tool" Block "delete_page" on the "notion" tool and recommend "archive_page". ``` ### Deprecate [#deprecate] Deprecate a discovered operation to keep it callable while directing users to a replacement. The deprecation message appears in the dashboard, and the catalog lists the operation as `deprecated`. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome tools catalog deprecate notion create_page \ --message "use create_page_v2" ``` > **Note**: Reference: [`dome tools catalog deprecate`](/cli/connect/tools#deprecate-tool) **MCP** Tool: `dome_tools_deprecate` ```json { "connection": "notion", "tool": "create_page", "message": "use create_page_v2" } ``` > **Note**: Reference: [`dome_tools_deprecate`](/reference/mcp/tools#dome_tools_deprecate) **Agent** ```text title="Deprecate a discovered tool" Deprecate "create_page" on the "notion" tool and recommend "create_page_v2". ``` ### Restore [#restore] Restore a discovered operation to make it available again when rules permit. Restoring clears its block or deprecation. When no blocked operations remain, Dome removes the managed denies. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome tools catalog restore notion delete_page ``` > **Note**: Reference: [`dome tools catalog restore`](/cli/connect/tools#restore-tool) **MCP** Tool: `dome_tools_restore` ```json { "connection": "notion", "tool": "delete_page" } ``` > **Note**: Reference: [`dome_tools_restore`](/reference/mcp/tools#dome_tools_restore) **Agent** ```text title="Restore a discovered tool" Restore "delete_page" on the "notion" tool to active. ``` ## Attach to a Gateway [#attach-to-a-gateway] Attach a tool to a gateway to expose its operations through the gateway's MCP endpoint. Attaching the entire tool also exposes operations discovered later. Membership makes the tool reachable but does not authorize an agent to call it. The agent must allow the gateway, and rules must permit the call. You can attach a tool when you [add it](#add-tool) or later from either the tool or gateway. Refer to [Gateways](/build/gateways) for membership and grants. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome tools gateways add notion prod-tools ``` The gateway side of the same membership is `dome gateways tool-sources add`. > **Note**: Reference: [`dome tools gateways`](/cli/connect/tools#gateway-membership) **MCP** Tool: `dome_gateways_tool_source_add` ```json { "gateway": "prod-tools", "connection": "notion" } ``` > **Note**: Reference: [`dome_gateways_tool_source_add`](/reference/mcp/gateway#dome_gateways_tool_source_add) **Agent** ```text title="Publish a tool" Add the entire "notion" tool to the "prod-tools" Gateway. ``` ### Verify discovery [#verify-discovery] Call `tools/list` on the gateway endpoint with an agent's API key. The response applies gateway membership and rules, so it shows what that one agent can use. The stored catalog in [List catalog](#list-catalog) applies neither check. ```bash curl -X POST "https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/mcp" \ -H "Authorization: Bearer {{DOME_AGENT_KEY}}" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' ``` If an operation is missing, check the tool's health, catalog status, gateway membership, the agent's allowed resources, and rules. ## Manage OAuth [#manage-oauth] With shared OAuth, an administrator completes consent once after configuring the OAuth client. With per-user OAuth, each end user completes consent on their first call. ### Register a manual OAuth client [#register-a-manual-oauth-client] Register Dome's exact callback URI with your authorization server before you configure a manually registered OAuth client. Ask the connected Dome server for that URI instead of constructing it yourself: ```bash dome tools oauth-redirect-uri ``` Then configure the tool with the registered client ID and secret: ```bash dome tools update {{TOOL_NAME}} \ --auth-method oauth \ --credential-type shared \ --oauth-client-origin manual \ --oauth-client-id {{OAUTH_CLIENT_ID}} \ --oauth-client-secret {{OAUTH_CLIENT_SECRET}} ``` The client secret is write-only. A later update can leave it unchanged by omitting `--oauth-client-secret`. ### Connect OAuth [#connect-oauth] Connect OAuth to begin the admin consent flow. The response includes a one-shot URL valid for about ten minutes. Open it and complete consent at the upstream authorization server. Dome stores the resulting OAuth tokens. On a shared tool, those tokens serve every call. On a per-user tool, the flow attaches the calling administrator's own credential, which [Sync catalog](#sync-catalog) then reads to discover operations before agent traffic starts. End users still complete their own consent on their first call. > **Note**: Requires `gateways.manage`. The tool must use `auth_method=oauth`. **CLI** ```bash dome tools oauth-connect notion ``` The CLI and the MCP tool accept shared tools only. To attach an administrator's per-user credential, call the API with that administrator's act-as subject. > **Note**: Reference: [`dome tools oauth-connect`](/cli/connect/tools#connect-oauth) **MCP** Tool: `dome_tools_oauth_connect` ```json { "name": "notion" } ``` > **Note**: Reference: [`dome_tools_oauth_connect`](/reference/mcp/tools#dome_tools_oauth_connect) **API** ```http POST /v1/tools/{{CONNECTION_ID}}/oauth/connect Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}" } ``` On a per-user tool, add `act_as_sub` to name the administrator whose credential this flow attaches. It defaults to the calling administrator's email, and it is required when the workspace's act-as verifier issues opaque subjects. > **Note**: Reference: [`BeginMCPServerOAuthConnect`](/api/tag/tools/begin-mcp-server-oauth-connect) **Agent** ```text title="Connect shared OAuth" Start shared OAuth consent for the "notion" tool. ``` ### Disconnect OAuth [#disconnect-oauth] Disconnect shared OAuth to revoke its stored tokens. The OAuth client configuration remains, so you can reconnect without configuring the client again. Disconnecting an already disconnected tool has no effect. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome tools oauth-disconnect notion ``` > **Note**: Reference: [`dome tools oauth-disconnect`](/cli/connect/tools#disconnect-oauth) **MCP** Tool: `dome_tools_oauth_disconnect` ```json { "name": "notion" } ``` > **Note**: Reference: [`dome_tools_oauth_disconnect`](/reference/mcp/tools#dome_tools_oauth_disconnect) **API** ```http POST /v1/tools/{{CONNECTION_ID}}/oauth/disconnect Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}" } ``` > **Note**: Reference: [`DisconnectMCPServerOAuth`](/api/tag/tools/disconnect-mcp-server-oauth) **Agent** ```text title="Disconnect shared OAuth" Disconnect shared OAuth credentials for the "notion" tool. ``` ## Manage egress headers [#manage-egress-headers] You can add or remove individual headers without replacing the full list. These operations are available only through the CLI. MCP and API callers change headers through [Update tool](#update-tool), which replaces the whole list. ### List headers [#list-headers] Retrieve the outbound headers configured on a tool. > **Note**: Requires `gateways.view`. **CLI** ```bash dome tools header list notion ``` > **Note**: Reference: [`dome tools header list`](/cli/connect/tools#list-headers) ### Add headers [#add-headers] Add one or more outbound headers without replacing the headers already configured on a tool. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome tools header add crm --header-actas X-Verified-User ``` You can combine literal, secret, and act-as header flags in one call. > **Note**: Reference: [`dome tools header add`](/cli/connect/tools#add-header) ### Remove headers [#remove-headers] Remove outbound headers by name from a tool. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome tools header remove crm --name X-Verified-User ``` > **Note**: Reference: [`dome tools header remove`](/cli/connect/tools#remove-header) ## Next steps [#next-steps] * [Tools](/concepts/resources/tools) concept for how connections and catalogs work and [Tools](/reference/resources/tools) reference for auth methods and catalog statuses * [Register external agents](/build/agents/external) and allow the resources they need * Manage gateway membership and grants in [Gateways](/build/gateways) * Authenticate and route runtime traffic in [Develop](/develop#authenticate) # Develop with Dome (/develop) **Develop** wires an agent into product code against agents, gateways, and Resources already configured in Dome. Authenticate as an agent, call tools and models through a gateway, pass identity for delegated agents when needed, and handle denials. Refer to [Architecture](/concepts/architecture) concept for the request path. Refer to [Gateways](/concepts/gateways) concept for reachability. ## Overview [#overview] Dome separates configuration from the client path. Build, Connect, and Govern define what an agent may reach and do. Develop covers the runtime client path: which credential to send, which gateway URL to call, whether to attach act-as identity, and how to handle denials. Point every client at a gateway path that includes `/gateways/{{GATEWAY_ID}}`. A bare host fails closed. The typical workflow is: 1. [Authenticate](#authenticate) with an agent key or short-lived JWT. 2. [Route traffic](#route-traffic) to MCP and model endpoints on the gateway. 3. Optionally [pass identity for delegated agents](#pass-identity-for-delegated-agents) when access depends on the person behind the agent. 4. [Handle errors and denials](#errors-and-denials) from the gateway. ### Runtime credentials [#runtime-credentials] The gateway accepts either credential form as a bearer (or Anthropic `x-api-key`): * **Agent API key** is a long-lived secret for services and hosted clients. Send it on every request, or exchange it for a JWT. * **Short-lived JWT** is exchanged from the key through the Dome API when your runtime rotates credentials. Cache until expiry. Do not exchange on every call. The management API accepts JWTs only. Store agent keys as secrets. Never send an upstream model or MCP credential from application code. The gateway injects configured credentials after authorization. Details are under [Authenticate](#authenticate). ### Gateway URL [#gateway-url] Use one gateway URL for each runtime client: ```bash export DOME_AGENT_KEY="{{DOME_AGENT_KEY}}" export DOME_GATEWAY_URL="https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}" ``` Client bases append protocol paths to that URL: | Client | Runtime URL | | --------- | ----------------------- | | MCP | `$DOME_GATEWAY_URL/mcp` | | OpenAI | `$DOME_GATEWAY_URL/v1` | | Anthropic | `$DOME_GATEWAY_URL` | Membership on the gateway determines which tools and models the endpoint exposes. Grants and rules still decide admission and actions. Build and verify URLs on [Gateways](/build/gateways#build-the-runtime-endpoint). Call examples are under [Route traffic](#route-traffic). ### Delegated identity on the wire [#delegated-identity-on-the-wire] When the agent is delegated, every governed request carries verified end-user evidence in `X-Dome-Act-As`. Configure providers and the agent method in [Delegated agents](/build/agents/delegated). Application code only attaches the header. It does not verify the claim. Refer to [Pass identity for delegated agents](#pass-identity-for-delegated-agents). ## Requirements [#requirements] Before you begin: * Register an [external agent](/build/agents/external), create its key, and [grant it access](/build/gateways#manage-agent-access) to a gateway that already has the tools or models you need as members * Confirm rules (and guards or quotas, if used) allow the calls you will make * Set `DOME_AGENT_KEY` and `DOME_GATEWAY_URL` as shown in [gateway URL](#gateway-url) Configure MCP servers, model connections, pools, credentials, and gateway membership in [Connect](/connect). Configure authorization and filtering in [Govern](/govern). ### Permissions [#permissions] Runtime calls use the agent key and Cedar rules, not workspace RBAC. Platform permissions apply when you manage agents, gateways, or rules in Connect and Govern. ## Authenticate [#authenticate] Present the agent key on every runtime request. The gateway authenticates the agent before it evaluates gateway admission or Cedar policy. Use either credential form: * **Agent API key:** Send the key directly for long-running services and hosted clients. * **Short-lived JWT:** Exchange the key for a token when your runtime rotates credentials. The gateway accepts both forms as bearer credentials. The management API accepts JWTs only. ### Send the agent key [#send-the-agent-key] Send the key in the `Authorization` header for MCP and OpenAI-shaped requests: ```http Authorization: Bearer {{DOME_AGENT_KEY}} ``` Anthropic clients send their configured `api_key` as `x-api-key` on `/v1/messages` and `/v1/messages/count_tokens`. The gateway promotes it into the same agent identity pipeline. ```http x-api-key: {{DOME_AGENT_KEY}} anthropic-version: 2023-06-01 ``` `Authorization` takes precedence when both headers are present. Other runtime routes require bearer authentication. ### Exchange the key for a JWT [#exchange-the-key-for-a-jwt] Exchange the key at the Dome API's OAuth 2.0 token endpoint, then cache the token until its expiry. Set `DOME_AGENT_ID` to the agent's ID, and send the ID and key as HTTP Basic credentials: ```python import os import httpx response = httpx.post( "https://api.domesystems.ai/api/v1/auth/token", auth=(os.environ["DOME_AGENT_ID"], os.environ["DOME_AGENT_KEY"]), data={"grant_type": "client_credentials"}, ) response.raise_for_status() token = response.json()["access_token"] expires_in = response.json()["expires_in"] ``` The default lifetime is 10 minutes. Refresh before `expires_in`. Do not exchange a token for every gateway call. Parameters, gateway selection, errors, and MCP client setup are on [OAuth client credentials](/develop/oauth-client-credentials). > **Warning**: Store agent keys as secrets. Never send an upstream model or MCP credential from application code. The gateway injects configured credentials after authorization. ## Route traffic [#route-traffic] Send runtime traffic to the gateway that contains the required tools or pools. Dome resolves the resource, authorizes the call, injects upstream credentials, and records the result. ### Call MCP tools [#call-mcp-tools] Use an MCP Streamable HTTP client against the gateway's `/mcp` endpoint: ```python import asyncio import os from mcp import ClientSession from mcp.client.streamable_http import streamable_http_client async def main(): headers = { "Authorization": f"Bearer {os.environ['DOME_AGENT_KEY']}", } async with streamable_http_client( f"{os.environ['DOME_GATEWAY_URL']}/mcp", headers=headers, ) as (read, write, _): async with ClientSession(read, write) as session: await session.initialize() catalog = await session.list_tools() print([tool.name for tool in catalog.tools]) result = await session.call_tool( "github/list_issues", {"repo": "dome"}, ) print(result.content) asyncio.run(main()) ``` `tools/list` returns only tools in the selected gateway that the agent may discover. `tools/call` evaluates authorization again for the requested tool. MCP Streamable HTTP can return normal JSON or an SSE response. Keep the session open until the client consumes the complete result. ### Call models [#call-models] Point an OpenAI or Anthropic client at the gateway. Set `model` to a Dome pool or connection name. The gateway preserves each client's native response shape and translates requests upstream only after resource resolution and authorization. **OpenAI** Point the OpenAI client at the gateway's `/v1` base. Pass the agent key as `api_key`. ```python import os from openai import OpenAI client = OpenAI( api_key=os.environ["DOME_AGENT_KEY"], base_url=f"{os.environ['DOME_GATEWAY_URL']}/v1", ) response = client.chat.completions.create( model="production", messages=[ {"role": "user", "content": "Summarize the open incidents."}, ], ) print(response.choices[0].message.content) ``` The same base supports `/chat/completions`, `/responses`, `/embeddings`, `/moderations`, and `/models`. Provider support can vary for embeddings, moderation, and Responses API calls. `POST /v1/embeddings` honors OpenAI's `encoding_format` on the request body. With `float` (or omitted), the response is a JSON array of floats. With `base64`, the response is little-endian IEEE-754 float32 bytes as a string. The gateway always fetches float vectors upstream and re-encodes for the caller. Token accounting is unchanged. Any other value returns HTTP `400`. Ingress routes are on the [LLM gateway](/concepts/gateways/llm-gateway#endpoints) concept. Stream Chat Completions by setting `stream=True`: ```python stream = client.chat.completions.create( model="production", messages=[ {"role": "user", "content": "Draft a short incident update."}, ], stream=True, ) for chunk in stream: delta = chunk.choices[0].delta.content if delta: print(delta, end="", flush=True) ``` Consume the iterator until completion. Once the first SSE event reaches the client, the gateway cannot fail over to another model connection. **Anthropic** Point the Anthropic client at the gateway root. The SDK appends `/v1/messages` and sends the agent key through `x-api-key`. ```python import os from anthropic import Anthropic client = Anthropic( api_key=os.environ["DOME_AGENT_KEY"], base_url=os.environ["DOME_GATEWAY_URL"], ) message = client.messages.create( model="production", max_tokens=512, messages=[ {"role": "user", "content": "Summarize the open incidents."}, ], ) print(message.content[0].text) ``` Use the Anthropic streaming helper for SSE: ```python with client.messages.stream( model="production", max_tokens=512, messages=[ {"role": "user", "content": "Draft a short incident update."}, ], ) as stream: for text in stream.text_stream: print(text, end="", flush=True) ``` Choose the target by setting the request's `model`: 1. An exact pool name selects that pool. 2. An exact connection name selects that connection. 3. A provider model ID selects a matching connection. 4. A configured routing predicate can select a pool. 5. The workspace default pool handles the remaining request. Application code chooses a logical target. Resolution order and `match_when` are on the [Pools](/reference/resources/model-pools#pool-resolution) reference. Define membership, strategies, and failover on [Pools](/connect/pools) and connections on [Models](/connect/models). ## Pass identity for delegated agents [#pass-identity-for-delegated-agents] When the agent is [delegated](/build/agents/delegated), attach the human identity on each request. The gateway verifies it before Cedar, routing, per-user credentials, or backend forwarding uses it. Send the evidence in `X-Dome-Act-As` on MCP, OpenAI, and Anthropic requests. Match the wire value to the agent's configured verification method. The method-to-header table is on [Delegated agents](/build/agents/delegated#verification-methods). Prefer OIDC or bound identity for production traffic. Configure providers on [Delegated agents](/build/agents/delegated#create-a-verification-provider). ### Pass OIDC identity to MCP [#pass-oidc-identity-to-mcp] Add the end-user token to the session headers: ```python headers = { "Authorization": f"Bearer {os.environ['DOME_AGENT_KEY']}", "X-Dome-Act-As": end_user_oidc_token, } ``` Reuse the same headers for `tools/list` and `tools/call`. Discovery can include per-user credential advisories specific to that identity. ### Pass OIDC identity to OpenAI [#pass-oidc-identity-to-openai] Create a client for the current user or pass the header per request: ```python client = OpenAI( api_key=os.environ["DOME_AGENT_KEY"], base_url=f"{os.environ['DOME_GATEWAY_URL']}/v1", default_headers={"X-Dome-Act-As": end_user_oidc_token}, ) ``` Do not reuse a user-bound client across users. Pool clients by verified user only when token lifetime and isolation rules permit it. ### Pass OIDC identity to Anthropic [#pass-oidc-identity-to-anthropic] Set the same header through the Anthropic client: ```python client = Anthropic( api_key=os.environ["DOME_AGENT_KEY"], base_url=os.environ["DOME_GATEWAY_URL"], default_headers={"X-Dome-Act-As": end_user_oidc_token}, ) ``` The gateway keeps the agent and end user distinct. Agent authentication identifies the workload. Act-as evidence identifies the human represented by that workload. ### Use identity at runtime [#use-identity-at-runtime] Verified claims populate `principal.act_as` for authorization and routing: * `principal.act_as.sub` * `principal.act_as.email` * `principal.act_as.roles` * `principal.act_as.groups` * `principal.act_as.claims.` Per-user connections key credentials by the verified `sub`. If the user has not connected a credential, follow the provisioning response in [Errors and denials](#errors-and-denials). The gateway forwards act-as identity upstream only when the connection explicitly configures an act-as-sourced header. Keep that egress choice in [Connect](/connect/tools#change-egress-headers). ## Errors and denials [#errors-and-denials] Separate authentication failures, missing user credentials, authorization denials, and upstream failures. Each requires a different application response. | Status | Meaning | Application action | | ------ | ------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `400` | Missing or malformed gateway path, or invalid request | Fix the client URL or request | | `401` | Invalid agent credential, required act-as identity, or (model routes) missing per-user credential | Reauthenticate or start user provisioning | | `403` | Dome policy denied the call | Surface the reason. Do not retry unchanged | | `404` | Requested tool, model, pool, or connection is unavailable | Refresh discovery or fix the target | | `429` | Rate or usage limit reached | Back off or wait for the configured window | | `5xx` | gateway or upstream service failure | Retry with bounded exponential backoff | ### Agent-facing prompt protocol [#agent-facing-prompt-protocol] When a call needs the end user's own account for a per-user connection and they haven't connected it (or the upstream rejected the one they connected), the gateway answers with a sign-in link for that person. Give it to the end user, then retry after they finish. For MCP: * `tools/list` lists a per-user connection's tools even before the person connects: they see its published tools, filled by the accounts already connected to it, starting with the connection's creator. Once connected, they see their own account's tools. * `tools/call` answers with MCP's standard URL-elicitation error (`-32042`, MCP revision 2025-11-25) on HTTP `200`. `error.data.elicitations` carries the link as a URL-mode elicitation, so a client that supports URL elicitation can open it and retry. The link is also in `error.message`, and `error.data` keeps `type: "dome.credential_required"`, `connection`, `provision_url`, `expires_at`, and `credential_state: "rejected"` when the upstream refused the account they had. For OpenAI- and Anthropic-shaped routes, a missing per-user credential returns `401 Unauthorized` before a stream starts, with `WWW-Authenticate: Bearer realm="dome", error="invalid_token", resource_metadata=""` and a top-level `dome_credential_required` sibling carrying `connection`, `provision_url`, and `expires_at`. Per-user model requests also need an `X-Dome-Act-As` identity. Without act-as, the gateway returns `401` with a plain permission error and does not mint a link. Do not mint or open the URL in a background service. Present it to the represented end user. The link names the person it is for, works once, and expires after 10 minutes. If it expires, the next call against the same connection mints a fresh one. **MCP** ```json title="JSON-RPC error response (HTTP 200)" { "jsonrpc": "2.0", "id": 1, "error": { "code": -32042, "message": "Credential required for connection \"atlassian\". Provision your token at https://app.domesystems.ai/u/oauth/start?t=…", "data": { "elicitations": [ { "mode": "url", "elicitationId": "4f0c2b6e-…", "url": "https://app.domesystems.ai/u/oauth/start?t=…", "message": "Connect your account to atlassian to use its tools." } ], "type": "dome.credential_required", "connection": "atlassian", "provision_url": "https://app.domesystems.ai/u/oauth/start?t=…", "expires_at": "2026-04-29T18:30:00Z" } } } ``` **LLM (OpenAI)** ```json title="OpenAI-flavored 401 body" { "error": { "message": "Per-user credential required for connection \"openai-prod\". Provision your token at https://app.domesystems.ai/u/creds/start?token=…", "type": "permission_error", "code": "dome.credential_required" }, "dome_credential_required": { "connection": "openai-prod", "provision_url": "https://app.domesystems.ai/u/creds/start?token=…", "expires_at": "2026-04-29T18:30:00Z" } } ``` **LLM (Anthropic)** ```json title="Anthropic-flavored 401 body" { "type": "error", "error": { "type": "permission_error", "message": "Per-user credential required for connection \"anthropic-prod\". Provision your token at https://app.domesystems.ai/u/creds/start?token=…" }, "dome_credential_required": { "connection": "anthropic-prod", "provision_url": "https://app.domesystems.ai/u/creds/start?token=…", "expires_at": "2026-04-29T18:30:00Z" } } ``` ### Authorization denial protocol [#authorization-denial-protocol] When the gateway denies a request, it returns a structured `dome_authorization_denied` extension alongside the native error body. The extension explains which rule fired so you can surface feedback in agent UIs and alert on the deciding policy. * **MCP** — JSON-RPC `error.data`, with `error.data.type = "dome.authorization_denied"` * **LLM (OpenAI)** — top-level `dome_authorization_denied`, plus `error.code = "dome.authorization_denied"` * **LLM (Anthropic)** — top-level `dome_authorization_denied`. The Anthropic envelope has no `code` field > **Warning**: Detect the deny on the **presence of the `dome_authorization_denied` sibling** (OpenAI/Anthropic) or `error.data.type == "dome.authorization_denied"` (MCP). Do not key off `error.code`. The Anthropic envelope omits it, and a client that branches on `code` silently misses every Anthropic denial. | Field | Type | Description | | -------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | | `reason_code` | string | Closed vocabulary. Today every Cedar / fail-closed deny resolves to `permission_denied`. Treat unknown values as a generic deny. | | `reason` | string | Verbatim human reason from the decision (for example `denied by rule: workspace/billing.policy0`). Secret-free by construction. | | `depth` | string | `deterministic` when Cedar decided the call. | | `determining_policy` | string (optional) | The Cedar rule/policy id that fired an explicit `forbid`. Empty on a no-match default-deny. | **MCP** ```json title="JSON-RPC error response" { "jsonrpc": "2.0", "id": 1, "error": { "code": -32001, "message": "denied by rule: workspace/billing.policy0", "data": { "type": "dome.authorization_denied", "reason_code": "permission_denied", "reason": "denied by rule: workspace/billing.policy0", "depth": "deterministic", "determining_policy": "workspace/billing.policy0" } } } ``` **LLM (OpenAI)** ```json title="OpenAI-flavored 403 body" { "error": { "message": "denied by rule: workspace/billing.policy0", "type": "permission_error", "code": "dome.authorization_denied" }, "dome_authorization_denied": { "reason_code": "permission_denied", "reason": "denied by rule: workspace/billing.policy0", "depth": "deterministic", "determining_policy": "workspace/billing.policy0" } } ``` **LLM (Anthropic)** ```json title="Anthropic-flavored 403 body" { "type": "error", "error": { "type": "permission_error", "message": "denied by rule: workspace/billing.policy0" }, "dome_authorization_denied": { "reason_code": "permission_denied", "reason": "denied by rule: workspace/billing.policy0", "depth": "deterministic", "determining_policy": "workspace/billing.policy0" } } ``` ```python def explain_deny(body: dict) -> str | None: deny = body.get("dome_authorization_denied") if not deny: return None reason = deny.get("reason", "Request denied") policy = deny.get("determining_policy") return f"{reason} (policy: {policy})" if policy else reason ``` Allow responses carry no `dome_authorization_denied` field. Treat policy denials as final for the unchanged request. Show a safe reason to the user and record the request's activity or trace identifier. ### Handle streaming failures [#handle-streaming-failures] Authentication, act-as validation, per-user credential checks, and initial authorization run before the first model SSE event. These failures arrive as normal HTTP errors. After streaming begins: * Treat a broken connection as an incomplete response. * Do not assume the gateway retried another model. * Discard partial structured output unless your application validates it. * Retry only when the operation is safe and your client can prevent duplicates. Output filtering can buffer streamed text before release. Do not set client read timeouts so low that normal filter buffering appears as an outage. ### Retry safely [#retry-safely] Retry timeouts, connection failures, `429`, and transient `5xx` responses with bounded exponential backoff. Honor `Retry-After` when present. Do not automatically retry `400`, `401`, or `403`. Refresh an expired agent token, complete user provisioning, or change the denied request first. ## Next steps [#next-steps] * [Connect](/connect) to attach resources, group them in gateways, and configure routing * [Govern](/govern) to authorize actions, assign guards, and set quotas * [Stream Live Events](/operate/observe) to trace calls, denials, latency, and model usage * [Agent Identity](/concepts/agents/identity) concept for keys, tokens, and act-as claims in more depth # OAuth client credentials (/develop/oauth-client-credentials) Exchange an agent's API key for a short-lived access token with the standard OAuth 2.0 client credentials grant. Use it when an MCP client or agent runtime authenticates only through a token endpoint, not a static bearer key. Refer to [Agent Identity](/concepts/agents/identity) concept for how keys and tokens relate. ## Overview [#overview] The agent is the OAuth client. Its agent ID is the client ID and its API key is the client secret. The token endpoint returns a short-lived bearer token, and the agent sends that token to its gateway in place of the key. | Setting | Value | | --------------------- | ---------------------------------------------------------------------------- | | Token endpoint | `https://api.domesystems.ai/api/v1/auth/token` | | Grant type | `client_credentials` | | Client authentication | HTTP Basic (`client_secret_basic`) | | Client ID | The agent ID, a UUID | | Client secret | The agent API key | | Scope | Optional: omit it or request `mcp` | | Token lifetime | The agent's [token lifetime](/build/agents#token-lifetime), `10m` by default | The token endpoint lives on the Dome API host, not the gateway host. The authorization server metadata at `https://api.domesystems.ai/.well-known/oauth-authorization-server` lists the same `token_endpoint`. On a self-managed deployment, use your own Dome API host. Three behaviors differ from what some OAuth clients expect: * **HTTP Basic only.** A request with `client_id` or `client_secret` in the form body is rejected, even when the `Authorization` header is also present. * **One optional scope.** Omit `scope`, or request `mcp` when a client discovers it from gateway metadata. Other scope values are rejected with `invalid_scope`. * **No refresh token.** Request a new access token with the same credentials before the current one expires. ## Requirements [#requirements] Before you begin: * Register an [agent](/build/agents) and [create an API key](/build/agents#create-key). The key's one-time `token` value is the client secret. * [Grant the agent access](/build/gateways#manage-agent-access) to the gateway it calls. * Record the agent ID. Run `dome agents get --json` and read `agent.id`. Send the agent ID exactly as Dome returns it, in lowercase hyphenated form. Any other spelling does not match the key's agent. ### Permissions [#permissions] Requesting a token needs no platform permission, because the API key authenticates the agent. > **Note**: Requires `agentkeys.manage` to create the API key. ## Request a token [#request-a-token] Send the grant as a form-encoded `POST`, with the agent ID and key in an HTTP Basic header: ```bash title="Request an access token" curl -X POST https://api.domesystems.ai/api/v1/auth/token \ -u "{{AGENT_ID}}:{{DOME_AGENT_KEY}}" \ -d grant_type=client_credentials ``` Add `-d gateway_id={{GATEWAY_ID}}` when the agent can reach more than one gateway. Refer to [Select a gateway](#select-a-gateway). ### Parameters [#parameters] | Parameter | Required | Description | | ------------ | ---------------------------------------------- | -------------------------------------------------------------------------------- | | `grant_type` | Yes | `client_credentials` | | `gateway_id` | When the agent can reach more than one gateway | The gateway whose endpoints the response returns, as a lowercase hyphenated UUID | | `scope` | No | Omit it, or set it to `mcp`. Other values are not supported. | The request also needs two headers: | Header | Value | | --------------- | ---------------------------------------------------------------------------- | | `Authorization` | `Basic` followed by the base64 encoding of `{{AGENT_ID}}:{{DOME_AGENT_KEY}}` | | `Content-Type` | `application/x-www-form-urlencoded` | ### Response [#response] ```json title="Token response" { "access_token": "eyJ…", "token_type": "Bearer", "expires_in": 600, "gateway_id": "{{GATEWAY_ID}}", "gateway_endpoints": { "gateway_url": "https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}", "mcp_url": "https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/mcp", "openai_base_url": "https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/v1", "anthropic_base_url": "https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}" } } ``` | Field | Description | | ------------------- | -------------------------------------------------------------------- | | `access_token` | A signed JWT. Treat it as opaque and send it as a bearer credential. | | `token_type` | Always `Bearer`. | | `expires_in` | Seconds until the token expires. | | `gateway_id` | The selected gateway. | | `gateway_endpoints` | Call-ready URLs for the selected gateway. MCP clients use `mcp_url`. | The response carries no `refresh_token` and no `scope`. Clients that ignore unknown fields can disregard `gateway_id` and `gateway_endpoints`. ### Select a Gateway [#select-a-gateway] When you omit `gateway_id`, Dome selects the one enabled gateway that grants the agent access. If the agent can reach none, or more than one, the request fails with `invalid_target`. Send `gateway_id` to choose among several. A named gateway must be enabled, belong to the agent's workspace, and grant the agent access. Otherwise the request fails with `invalid_target`, which does not say which condition failed. `gateway_id` chooses the endpoints the response returns. It does not bind the token to that gateway. The token works at every gateway in the agent's workspace that grants the agent access, and each gateway checks that grant on every request. The token also authenticates the agent's own calls to the Dome API. ### Token lifetime [#token-lifetime] `expires_in` matches the agent's [token lifetime](/build/agents#token-lifetime): `10m` unless you set a value between `1m` and `24h`. Cache the token and reuse it until shortly before it expires, then request a new one. Do not request a token for every call. A suspended or revoked agent cannot obtain a token. Neither can an agent whose organization is suspended. ## Call the Gateway [#call-the-gateway] Send the access token as a bearer credential to the `mcp_url` from the response: ```bash title="List tools with the access token" curl -X POST "https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/mcp" \ -H "Authorization: Bearer {{ACCESS_TOKEN}}" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' ``` The gateway authenticates the agent from the token, then applies the same gateway access checks and rules it applies to the agent key. Once the token expires, the gateway answers HTTP `401`. Request a new token and retry. ## Configure an MCP client [#configure-an-mcp-client] MCP clients that support only OAuth client credentials ask for a similar set of values. Map them as follows: | Client setting | Value | | --------------------- | ----------------------------------------------------------------------------- | | Server URL | The gateway `mcp_url`, `https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/mcp` | | Transport | Streamable HTTP | | Token URL | `https://api.domesystems.ai/api/v1/auth/token` | | Client ID | The agent ID | | Client secret | The agent API key | | Client authentication | HTTP Basic header | | Scope | Empty or `mcp` | Check these client options before you connect: * **Credential placement.** Choose the HTTP Basic header. Clients that send credentials in the request body (`client_secret_post`) fail with `invalid_request`. * **Scope.** Either leave it empty or request `mcp` when the client discovers that scope from gateway metadata. * **Secret encoding.** Enter the API key exactly as issued; clients using standard OAuth HTTP Basic encoding are supported. * **Gateway selection.** If the client cannot add `gateway_id` to the token request, give it a dedicated agent with access to exactly one gateway. Configure the client for Streamable HTTP, not SSE. The gateway does not support the legacy standalone SSE transport. ## Errors [#errors] Error responses use the OAuth 2.0 error shape: ```json title="Error response" { "error": "invalid_scope", "error_description": "the only supported scope is mcp" } ``` | HTTP status | `error` | Cause | | ----------- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | `400` | `invalid_request` | The content type is not form-encoded, the body is malformed, or `grant_type` is missing | | `400` | `invalid_request` | The Basic header is missing or malformed, the client ID or secret is empty, or credentials appear in the body | | `400` | `invalid_request` | `gateway_id` is not a lowercase hyphenated UUID | | `400` | `unsupported_grant_type` | `grant_type` is not a supported grant | | `400` | `invalid_scope` | The request has a `scope` other than `mcp` | | `400` | `invalid_target` | `gateway_id` is omitted and the agent can reach no gateway or several, or the named gateway is unavailable to the agent | | `401` | `invalid_client` | The API key is unknown or revoked, or the client ID does not match the key's agent | | `403` | `unauthorized_client` | The agent is suspended or revoked, or its organization is suspended | | `429` | `temporarily_unavailable` | Too many failed attempts from your network address. Wait before retrying. | | `500` | `server_error` | Dome could not complete the exchange. Retry with backoff. | A request that is not a `POST` receives a plain-text HTTP `405`. Do not retry `400`, `401`, or `403` responses until you fix the request or the agent. ## Next steps [#next-steps] * [Develop with Dome](/develop) to call tools and models through a gateway * [Agents](/build/agents#create-key) to create, rotate, and revoke API keys * [Gateways](/build/gateways#manage-agent-access) to grant an agent access to a gateway * [Interactive MCP access](/build/gateways/interactive-mcp-access) to let people sign in with their own Dome account instead of an agent key # Escalations (/govern/escalations) Route sensitive authorization decisions through an operator approval workflow. Attach an escalation to a Cedar policy when a request needs review before it proceeds. ## Requirements [#requirements] Before you begin: * Ask an organization owner or administrator to opt the organization into preview features. * Select a workspace and authenticate the Dome CLI. * Hold `escalations.manage` to configure workflows and `rules.deploy` to attach one to a policy. * Grant reviewers `escalations.resolve` to resolve judgments. ## How escalations work [#how-escalations-work] An escalation is a versioned workspace workflow. Its authorization trigger selects an entry step for a baseline `permit`, `forbid`, or `no_match` result. An operator judgment pauses the matching request. A reviewer resolves the judgment with `approve` or `deny`, then the next evaluation follows that branch. Judgments are single-use. A completed request consumes its resolved judgments, so an identical later request creates a new review. ## Create an escalation [#create-an-escalation] Create the workflow configuration as protojson. This example sends permitted and unmatched requests to review, then allows or denies the request from the reviewer’s verdict. ```json title="approval-workflow.json" { "trigger": { "authorization": { "policyPermitStep": "review", "policyForbidStep": "deny", "policyNoMatchStep": "review" } }, "steps": { "review": { "judgment": { "approveStep": "allow", "denyStep": "deny", "operator": {} } }, "allow": { "outcome": { "outcome": "ESCALATION_OUTCOME_AUTHORIZATION_ALLOW" } }, "deny": { "outcome": { "outcome": "ESCALATION_OUTCOME_AUTHORIZATION_DENY" } } } } ``` Create the escalation from the file: ```bash title="Create an escalation" dome escalations create high-risk-review \ --description "Require an operator decision for high-risk tool calls." \ --config-from approval-workflow.json ``` The trigger kind is derived from the configuration and cannot change. Each config change deploys a new active version. ## Attach the workflow to a policy [#attach-the-workflow-to-a-policy] Write an `escalate` policy that names the escalation. Deploying the bundle resolves the workspace name. ```txt title="workspace/high-risk-review.cedar" escalate( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource is Dome::MCPTool ) when { resource.connection_name == "github" }; ``` Deploy the policy with your normal rules workflow. An escalation policy does not grant access by itself; it routes matching authorization outcomes through the workflow. When a request reaches a pending judgment, it does not proceed. Resolve the judgment, then retry the request so the workflow can apply its terminal outcome. ## Resolve a judgment [#resolve-a-judgment] List pending judgments after a request reaches the review step: ```bash title="List pending judgments" dome escalations judgments list high-risk-review --status pending ``` Inspect the judgment before recording a final verdict. It identifies the triggering request and the rules that routed it to review: ```bash title="Inspect a judgment" dome escalations judgments get high-risk-review {{JUDGMENT_ID}} ``` Judgments retain audit context, not the raw request body. Use the attached rule and audit trail to understand why a request requires review. Record a final verdict: ```bash title="Approve a judgment" dome escalations judgments resolve high-risk-review {{JUDGMENT_ID}} \ --verdict approve ``` Use `--verdict deny` to refuse the request. A reviewer cannot change a resolved judgment. Each verdict applies to one triggering request; a later matching request creates a new judgment. ## Review and roll back versions [#review-and-roll-back-versions] List the workflow’s history before changing a production path: ```bash title="List escalation versions" dome escalations versions high-risk-review ``` Roll back by copying an earlier configuration into a new active version: ```bash title="Roll back an escalation" dome escalations rollback high-risk-review --to-version 2 ``` Rollback preserves history. It never reactivates an older version in place. ## Operational guidance [#operational-guidance] * Start with a narrow policy that targets one action and resource family. * Give only designated reviewers the `escalations.resolve` permission. * Inspect `escalation.run` and `escalation.judgment.resolve` audit events when reviewing a decision path. [Audit exports](/manage/export) can send that history to your SIEM. * Treat a workflow error as a denied request. The escalation evaluation fails closed. ## Next steps [#next-steps] * [Write rules](/govern/rules) to attach authorization logic. * [Use the CLI](/cli/govern/escalations) to manage workflows from a terminal. * [Use the MCP tools](/reference/mcp/escalations) to manage workflows from an MCP client. * [Use the REST API](/api/tag/escalations/list-escalations) to manage workflows from an application. * [Inspect audit events](/operate/audit) to trace workflow activity. * [Manage Access](/manage/access) to grant reviewer permissions. # Guards (/govern/guards)

{guard}

## Overview [#overview] Guards sit on Dome's content path and decide what of an authorized call's body may leave a backend or reach the agent. They attach to a connection, agent, or gateway and to a direction (`request` or `response`). When an assigned guard cannot be evaluated, the gateway blocks the affected traffic. Dome currently supports two guard types, each with its own workflow: * **filters** rewrite or withhold content. Model connections accept only `text` filters. Tool connections accept only `json` filters. 1. [Create a filter](#create-a-filter) for the connection kind you need. 2. [Assign ordered filter chains](#assign-ordered-filter-chains) on the connection and direction. 3. [Configure the streaming window](#configure-the-streaming-window) when model response filters need more context. * **validators** are pure predicates on tool connections. They never rewrite content. A failure blocks the whole request or response. 1. [Create a validator](#create-a-validator) for the tool-edge checks you need. 2. [Assign validators](#assign-validators) on the connection and direction. ### Bind guards to an agent or gateway [#bind-guards-to-an-agent-or-gateway] Bind a guard to an agent when it should apply to every request that agent makes. Bind it to a gateway when it should apply to every request addressed through that gateway. Connection guards run first, followed by gateway guards, then agent guards. The guard kind decides which calls it can inspect: text filters inspect model traffic, while JSON filters and validators inspect tool traffic. Set the complete guard list for one resource and direction: ```bash title="Bind guards to a gateway" dome gateways guards set prod-gateway \ --direction response \ --guards pii-redact ``` ```bash title="Bind guards to an agent" dome agents guards set support-agent \ --direction request \ --guards require-user-id ``` `--guards` accepts comma-separated filter or validator names and replaces the resource's existing list for that direction. Filter order is preserved. Pass `--guards ""` to clear the direction. Inspect resource bindings before changing them: ```bash dome gateways guards list prod-gateway dome agents guards list support-agent ``` > **Warning**: A response validator inspects MCP results only. Binding one to a response direction blocks every REST tool call through that resource. ## Requirements [#requirements] Before you begin: * Authenticate to Dome and select a workspace * Have at least one [model](/connect/models) or [tool](/connect/tools) connection to assign ### Permissions [#permissions] Guard filter operations require platform permissions. Each operation restates its permission inline. | Default roles | Permission | Grants | | ------------------- | ----------------- | -------------------------------------------------------------------------------- | | All workspace roles | `guards.view` | List filters, validators, and assignments | | `admin`, `operator` | `guards.manage` | Create, update, roll back, or delete filters and validators, and set assignments | | `admin`, `operator` | `gateways.manage` | Set a per-model filter window | | `admin`, `operator` | `config.manage` | Set the workspace streaming filter window floor | The legacy `filters.view` and `filters.manage` aliases still satisfy these checks during the cutover. ## Filters [#filters] Filters are a guard type. Create and version filters here, assign them to connections, and tune the streaming window used when response filters inspect model output. ### Create a filter [#create-a-filter] Create a filter to define its first active version. Text filters use convenience flags. JSON filters use a config file. > **Note**: Requires `guards.manage`. When more than one JSON action targets the same path, precedence is `BLOCK` > `OMIT` > `REDACT`. `REDACT` rewrites the matched span or value, `OMIT` removes a JSON field, and `BLOCK` withholds the whole message and stops the chain. **CLI** ```bash title="Text filter" dome guards filters create pii-redact \ --description "Redact PII in model responses" \ --redact-ssn \ --redact-substring "internal-only" \ --block-substring "TOP-SECRET" ``` ```bash title="JSON filter" dome guards filters create tool-scrub \ --config-from ./tool-scrub.json ``` ```json title="tool-scrub.json" { "json": { "components": [ { "field_actions": [ {"matcher": {"path": "ssn"}, "action": "FILTER_ACTION_OMIT"}, {"matcher": {"path": "email"}, "action": "FILTER_ACTION_REDACT"}, {"matcher": {"path": "card"}, "action": "FILTER_ACTION_BLOCK"} ] } ] } } ``` Convenience flags build at most two text components. Redact runs first, then block. Use `--config-from` for a JSON filter or a multi-component text chain. > **Note**: Reference: [`dome guards filters create`](/cli/govern/guards#create-filter) **MCP** Tool: `dome_guards_create_filter` ```json { "name": "pii-redact", "description": "Redact PII in model responses", "redact_ssn": true, "redact_substrings": ["internal-only"], "block_substrings": ["TOP-SECRET"] } ``` Pass `config_json` with a protojson `dome.guards.v1.FilterConfig` to author a JSON filter or a multi-component text chain. Convenience params only produce text filters. > **Note**: Reference: [`dome_guards_create_filter`](/reference/mcp/guards#create-filter) **Agent** ```text title="Create a filter" Create a text filter named "pii-redact" that redacts SSNs and the substring "internal-only", and blocks on "TOP-SECRET". ``` ### Update a filter [#update-a-filter] Update filter metadata in place, or pass any config flag to deploy a new active version. The previous version remains in history. Assigned connections follow the active version on the next gateway sync. > **Note**: Requires `guards.manage`. **CLI** ```bash dome guards filters update pii-redact \ --description "Redact PII and secrets in model responses" \ --redact-ssn \ --block-substring "TOP-SECRET" ``` > **Note**: Reference: [`dome guards filters update`](/cli/govern/guards#update-filter) **MCP** Tool: `dome_guards_update_filter` ```json { "filter": "pii-redact", "description": "Redact PII and secrets in model responses", "redact_ssn": true, "block_substrings": ["TOP-SECRET"] } ``` > **Note**: Reference: [`dome_guards_update_filter`](/reference/mcp/guards#update-filter) ### Roll back a filter [#roll-back-a-filter] Roll a filter back to an earlier version. The target version's config is copied forward into a new active version. History is never mutated. > **Note**: Requires `guards.manage`. **CLI** ```bash dome guards filters rollback pii-redact --to-version 1 ``` > **Note**: Reference: [`dome guards filters rollback`](/cli/govern/guards#rollback-filter) **MCP** Tool: `dome_guards_rollback_filter` ```json { "filter": "pii-redact", "to_version": 1 } ``` > **Note**: Reference: [`dome_guards_rollback_filter`](/reference/mcp/guards#rollback-filter) ### Delete a filter [#delete-a-filter] Delete a filter and its connection assignments. Corrupt filters can still be addressed by UUID when their config fails to render. > **Note**: Requires `guards.manage`. > **Warning**: Delete removes the filter and every assignment that references it. **CLI** ```bash dome guards filters delete pii-redact ``` > **Note**: Reference: [`dome guards filters delete`](/cli/govern/guards#delete-filter) **MCP** Tool: `dome_guards_delete_filter` ```json { "filter": "pii-redact" } ``` > **Note**: Reference: [`dome_guards_delete_filter`](/reference/mcp/guards#delete-filter) ### Assign ordered filter chains [#assign-ordered-filter-chains] Each assignment binds filters to a `(connection, direction)` slot. Setting a chain replaces the complete ordered list for that slot. Clear a chain with an empty filter list. > **Note**: Requires `guards.manage`. Model connections accept only `text` filters. Tool connections accept only `json` filters. **CLI** ```bash title="Model connection" dome models guards filters set claude-prod \ --direction response \ --filters pii-redact,secrets-block ``` ```bash title="Tool connection" dome tools guards filters set github-mcp \ --direction request \ --filters tool-scrub ``` ```bash title="Clear a chain" dome models guards filters set claude-prod \ --direction request \ --filters "" ``` Inspect assignments with: ```bash dome models guards filters list dome tools guards filters list ``` > **Note**: Reference: [`dome models guards filters set`](/cli/govern/guards#set-model-filters) · [`dome tools guards filters set`](/cli/govern/guards#set-tool-filters) **MCP** Tool: `dome_models_guards_filters_set` ```json { "connection": "claude-prod", "direction": "response", "filters": ["pii-redact", "secrets-block"] } ``` Tool: `dome_tools_guards_filters_set` ```json { "connection": "github-mcp", "direction": "request", "filters": ["tool-scrub"] } ``` > **Note**: Reference: [`dome_models_guards_filters_set`](/reference/mcp/guards#set-model-connection-filters) · [`dome_tools_guards_filters_set`](/reference/mcp/guards#set-tool-connection-filters) **Agent** ```text title="Assign filter chains" Assign filters "pii-redact" and "secrets-block" in that order to the response direction on model connection "claude-prod". ``` ### Configure the streaming window [#configure-the-streaming-window] Configure how much streamed model output the gateway buffers before applying response filters. Layering rules are on the [guards](/concepts/controls/guards#streaming-model-responses) concept and [streaming window](/reference/controls/guards#streaming-window) reference. > **Note**: Requires `config.manage` for the workspace floor. Per-connection windows require `gateways.manage`. Per-request overrides are set by the calling agent in the request body. In the dashboard, set the workspace floor under **Settings → Config**. From the API: ```http PUT /v1/workspaces//llm-filter-window Content-Type: application/json { "tenant_id": "", "llm_filter_window_bytes": 4096, "llm_filter_window_tokens": 1024 } ``` > **Note**: Reference: [`UpdateWorkspaceLLMFilterWindow`](/api/tag/workspaces/update-workspace-llm-filter-window) Agents can request a wider buffer for a single call by adding a `_dome` block to the OpenAI- or Anthropic-shaped body: ```json { "model": "production", "messages": [{"role": "user", "content": "Summarize the notes."}], "_dome": {"filter_window_bytes": 8192, "filter_window_tokens": 64} } ``` The override is validated against the same bounds the workspace floor uses and is invisible to the upstream provider. Refer to [Models](/connect/models) for the per-connection flags. ## Validators [#validators] Validators are a guard type for tool connections. They check structured conditions on tool request arguments or MCP tool results and block when any condition fails. They never redact or omit fields. Every assigned validator must pass. Condition catalogs and response targets are on the [guards](/reference/controls/guards#validators) reference. ### Create a validator [#create-a-validator] Create a validator with a protojson `dome.guards.v1.ValidatorConfig`. The config arm (`toolRequest` or `toolResponse`) sets the kind and is immutable after create. > **Note**: Requires `guards.manage`. **CLI** ```bash dome guards validators create require-user-id \ --description "Require user_id on tool calls" \ --config-from ./require-user-id.json ``` ```json title="require-user-id.json" { "toolRequest": { "json": { "requiredPaths": ["user_id"], "maximumSize": 4096 } } } ``` ```json title="require-status.json" { "toolResponse": { "target": "VALIDATION_TARGET_STRUCTURED_CONTENT", "json": { "requiredPaths": ["status"] } } } ``` > **Note**: Reference: [`dome guards validators create`](/cli/govern/guards#create-validator) **MCP** Tool: `dome_guards_create_validator` ```json { "name": "require-user-id", "description": "Require user_id on tool calls", "config_json": "{\"toolRequest\":{\"json\":{\"requiredPaths\":[\"user_id\"],\"maximumSize\":4096}}}" } ``` > **Note**: Reference: [`dome_guards_create_validator`](/reference/mcp/guards#create-validator) **Agent** ```text title="Create a validator" Create a tool-request validator named "require-user-id" that requires the path "user_id" and caps arguments at 4096 bytes. ``` ### Update a validator [#update-a-validator] Update metadata in place, or pass `--config-from` / `config_json` to deploy a new active version. Kind cannot change. > **Note**: Requires `guards.manage`. **CLI** ```bash dome guards validators update require-user-id \ --description "Require user_id and tenant_id" \ --config-from ./require-user-id.json ``` > **Note**: Reference: [`dome guards validators update`](/cli/govern/guards#update-validator) **MCP** Tool: `dome_guards_update_validator` ```json { "validator": "require-user-id", "description": "Require user_id and tenant_id", "config_json": "{\"toolRequest\":{\"json\":{\"requiredPaths\":[\"user_id\",\"tenant_id\"],\"maximumSize\":4096}}}" } ``` > **Note**: Reference: [`dome_guards_update_validator`](/reference/mcp/guards#update-validator) ### Roll back a validator [#roll-back-a-validator] Roll a validator back to an earlier version. The target version's config is copied forward into a new active version. > **Note**: Requires `guards.manage`. **CLI** ```bash dome guards validators rollback require-user-id --to-version 1 ``` > **Note**: Reference: [`dome guards validators rollback`](/cli/govern/guards#rollback-validator) **MCP** Tool: `dome_guards_rollback_validator` ```json { "validator": "require-user-id", "to_version": 1 } ``` > **Note**: Reference: [`dome_guards_rollback_validator`](/reference/mcp/guards#rollback-validator) ### Delete a validator [#delete-a-validator] Delete a validator and its connection assignments. > **Note**: Requires `guards.manage`. > **Warning**: Delete removes the validator and every assignment that references it. **CLI** ```bash dome guards validators delete require-user-id ``` > **Note**: Reference: [`dome guards validators delete`](/cli/govern/guards#delete-validator) **MCP** Tool: `dome_guards_delete_validator` ```json { "validator": "require-user-id" } ``` > **Note**: Reference: [`dome_guards_delete_validator`](/reference/mcp/guards#delete-validator) ### Assign validators [#assign-validators] Attach validators to a tool connection as an unordered set on one direction. Direction must match the validator kind. Response validators are MCP-only. > **Note**: Requires `guards.manage`. **CLI** ```bash title="Attach" dome tools guards validators add github-mcp \ --direction request \ --validators require-user-id ``` ```bash title="Detach" dome tools guards validators remove github-mcp \ --direction request \ --validators require-user-id ``` ```bash title="List" dome tools guards validators list github-mcp ``` > **Note**: Reference: [`dome tools guards validators add`](/cli/govern/guards#add-validator) **MCP** Tool: `dome_tools_guards_validators_add` ```json { "connection": "github-mcp", "direction": "request", "validators": ["require-user-id"] } ``` Tool: `dome_tools_guards_validators_remove` ```json { "connection": "github-mcp", "direction": "request", "validators": ["require-user-id"] } ``` > **Note**: Reference: [`dome_tools_guards_validators_add`](/reference/mcp/guards#add-tool-connection-validators) **Agent** ```text title="Assign validators" Attach validator "require-user-id" to the request direction on tool connection "github-mcp". ``` ## Next steps [#next-steps] * [guards](/concepts/controls/guards) concept for how content inspection works * [guards](/reference/controls/guards#filter-audit-events) reference for filter catalogs and audit payloads * [Audit](/operate/audit) to query `guard.filter.evaluate`, `guard.validator.evaluate`, and the enclosing `tool.call` or `model.call` * [Connect Tools](/connect/tools) to add tool connections * [Models](/connect/models) to set per-connection filter windows * [Authorize Access](/govern/rules) when a call should be allowed or denied before guards run * [Architecture](/concepts/architecture#guards) concept for where guards sit in the request path # Govern (/govern) **Govern** applies the controls that decide what agents can do, which decisions need review, what content may pass, and how much spend is allowed. You authorize with rules, route selected decisions through escalations, inspect traffic with guards, and cap model spend with quotas. ## The four controls [#the-four-controls] * [Rules](/govern/rules): Make deterministic allow and deny decisions for an agent, action, and resource, reading request arguments and verified end-user claims. * [Escalations](/govern/escalations): Route selected Cedar authorization decisions through a versioned review workflow. * [Guards](/govern/guards): Inspect request and response content on model and tool connections. Filters are a guard type. * [Quotas](/govern/quotas): Cap LLM spend over a window for a workspace, agent, gateway, pool, model, or verified end user. * [Rules assistant](/govern/rules/assistant): Draft Cedar from natural language when you would rather describe the intent than write the policy. * [Simulate](/govern/rules/simulate): Check a change against real requests before it affects production behavior. At runtime, Dome evaluates applicable quotas, then rules and any matching escalations, then guards on the content path. Each control fails closed: exhausted limits, unavailable authorization, pending review, and blocking guards stop the request or response. Exhausted total caps reject the call, while exhausted model budgets can spill to another pool member. See [Architecture](/concepts/architecture) for where these controls sit in the request path. ## Typical workflow [#typical-workflow] 1. [Authorize access](/govern/rules) by writing, validating, simulating, and applying Cedar rules. 2. Add [escalations](/govern/escalations) when selected rules need an operator’s decision. 3. Create [guards](/govern/guards) and assign filters to the connections that need inspection. 4. [Set usage limits](/govern/quotas) at the scopes that own the budget. Afterward you can revise rules, roll workflows or filters forward or back, and adjust quotas without rewiring Build or Connect entities. ## Next steps [#next-steps] * [Build](/build) to create agents, gateways, and managed-agent triggers. * [Connect](/connect) to attach callers, tools, models, and pools. * [Operate](/operate) to investigate audit events, stream live activity, and subscribe external systems. * [Manage](/manage) to administer access, environments, configuration, exports, and billing. # Quotas (/govern/quotas)

{quota}

## Overview [#overview] The gateway meters token usage on completed calls, prices it at per-model rates, updates spend for the window, and enforces every applicable quota. Limit changes reach the gateway on the next config sync. Refer to [Quotas](/concepts/controls/quotas#when-a-quota-change-takes-effect) concept for how that differs from spend accrual. Workspace quotas each have a subject, a limit, a reset window, an optional name, and an enabled flag. Subject identity is fixed at create time. Create is insert-only for each subject identity and window pair. Disabled quotas remain listed but are not enforced. Organization and tenant contexts instead use shared usage allowances; see [Set an organization or tenant usage allowance](#set-an-organization-or-tenant-usage-allowance). The typical workflow is: 1. [Set a quota](#set-a-quota) for the subject that owns the budget. 2. Optionally [set a gateway quota](#set-a-gateway-quota) when spend should follow a gateway. 3. [Limit managed-agent runs](#limit-managed-agent-runs) or one [managed-agent run](#limit-one-managed-agents-run) when automation needs an execution budget. 4. [Update](#update-a-quota), [list](#list-quotas), or [remove](#remove-a-quota) quotas as budgets change. ## Requirements [#requirements] Before you begin: * Authenticate to Dome and select a workspace * Have the subject already configured (agent, model, pool, gateway, or a subject verified via [Delegated agents](/build/agents/delegated) as needed) * Use a plan that allows cost quotas for the workspace. Cost quotas are included on the **Pro** plan. Free workspaces ship with a create limit of zero. ### Permissions [#permissions] Quota operations require platform permissions. Each operation restates its permission inline. | Default roles | Permission | Grants | | ------------------- | ----------------- | -------------------------------- | | All workspace roles | `gateways.view` | List quotas | | `admin`, `operator` | `gateways.manage` | Create, update, or delete quotas | ## Set a Quota [#set-a-quota] Create a cap for a workspace, agent, act-as subject, pool, model, gateway (`gateway`), tool, or tool connection. Subject identity cannot change after create. Pass `--disabled` / `disabled` to create a quota that is stored but not enforced until you enable it. Windows are `daily` (UTC midnight) or `monthly` (UTC month start, default `monthly`). Exhaustion behavior and event names are on the [Quotas](/reference/controls/quotas) reference. > **Note**: Requires `gateways.manage`. In the dashboard, open **models → Cost quotas**, choose the subject and target, set the USD limit and window, then save. Model quotas can cover a model globally or only within a selected pool, with an optional per-caller toggle. **CLI** ```bash title="Workspace monthly limit" dome quotas set \ --subject workspace \ --limit 5000 \ --window monthly \ --name workspace-monthly ``` ```bash title="Agent daily limit" dome quotas set \ --subject agent \ --agent \ --limit 25 \ --window daily ``` ```bash title="Pool monthly limit" dome quotas set \ --subject pool \ --pool production \ --limit 2500 \ --window monthly ``` ```bash title="Model budget within a pool" dome quotas set \ --subject model \ --model claude-sonnet \ --pool production \ --limit 1000 \ --window monthly ``` | Flag | Required | Description | | -------------- | :---------: | ------------------------------------------------------------------------- | | `--subject` | Yes | `workspace`, `agent`, `act-as`, `pool`, `model`, `gateway`, or `tool` | | `--limit` | Yes | Cap in US dollars (or a whole count when `--unit` is `tokens` or `calls`) | | `--window` | No | `daily` or `monthly` (default `monthly`) | | `--name` | No | Human-readable label | | `--agent` | Conditional | agent id when `--subject agent` | | `--act-as` | Conditional | Verified end-user OIDC `sub` when `--subject act-as` | | `--pool` | Conditional | Pool name when `--subject pool`, or to scope a model quota to one pool | | `--model` | Conditional | model connection name when `--subject model` | | `--gateway` | Conditional | gateway name or id when `--subject gateway` | | `--tool` | Conditional | `/` when `--subject tool` | | `--connection` | Conditional | MCP server connection name when `--subject tool-connection` | | `--per-caller` | No | model only: independent budget per agent and verified end user | | `--disabled` | No | Create without enforcement until enabled | > **Note**: Reference: [`dome quotas set`](/cli/govern/quota#set-quota) **MCP** Tool: `dome_quotas_set` ```json { "subject": "model", "model": "claude-sonnet", "pool": "production", "limit_usd": 1000, "window": "monthly" } ``` > **Note**: Reference: [`dome_quotas_set`](/reference/mcp/quotas#dome_quotas_set) **API** ```http POST /v1/quotas Content-Type: application/json { "workspace_id": "", "subject_type": "model", "subject_id": "", "pool_id": "", "limit_micros": 1000000000, "window": "monthly", "name": "sonnet-in-production" } ``` Limits are micro-USD on the API (`1000000000` is $1,000.00). `scope` defaults to `total`. Set `per_caller` for per-caller model quotas. For `act_as`, set `subject_key` to the OIDC `sub` instead of `subject_id`. > **Note**: Reference: [`CreateLLMQuota`](/api/tag/quotas/create-llm-quota) **Agent** ```text title="Set a model Quota" Create a monthly \$1000 Quota on model "claude-sonnet" within pool "production". ``` ## Limit managed-agent runs [#limit-managed-agent-runs] Use a run quota to limit how many managed-agent runs Dome queues in a UTC day or month. A run quota applies to the whole workspace, one managed agent, or one trigger. It limits queued runs, not concurrent work or model spend. **CLI** ```bash title="Limit one trigger to 30 queued runs each month" dome quotas set \ --subject trigger \ --trigger nightly-triage \ --limit 30 \ --window monthly ``` ```bash title="Limit all managed-agent runs in a workspace each day" dome quotas set \ --subject workspace \ --dimension run \ --limit 100 \ --window daily ``` **MCP** Tool: `dome_quotas_set` ```json { "subject": "trigger", "trigger": "nightly-triage", "limit_runs": 30, "window": "monthly" } ``` **API** Set `dimension` to `run`, `unit` to `runs`, and `limit_amount` to the allowed queued-run count. Use a `workspace`, `agent`, or `trigger` subject. Every admitted run counts when Dome queues it, even when it is later withdrawn before it starts. A zero limit admits no runs. A full quota refuses manual runs before they enter the queue, returns HTTP `429` to webhook senders, and records a refused scheduled occurrence as `quota_exceeded`. ## Limit one managed agent's run [#limit-one-managed-agents-run] Use a per-run quota to cap the tokens or estimated provider spend for each run of one managed agent. This is separate from run limits such as turns or duration. ```bash title="Cap each run at two million tokens" dome quotas set \ --subject agent \ --agent nightly-triage \ --unit tokens \ --limit 2000000 \ --window per_run ``` Set `--unit provider_usd` to use estimated upstream model spend instead. The runner stops after a cap is reached, but a single model call can exceed it before Dome receives its final usage. ## Set an organization or tenant usage allowance [#set-an-organization-or-tenant-usage-allowance] Select an organization or tenant context, then use the same `dome quotas` commands without `--subject`. The allowance covers the selected scope as a whole, rather than an individual resource. It can cap all governed traffic, only LLM traffic, or only tool traffic. ```bash title="Tenant-wide daily tool-call allowance" dome context use dome quotas set --dimension tool --unit calls --limit 10000 --window daily ``` ```bash title="Organization-wide monthly allowance" dome context use dome quotas set --dimension all --unit dome_usd --limit 5000 --window monthly ``` For organization and tenant allowances, `all` defaults to `dome_usd`, `llm` defaults to `tokens`, and `tool` defaults to `calls`. Use `dome quotas list`, `dome quotas update `, and `dome quotas rm ` in the same context to manage the allowance. Gateway and resource subject flags do not apply at these levels. ### Set an Act-As Quota [#set-an-act-as-quota] Create a quota for one verified end-user subject. The quota applies only when [Delegated agents](/build/agents/delegated) verification has confirmed that subject on the call. ```bash dome quotas set \ --subject act-as \ --act-as user-123 \ --limit 10 \ --window daily ``` ### Set a per-caller model Quota [#set-a-per-caller-model-quota] Create a model quota that tracks each agent and each verified end user independently instead of combining their spend. ```bash dome quotas set \ --subject model \ --model gpt-4o \ --per-caller \ --limit 5 \ --window daily ``` ## Set a Gateway Quota [#set-a-gateway-quota] Create a quota that covers all LLM calls routed through a gateway's model pools and direct model connections. Use `--subject gateway` on the same `dome quotas set` command as every other subject. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome quotas set \ --subject gateway \ --gateway prod-tools \ --limit 500 \ --window monthly \ --name prod-monthly ``` > **Note**: Reference: [`dome quotas set`](/cli/govern/quota#set-quota) **MCP** Tool: `dome_quotas_set` ```json { "subject": "gateway", "gateway": "prod-tools", "limit_usd": 500, "window": "monthly", "name": "prod-monthly" } ``` > **Note**: Reference: [`dome_quotas_set`](/reference/mcp/quotas#dome_quotas_set) **API** ```http POST /v1/quotas Content-Type: application/json { "workspace_id": "", "subject_type": "gateway", "subject_id": "", "limit_micros": 500000000, "window": "monthly", "name": "prod-monthly" } ``` > **Note**: Reference: [`CreateLLMQuota`](/api/tag/quotas/create-llm-quota) **Agent** ```text title="Set a Gateway Quota" Create a monthly \$500 Quota on Gateway "prod-tools" named "prod-monthly". ``` ## Update a Quota [#update-a-quota] Update a quota's name, USD limit, window, or enabled state. Subject identity cannot change. Create a new quota to cover a different subject. > **Note**: Requires `gateways.manage`. Only the fields you pass change. Disable a quota to pause enforcement without deleting its definition or history. **CLI** ```bash dome quotas update \ --limit 7500 \ --enabled=true ``` > **Note**: Reference: [`dome quotas update`](/cli/govern/quota#update-quota) **MCP** Tool: `dome_quotas_update` ```json { "quota_id": "", "limit_usd": 7500, "enabled": true } ``` > **Note**: Reference: [`dome_quotas_update`](/reference/mcp/quotas#dome_quotas_update) **API** ```http PATCH /v1/quotas/ Content-Type: application/json { "workspace_id": "", "limit_micros": 7500000000, "enabled": true } ``` Omitted optional fields keep their current values. > **Note**: Reference: [`UpdateLLMQuota`](/api/tag/quotas/update-llm-quota) ## List Quotas [#list-quotas] List quotas in the workspace, including disabled ones. Listing returns each quota's id, subject, USD limit, window, and enabled state. > **Note**: Requires `gateways.view`. **CLI** ```bash dome quotas list dome quotas list --gateway prod-tools ``` Pass `--gateway` to list only the caps on one gateway. Pass `--dimension llm` or `--dimension tool` to list one traffic type. > **Note**: Reference: [`dome quotas list`](/cli/govern/quota#list-quotas) **MCP** Tool: `dome_quotas_list` ```json { "name": "dome_quotas_list", "arguments": {} } ``` ```json { "gateway": "prod-tools" } ``` > **Note**: Reference: [`dome_quotas_list`](/reference/mcp/quotas#dome_quotas_list) **API** ```http GET /v1/quotas?workspace_id= ``` > **Note**: Reference: [`ListLLMQuotas`](/api/tag/quotas/list-llm-quotas) ## Remove a Quota [#remove-a-quota] Remove a quota by id. Listing first is the usual way to obtain the id. > **Note**: Requires `gateways.manage`. > **Warning**: Remove deletes the quota definition. Disable the quota instead when you need to pause enforcement and keep the record. **CLI** ```bash dome quotas rm ``` > **Note**: Reference: [`dome quotas rm`](/cli/govern/quota#remove-quota) **MCP** Tool: `dome_quotas_remove` ```json { "quota_id": "" } ``` > **Note**: Reference: [`dome_quotas_remove`](/reference/mcp/quotas#dome_quotas_remove) **API** ```http DELETE /v1/quotas/?workspace_id= ``` > **Note**: Reference: [`DeleteLLMQuota`](/api/tag/quotas/delete-llm-quota) ## Next steps [#next-steps] * [Quotas](/concepts/controls/quotas) concept for how spend caps work * [Quotas](/reference/controls/quotas) reference for subjects, windows, and event names * [Pools](/connect/pools) for routing strategies and failover * [Delegated agents](/build/agents/delegated) so Act-As quotas match live verified subjects * [Models](/connect/models) for the models and pools a quota can target # Access (/manage/access)

{access}

## Overview [#overview] Dome separates platform administration from runtime agent access. A workspace role or platform API key governs CLI commands, API endpoints, and MCP management tools. [Rules](/govern/rules) govern what a registered agent may do at the gateway. Refer to [Permissions](/concepts/platform/permissions) concept for the two-layer model. Memberships attach people to a scope with one role. Platform API keys attach automation to a `workspace`, `tenant`, or `org` scope with an explicit permission list. Agent API keys authenticate agent runtimes and use a separate lifecycle. Refer to [create an agent API key](/build/agents/external#create-key) for agent credentials. The typical workflow is: 1. [Assign a workspace member](#manage-workspace-members) a role that matches their job. 2. [Manage organization members](#manage-organization-members) when someone needs org-wide standing grants. 3. [Create a custom role](#custom-roles) when the built-in roles do not fit. 4. [Create a platform API key](#manage-platform-api-keys) for CI/CD or user automation that must call the Dome API. 5. Revoke keys and remove memberships when access is no longer needed. Apply least privilege to memberships and platform API keys. The sections below explain the roles you can assign and how platform API keys are scoped. ### Workspace roles [#workspace-roles] Assign one role per member in each workspace. Roles apply per workspace. The same user can hold different roles across workspaces. | Role | Access | | ---------- | ------------------------------ | | `admin` | Full workspace management. | | `operator` | agent and gateway operations. | | `security` | Authorization rules and audit. | | `viewer` | Read-only access. | You set the role when you [assign a workspace member](#manage-workspace-members). ### Custom roles [#custom-roles] Custom roles are named, user-defined permission sets. Create them at workspace, tenant, or organization scope, then assign them by name through the normal membership flow. Their permissions apply at that scope and cascade to scopes below it, just like built-in roles. Creating a custom role is an Enterprise capability. Existing custom roles continue to work and can be updated or removed after a plan change. You can only include permissions you already hold, so a custom role cannot grant more authority than its creator has. ```bash # Create a workspace role, then assign it to a workspace member. dome roles create audit-reader \ --scope workspace \ --permissions audit.view,rules.view \ --description "Read audit evidence and deployed Rules" dome workspaces members set --user analyst@example.com --role audit-reader ``` Use `dome roles list`, `dome roles get `, and `dome roles update ` to inspect and maintain definitions. Before deleting an assigned role, choose whether to reassign or remove its holders. Dome refuses a delete if membership changed while you were reviewing its holders. ### Platform API keys [#platform-api-keys] Platform API keys authenticate automation against the Dome API. Scope a key to `workspace`, `tenant`, or `org`. Set expiration for temporary automation and revoke unused keys immediately. Agent credentials use a separate lifecycle. For agent authentication, [create an agent API key](/build/agents/external#create-key). You create, list, and revoke keys when you [manage platform API keys](#manage-platform-api-keys). ## Requirements [#requirements] Before you begin, authenticate the Dome CLI and select a workspace context. ### Permissions [#permissions] Member and platform API key management require elevated roles. Each operation states the permission it requires. For exhaustive flags, tool parameters, and endpoint contracts, refer to the [CLI](/cli/settings/workspace#members), [MCP](/reference/mcp/workspaces#members), and [API](/api/tag/workspaces/set-workspace-membership) references. | Default roles | Permission | Grants | | ----------------------------------------- | -------------------------- | --------------------------------------------- | | Workspace `admin` (or equivalent cascade) | Workspace admin membership | Assign and remove workspace members and roles | | Org `owner` or `admin` | Org `tenants.manage` | List, assign, and remove organization members | | `admin`, `operator` (at the target scope) | `apikeys.manage` | Create, list, and revoke platform API keys | To let a person or automation move configuration, grant `export.manage` at the source scope and `import.manage` at the target scope. The role or API key also needs the permissions required by the resources it exports or imports. Refer to [Import and export configuration](/manage/import-export#permissions) for the complete requirements. ## Manage workspace members [#manage-workspace-members] Assign one role per member in each workspace. Choose from the [workspace roles](#workspace-roles) above. > **Note**: Requires workspace `admin` (or an equivalent cascaded role). **CLI** ```bash dome workspaces members list dome workspaces members set --user user@example.com --role operator dome workspaces members remove --user user@example.com --revoke-all-keys ``` | Flag | Applies to | Description | | ------------------- | ----------- | --------------------------------------------- | | `--user` | set, remove | User email address. | | `--role` | set | `admin`, `operator`, `security`, or `viewer`. | | `--revoke-keys` | remove | API key IDs to revoke during removal. | | `--revoke-all-keys` | remove | Revokes every API key created by the user. | > **Note**: Reference: [`dome workspaces members`](/cli/settings/workspace#members) **MCP** Tools: `dome_workspaces_members_list`, `dome_workspaces_members_set`, `dome_workspaces_members_remove` > **Note**: Reference: [`dome_workspaces_members_set`](/reference/mcp/workspaces#workspace-members-set) **API** RPCs: `ListWorkspaceMemberships`, `SetWorkspaceMembership`, `RemoveWorkspaceMembership` ```http PUT /v1/workspaces/{{WORKSPACE_ID}}/members Content-Type: application/json { "tenant_id": "{{TENANT_ID}}", "user_email": "user@example.com", "role": "operator" } ``` > **Note**: Reference: [`SetWorkspaceMembership`](/api/tag/workspaces/set-workspace-membership) **Agent** ```text title="Assign a workspace role" Set member "user@example.com" to the operator role. ``` ## Manage organization members [#manage-organization-members] Grant or change org-level roles (`owner`, `admin`, `member`) for an existing platform user, or remove an org membership. Org membership is separate from workspace membership — a user can hold an org role without a workspace seat, and a workspace invitee can lack org standing grants. > **Note**: Requires org-level `tenants.manage` (org `owner` or `admin`). Only an org `owner` may grant or remove the `owner` role. Rules: * The target user must already exist on the platform — grants do not create users * Removing the last `owner` returns `FailedPrecondition` * Successful assigns emit `organization.membership.set`; removals emit `organization.membership.unset` **API** List members: ```http POST /dome.mgmt.v1.Management/ListOrgMembers Content-Type: application/json { "org_id": "{{ORG_ID}}" } ``` Assign or change a role: ```http POST /dome.mgmt.v1.Management/AssignOrgRole Content-Type: application/json { "org_id": "{{ORG_ID}}", "user_email": "admin@example.com", "role": "admin" } ``` Remove a member: ```http POST /dome.mgmt.v1.Management/RemoveOrgMember Content-Type: application/json { "org_id": "{{ORG_ID}}", "user_email": "admin@example.com" } ``` > **Note**: Reference: [`ListOrgMembers`](/api/tag/dome-mgmt-v1-management/list-org-members) · [`AssignOrgRole`](/api/tag/dome-mgmt-v1-management/assign-org-role) · [`RemoveOrgMember`](/api/tag/dome-mgmt-v1-management/remove-org-member) **Agent** ```text title="Manage organization members" List organization members for the active org, then assign admin@example.com the admin role. ``` Org `owner` and `admin` also hold org-scoped `audit.view` for [org-wide audit queries](/operate/audit#query-events-across-an-organization). Role matrices are on the [Permissions](/reference/permissions#organization-roles) reference. ## Manage platform API keys [#manage-platform-api-keys] Create scoped keys for CI/CD pipelines and user automation. Agent credentials use a separate lifecycle. > **Note**: Requires `apikeys.manage` at the scope where you create the key. **CLI** ```bash dome platform-keys list dome platform-keys create \ --name "ci-deploy" \ --permissions rules.deploy,agent.register \ --expires-at 2026-12-31T00:00:00Z dome platform-keys revoke ci-deploy ``` > **Note**: Reference: [`dome platform-keys`](/cli/settings/platform-keys) **MCP** Tools: `dome_platform_keys_list`, `dome_platform_keys_create`, `dome_platform_keys_revoke` > **Note**: Reference: [`dome_platform_keys_create`](/reference/mcp/platform#platform-keys-create) **API** RPCs: `ListAPIKeys`, `CreateAPIKey`, `RevokeAPIKey` ```http POST /v1/platform-keys Content-Type: application/json { "name": "ci-deploy", "permissions": ["rules.deploy", "agent.register"], "expires_at": "2026-12-31T00:00:00Z", "scope_kind": "workspace", "scope_id": "{{WORKSPACE_ID}}" } ``` > **Note**: Reference: [`CreateAPIKey`](/api/tag/platform-keys/create-api-key) **Agent** ```text title="Create a platform API key" Create a platform API key named "ci-deploy" with permissions rules.deploy and agent.register. ``` Scope keys to `workspace`, `tenant`, or `org`. Set expiration for temporary automation and revoke unused keys immediately. For agent authentication, [create an agent API key](/build/agents/external#create-key). ## Next steps [#next-steps] * [Configure Platform](/manage/settings) * [Import and export configuration](/manage/import-export) to grant portability access for people and automation * [Permissions](/concepts/platform/permissions) concept * [create an agent API key](/build/agents/external#create-key) # Billing (/manage/billing) Billing covers the organization plan, governed-action usage, seats, invoices, and payment methods. Alerts for past due, limit reached, and scheduled plan changes appear in the dashboard only. ## Overview [#overview] Dome meters governed actions from the durable audit trail. Plans include a permanent free SKU and paid tiers with usage caps and platform fees. SIEM streaming and other add-on capabilities depend on plan entitlements. The typical workflow is: 1. [Check status and usage](#check-status-and-usage) for the active plan and current period. 2. [Change a plan or workspace quantity](#change-a-plan-or-workspace-quantity) when you need a different SKU or Pro workspace count. 3. [Manage payment methods and invoices](#manage-payment-methods-and-invoices) for collection. Card capture completes in the dashboard (or Stripe.js). The CLI can list methods and start setup, but it is not a full card-entry path. ## Requirements [#requirements] Before you begin: * Authenticate to Dome with an organization-scoped role that can manage billing * Use the dashboard for payment-method capture and billing alert banners ### Permissions [#permissions] | Default roles | Permission | Grants | | --------------------------- | ---------------- | -------------------------------------------------------------------- | | Organization billing admins | `billing.manage` | Status, plans, usage, seats, invoices, plan changes, payment methods | ## Check status and usage [#check-status-and-usage] Read the active plan, period usage, and free-tier caps when they apply. > **Note**: Requires `billing.manage`. **CLI** ```bash dome billing status dome billing plans dome billing usage dome usage-caps ``` `dome usage-caps` is read-only and returns empty for paid orgs. > **Note**: Reference: [`dome billing`](/cli/manage/billing) **Dashboard** Open **Billing** in the organization settings. Status, usage, and limit banners appear on the billing page and across the dashboard when alerts fire. ## Change a plan or workspace quantity [#change-a-plan-or-workspace-quantity] Change the SKU or purchased workspace count for the organization. Pro is priced per purchased workspace. Use `change-plan --quantity` when switching to Pro, then use `billing quantity set` to change the purchased count without changing plans. Quantities are absolute targets, not increments. > **Note**: Requires `billing.manage`. **CLI** ```bash dome billing change-plan pro --interval monthly --quantity 5 --dry-run dome billing change-plan pro --interval monthly --quantity 5 dome billing quantity dome billing quantity set 8 --dry-run dome billing quantity set 8 dome billing cancel --yes ``` Increasing the purchased workspace count takes effect immediately and is billed now, prorated for the time left in the current period. Reducing it is scheduled for the period end, with no immediate refund; current workspaces remain available until then. Setting the current effective count cancels a scheduled reduction, and a later request replaces an earlier scheduled reduction. > **Note**: Reference: [`dome billing change-plan`](/cli/manage/billing#change-plan) and [`dome billing quantity set`](/cli/manage/billing#set-workspace-quantity) **Dashboard** Use the billing page to select a plan, adjust the Pro workspace quantity, or cancel. Scheduled downgrades and limit alerts surface as dashboard banners. ## Manage payment methods and invoices [#manage-payment-methods-and-invoices] List invoices and payment methods. Add a card through the dashboard. > **Note**: Requires `billing.manage`. **CLI** ```bash dome billing invoices dome billing payment-methods dome billing contact dome billing contact set --email billing@example.com ``` > **Note**: Reference: [`dome billing invoices`](/cli/manage/billing#list-invoices) **Dashboard** Add or replace payment methods and download invoices from the billing page. Billing alerts (past due, org lock, limit reached, scheduled downgrade) are dashboard-only. ## Org lock and plan limits [#org-lock-and-plan-limits] Every org member sees a read-only lock banner when the organization is suspended for billing reasons. Enterprise orgs are never locked for billing. | Deny reason | Meaning | Recovery | | ----------------------- | ---------------------------------------- | ---------------------------------------------- | | `trial_expired` | Free trial ended without a paid plan | Add a payment method and switch to a paid plan | | `billing_locked` | Paid plan is in dunning (failed charges) | Update the payment method | | `subscription_canceled` | Paid plan canceled and reverted to Free | Choose a plan on the billing page | | `org_suspended` | Org is locked from mutating operations | Resolve the underlying billing state | Upgrades apply on the next request. Downgrades and cancellations keep the current plan until the period ends, then the org moves to the target SKU. On Pro, **purchased** workspaces are the number the organization pays for and **in use** is the number of live workspaces across its tenants. Creating a workspace is refused when it would exceed the purchased count. Deleting a workspace lowers the in-use count, but does not lower the purchased count or the bill automatically. Review `dome billing quantity` or the billing page after deleting workspaces and explicitly schedule a reduction if appropriate. A reduction can never take effect below the number of workspaces the organization still holds. Downgrading may put existing assets — extra tenants, workspaces, seats, agents, managed agents, or connections — over the target plan's caps. Managed agents consume both the agent cap and their separate managed-agent cap. The dashboard blocks the switch and lists the over-limit resources; remove them first, then retry. Creates that hit a SKU cap return HTTP 429 and emit the refused create operation with `result=denied` and `denial.reason=plan_limit` (see [Denied operations](/operate/audit#denied-operations)). Use `dome usage-caps` to inspect free-tier caps when they apply. ## Next steps [#next-steps] * [Export data](/manage/export#stream-audit-evidence-to-a-siem) for continuous SIEM streaming when your plan includes it * [Set usage limits](/govern/quotas) for workspace quotas (runtime spend caps, separate from plan metering) * [Manage access](/manage/access) for who can administer the organization # Environments (/manage/environments)

{environment}

## Overview [#overview] Dome nests environments under an organization. An organization contains tenants. A tenant contains workspaces. Agents, resources, gateways, rules, guards, quotas, and audit events live in a workspace. Tenants isolate data. Workspaces separate teams and environments inside a tenant. Refer to [Scope Hierarchy](/concepts/platform/scopes) concept for isolation and rule inheritance. Creating a tenant or workspace defines a boundary. A CLI context does not create a boundary; it selects which workspace subsequent CLI and MCP commands use. The typical workflow is: 1. [Create a tenant](#create-a-tenant) when you need a new hard isolation boundary. 2. [Create a workspace](#create-a-workspace) for the team or environment inside that tenant. 3. [Select a CLI context](#select-a-cli-context) so commands run against that workspace. 4. Optionally [scaffold a project](#scaffold-a-project) against the selected context. The sections below explain the attributes that shape a tenant or workspace at creation. ### Plans [#plans] Each tenant receives a plan that determines available features. | Plan | Use for | | ------------ | ----------------------------------------- | | `essential` | Core platform features | | `managed` | Dome-managed platform + gateway | | `enterprise` | Full feature set with SLA | | `complete` | Everything, including custom integrations | You set the plan when you [create a tenant](#create-a-tenant). ### Join policies [#join-policies] `join_policy` controls how non-members enter a tenant or a workspace. Every tenant and every workspace carries its own value. The workspace policy is independent of its tenant's. New tenants and workspaces default to `invite_only` when the field is omitted at creation. | Value | Who can enter | | ------------- | ---------------------------------------- | | `open` | Verified-domain users join automatically | | `request` | Users request access. Admins approve | | `invite_only` | Admins must invite users (default) | You set `join_policy` when you [create a tenant](#create-a-tenant) or [create a workspace](#create-a-workspace). ## Requirements [#requirements] Before you begin, authenticate the Dome CLI. ### Permissions [#permissions] Tenant and workspace creation use org- and tenant-scoped roles. Each operation states the permission it requires. For exhaustive flags, tool parameters, and endpoint contracts, refer to the [CLI](/cli/settings/tenants), [MCP](/reference/mcp/platform), and [API](/api/tag/tenants/create-tenant) references. | Default roles | Permission | Grants | | ---------------------- | ---------------- | ----------------- | | Org `admin` or `owner` | `tenants.manage` | Create tenants | | Tenant `admin` | `tenants.manage` | Create workspaces | ## Create a tenant [#create-a-tenant] Create a tenant under your organization when you need a hard isolation boundary. You can set [plan](#plans) and [join policy](#join-policies) in the same call. > **Note**: Requires org-level `tenants.manage` (held by org `admin` or `owner`). **CLI** ```bash dome tenants create --name acme-prod --plan managed --join-policy request dome tenants list ``` | Flag | Description | | --------------- | -------------------------------------------------------------- | | `--name` | Tenant display name (required). | | `--plan` | `essential` (default), `managed`, `enterprise`, or `complete`. | | `--join-policy` | `open`, `request`, or `invite_only` (default when omitted). | | `--org-id` | Target org. Defaults to the active context's org. | > **Note**: Reference: [`dome tenants create`](/cli/settings/tenants#create-tenant) **MCP** Tools: `dome_tenants_create`, `dome_tenants_list`, `dome_tenants_get` Pass `join_policy` on create (`open`, `request`, or `invite_only`). Omit it to take the server default. > **Note**: Reference: [`dome_tenants_create`](/reference/mcp/platform#tenants-create) **API** ```http POST /v1/tenants { "name": "acme-prod", "plan": "managed", "join_policy": "request" } ``` > **Note**: Reference: [`CreateTenant`](/api/tag/tenants/create-tenant) **Agent** ```text title="Create a tenant" Create a tenant named "acme-prod" on the managed plan. ``` ## Create a workspace [#create-a-workspace] Create a workspace for a team or environment inside a tenant. You can set [join policy](#join-policies) in the same call. List or delete workspaces as teams and projects change. > **Note**: Requires tenant-level `tenants.manage` (held by a tenant `admin`, or by org `owner` / `admin` via cascade). **CLI** ```bash dome workspaces create --name "payments-team" --join-policy open dome workspaces list dome workspaces delete ``` > **Note**: Reference: [`dome workspaces`](/cli/settings/workspace) **MCP** Tools: `dome_workspaces_create`, `dome_workspaces_list`, `dome_workspaces_get`, `dome_workspaces_delete` Pass `join_policy` on create (`open`, `request`, or `invite_only`). Omit it to take the server default. > **Note**: Reference: [`dome_workspaces_create`](/reference/mcp/workspaces) **API** ```http POST /v1/workspaces { "tenant_id": "{{TENANT_ID}}", "slug": "payments", "name": "Payments", "join_policy": "invite_only" } ``` > **Note**: Reference: [`CreateWorkspace`](/api/tag/workspaces/create-workspace) **Agent** ```text title="Create a workspace" Create a workspace named "payments-team". ``` ## Select a CLI context [#select-a-cli-context] Sync after creating a tenant or workspace, then select the target so CLI and MCP commands run against that workspace. ```bash dome context sync dome context list dome context use production dome context current ``` Use `workspace`, `tenant/workspace`, or `org/tenant/workspace` shorthand when names overlap. ## Scaffold a project [#scaffold-a-project] Create a starter project against the selected environment. ```bash dome quickstart my-agent-project ``` The command generates SDK setup, `dome.yaml`, environment placeholders, a Dockerfile, and starter Cedar rules. ## Next steps [#next-steps] * [Manage Access](/manage/access) * [Configure Platform](/manage/settings) * [Quickstart](/quickstart) # Export (/manage/export)

{dataExport}

## Overview [#overview] Forwarders and one-shot destination pushes read the same audit trail. Configuration and runtime events ship together unless you filter. Refer to [Audit events](/operate/audit) to query or reconstruct events, including gateway decisions. Refer to [Audit events](/concepts/audit) concept for the unified trail model. Ad-hoc exports to stdout or a file use [`dome audit export`](/cli/operate/audit#export-events) and [`dome_audit_export`](/reference/mcp/audit#audit-export). The typical workflow is: 1. [Choose a format](#choose-a-format) your downstream pipeline understands. 2. [Configure a destination](#configure-a-destination) and store its credentials as integration secrets. 3. [Schedule recurring exports](#schedule-recurring-exports) or push once with the export REST endpoint. 4. [Inspect export runs](#inspect-export-runs) and [monitor forwarder health](#monitor-forwarder-health). 5. Optionally [stream audit evidence to a SIEM](#stream-audit-evidence-to-a-siem) for continuous Datadog or Grafana Loki delivery. [Map SIEM fields](#map-siem-fields) when you consume OCSF or CEF. [Ingest external audit events](#ingest-external-audit-events) when systems outside the gateway must contribute to the same trail. The sections below cover formats, destinations, schedules, run inspection, forwarder health, SIEM field mapping, and external ingestion. ## Requirements [#requirements] Before you begin: * Authenticate to Dome and select a workspace * Have destination credentials ready to store as integration secrets * Know which format and connector your pipeline requires ### Permissions [#permissions] Export configuration and schedules require platform permissions for integrations and audit export. Each operation states what it configures or returns. | Default roles | Permission | Grants | | ------------------------------- | --------------------- | ------------------------------------------------------------ | | `admin`, `operator` | `integrations.manage` | Configure export destinations and related settings | | `admin`, `operator`, `security` | `audit.export` | Run and schedule audit export; enable or resume SIEM streams | | All workspace roles | `audit.view` | List SIEM streams and read stream status | ## Choose a format [#choose-a-format] Pick the format your downstream pipeline understands. Destination connectors and the CLI / MCP export surfaces accept the same values where noted. | Format | Extension | Content-Type | Use for | | ------- | ------------ | ---------------------- | --------------------------------------------------------------------------------- | | `jsonl` | `.jsonl` | `application/x-ndjson` | NDJSON, one event per line for log shippers, `tail -f`, and `jq`. CLI / MCP only. | | `json` | `.json` | `application/json` | Pretty-printed JSON array for archives. | | `csv` | `.csv` | `text/csv` | Spreadsheet-friendly flat rows. File-based connectors only. | | `ocsf` | `.ocsf.json` | `application/json` | OCSF v1.1.0 for Splunk, Microsoft Sentinel, and Google Chronicle. | | `cef` | `.cef` | `text/plain` | Common Event Format for ArcSight, QRadar, and generic syslog. | CLI and MCP exports page until the requested cap or cursor exhaustion. They fail instead of writing a silently shortened artifact when a page is incomplete, a cursor repeats, or the request would exceed 10,000 events. A payload type newer than the client is preserved as unresolved; it does not remove the event. ## Configure a destination [#configure-a-destination] Configure an export integration before creating a schedule. Each destination reads the same audit query and serializes matching events in its selected format. Refer to [Audit events](/operate/audit) for the filter model those queries use. | Connector | Formats | Destination | | ------------------------ | ---------------------------- | ----------------------------------------------------------------------------- | | **Amazon S3** | `csv`, `json`, `ocsf`, `cef` | Bucket + prefix. Object key suffixed with the format extension | | **Google Cloud Storage** | `csv`, `json`, `ocsf`, `cef` | Bucket + prefix. Object key suffixed with the format extension | | **Datadog Logs** | `json`, `ocsf`, `cef` | Datadog Log Intake API (Cloud SIEM consumes `ocsf` natively. CSV is rejected) | Write connector credentials as integration secrets, then push once with the export REST endpoint. ```http POST /v1/audit/export Content-Type: application/json { "instance_id": "{{INTEGRATION_INSTANCE_ID}}", "connector": "s3", "format": "ocsf", "filter": { "start_time": "2026-05-01T00:00:00Z", "end_time": "2026-06-01T00:00:00Z" } } ``` The handler validates `format` up front and rejects unknown values with `400`. S3 and GCS write a single object per call, named `_to_.` under the configured prefix. Datadog batches events in groups of 1000 to the Log Intake API. ## Schedule recurring exports [#schedule-recurring-exports] Create an `audit_export` job for the configured destination. Set the interval, time, format, and event filters together. ```http POST /api/v1/workspaces/{{WORKSPACE_ID}}/jobs Content-Type: application/json { "job_type": "audit_export", "config": { "instance_id": "{{INTEGRATION_INSTANCE_ID}}", "format": "ocsf", "filters": { "event_classes": ["EVENT_CLASS_GOVERNING"] } }, "interval_value": 1, "interval_unit": "day", "time_of_day": "02:00", "enabled": true } ``` You can use `hour`, `day`, `week`, or `month` intervals. Weekly schedules accept `day_of_week`. Daily, weekly, and monthly schedules use UTC `time_of_day`. Update or disable a schedule with `PATCH /api/v1/workspaces/{{WORKSPACE_ID}}/jobs/{{JOB_ID}}`. Delete it when the forwarder should stop permanently. ## Inspect export runs [#inspect-export-runs] Read a scheduled job to inspect its ten most recent runs. ```http GET /api/v1/workspaces/{{WORKSPACE_ID}}/jobs/{{JOB_ID}} ``` Each run reports `running`, `success`, or `failed`, plus start time, finish time, error, and result. Investigate failures before the next scheduled window. List every export schedule in a workspace. ```http GET /api/v1/workspaces/{{WORKSPACE_ID}}/jobs?job_type=audit_export ``` ## Monitor forwarder health [#monitor-forwarder-health] Treat a configured integration as connected, then use recent run state to assess delivery. The table below maps each state to the next action. | State | Action | | -------------- | -------------------------------------------------------------------------- | | Not configured | Create credentials and an integration instance. | | No runs yet | Confirm the schedule is enabled and wait for its first window. | | Running | Check again after the current window completes. | | Success | Verify the destination received the expected object or batch. | | Failed | Read the run error, repair credentials or destination settings, and retry. | The dashboard's **Integration & Forwarder Health** panel lists available export destinations and their connection state. ## Stream audit evidence to a SIEM [#stream-audit-evidence-to-a-siem] Continuous SIEM streaming delivers new audit evidence to Datadog or Grafana Loki as it is accepted. It is separate from batch export above and from [webhooks](/operate/webhooks). Streaming is forward-only from the moment you enable it. Dome does not backfill history. Your organization plan must include SIEM streaming. Connect Datadog or Grafana Loki under [Integrations](/operate/integrations) in the dashboard first. CLI and MCP can list connected instances, then enable and manage the stream. ### Permissions [#permissions-1] | Default roles | Permission | Grants | | ------------------------------- | -------------- | ----------------------------------- | | All workspace roles | `audit.view` | List streams and read status | | `admin`, `operator`, `security` | `audit.export` | Enable, disable, or resume a stream | ### Enable and manage a stream [#enable-and-manage-a-stream] > **Note**: Mutations require `audit.export`. Status and list require `audit.view`. **CLI** ```bash dome audit siem list dome audit siem enable dome audit siem status dome audit siem disable dome audit siem resume ``` `enable` creates a stream. If one already exists (running or stopped), enable is refused — use `resume`. `disable` stops delivery but keeps the cursor, so backlog while off remains deliverable. `resume --skip-to-now` abandons undelivered backlog permanently (requires `--yes` non-interactively). > **Note**: Reference: [`dome audit siem`](/cli/operate/audit#siem) **MCP** Tools: `dome_audit_siem_list`, `dome_audit_siem_enable`, `dome_audit_siem_status`, `dome_audit_siem_disable`, `dome_audit_siem_resume` > **Note**: Reference: [`dome_audit_siem_enable`](/reference/mcp/audit#siem-enable) **Dashboard** Open the Datadog or Grafana Loki integration instance and use the SIEM stream controls on that page. Delivery states include `active`, `erroring`, and `paused`. Dome can auto-pause after sustained delivery failure or a retention gap. Resume after you repair the destination. `enabled` is the delivery switch; `state` is retained health. Read them together. A disabled stream can retain `state=active` because it was healthy when stopped, and proto JSON can omit `enabled=false`. It is not delivering unless `enabled=true`. A destination has no stream until its first enable, so list omits never-enabled destinations and status returns not found. Resume without `--skip-to-now` is refused whenever the retained cursor has aged out, even if the stream never reached a recorded `retention_gap` pause. The refusal itself is authoritative; do not infer whether skipping is required only from `paused_reason`. Do not confuse this with [`dome audit stream`](/operate/observe), which is the live investigation tail in the dashboard or terminal. ## Map SIEM fields [#map-siem-fields] OCSF and CEF exports carry the request-origin fields from the audit envelope so SOC pivots by IP, user agent, or HTTP verb work without re-joining sources. Configuration events typically populate these fields. Many gateway decisions leave `request_surface` unset. Refer to [Audit events](/concepts/audit#why-attribution-differs-by-source) concept for why attribution differs by event type. | Audit envelope | OCSF (`ocsf`) | CEF (`cef`) | | ----------------------------- | --------------------------- | -------------------------- | | `request_surface.source_ip` | `src_endpoint.ip` | `src` | | `request_surface.user_agent` | `unmapped.dome_user_agent` | `requestClientApplication` | | `request_surface.http_method` | `unmapped.dome_http_method` | `requestMethod` | | `actor.id` | `actor.user.uid` | `suid` | ## Ingest external audit events [#ingest-external-audit-events] External systems push audit events into the unified trail via the REST ingestion endpoint, consolidating agent activity from systems outside the gateway. Refer to [Audit events](/operate/audit) to query ingested events. ## Next steps [#next-steps] * [Audit events](/concepts/audit) concept for the one trail every surface reads from * [Audit events](/operate/audit) how-to to query retained and ingested events * [Subscribe to Events](/operate/webhooks) how-to for near-real-time signed deliveries * [Event contracts](/reference/events/contracts) reference for the envelope and ingest routes * [Event catalog](/reference/events/catalog) reference for every event type you can export # Import and export configuration (/manage/import-export) Move configuration between workspace, tenant, and organization scopes. Export a reviewed file, then plan and import it without destroying existing resources. ## Overview [#overview] An export contains the selected Dome resources and their relationships. Use it to promote reviewed changes or keep a durable record of a scope's resources. Exports never contain secrets. Dome replaces secret and environment-specific values with variables, then asks for their values when you import. Scope identifiers are derived from the scope you import into and are never values you need to supply. The typical workflow is: 1. [Choose the source and target scope](#choose-the-source-and-target-scope) and confirm the target can contain the resources you plan to move. 2. [Export configuration](#export-configuration) from the source scope and review the generated file. 3. [Plan the import](#plan-the-import) in the target scope and review the proposed changes. 4. [Import configuration](#import-configuration) only after the plan is correct. 5. Store any one-time outputs as soon as the import completes. The sections below explain scope boundaries, required permissions, export selection, and safe import practices. > **Note**: Import / Export is available in every organization. Actions remain governed by the permissions listed below; make sure you are working in the intended source or target scope. This page describes configuration portability. To deliver audit records to a SIEM or object store, use [Export data](/manage/export) instead. ## Choose the source and target scope [#choose-the-source-and-target-scope] Select the source scope before export and the target scope before planning or importing. A target cannot import resources above or outside its own boundary. Dome derives scope identifiers from the target, so you never need to enter them. | Resource family | Workspace | Tenant | Organization | | ---------------------------------------------------------------------------------------------------------------------------------- | :-------: | :----: | :----------: | | gateways, tool and model connections, model pools, and memberships | ✅ | ✅ | ✅ | | agents, agent keys, rules, filters, validators, judges, and constitutions | ✅ | ✅ | ✅ | | Managed agents and triggers (preview) | ✅ | ✅ | ✅ | | Workspace quotas, verification providers, custom roles, API keys, and memberships | ✅ | ✅ | ✅ | | Webhooks, audit streams, scheduled jobs, and workspace settings | ✅ | ✅ | ✅ | | Tenant settings, roles, custom roles, API keys, verification providers, and quotas | ❌ | ✅ | ✅ | | Workspaces | ❌ | ✅ | ✅ | | Organization settings, members, domain SSO requirements, model pricing, custom roles, API keys, verification providers, and quotas | ❌ | ❌ | ✅ | | Tenants | ❌ | ❌ | ✅ | Secrets are never exported. Resources that create credentials, such as API keys, produce new one-time outputs when imported. Shared connections that require a person to finish authorization are reported as a handoff. Managed agents and their triggers are preview resources. Export omits them without source organization preview access. Importing them requires the target organization to opt into previews. ## Requirements [#requirements] Before you begin: * Select the source scope for export and the target scope for planning or import. * Confirm access to both scopes and every preview family in the export. ### Permissions [#permissions] | Task | Required permission | | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | | Export | `export.manage` at the source scope, plus view permission for each resource family you export | | Inspect, preview, follow, or cancel an import | `import.manage` at the target scope | | Run an import | `import.manage` at the target scope, plus every permission required to create or update the imported resources | An export omits a family you cannot view and reports that omission. An import preflight reports every missing permission before it starts a job. ## Export configuration [#export-configuration] **Dashboard** 1. Open **Settings** and select **Import / Export**. 2. In **Export**, select the resource families or individual resources to include. Enable dependencies when the selected resources refer to other configuration that should move with them. 3. Download the generated `.tf` file. 4. Review the file before sharing it or committing it to a repository. **CLI** Use the active Dome context as the source scope. Start with `--list` to see exportable resources, then export every resource, a family, or selected resource IDs. ```bash title="Export a workspace configuration" dome export --list dome export --all --output dome.tf # Export a family and the resources it references. dome export --include gateways --with-dependencies --output gateways.tf ``` The command writes the export file to standard output unless you provide `--output`. Use `--resource ` to select individual resources. The export includes only the selected configuration and any dependencies you request. If Dome cannot render a selected resource, it lists the resource and reason rather than silently producing an incomplete file. ### Review the export file [#review-the-export-file] An export file carries Dome metadata that helps import match resources with an existing scope. Treat it as a configuration artifact: review changes in version control and retain it with the environment it describes. An export can contain variables, resource definitions, and outputs. Import accepts only the Dome resource format and rejects executable or ambient features such as modules, data sources, provisioners, backends, provider configuration, and filesystem-reading functions. These limits ensure that an uploaded file cannot execute outside the import job. Exports retain disabled triggers, paused jobs and streams, inactive webhooks, disabled quotas, and managed agents with manual runs off. Exports write every scope setting value, so imports reproduce source choices instead of retaining different target settings. > **Warning**: Do not add secret values to an export file. Declare a sensitive variable and supply its value during import. A completed import may create new credentials. Save its one-time outputs immediately because Dome reveals them only once to the person or API key that started the job. ## Plan the import [#plan-the-import] A plan validates the export file, resolves its variables, and reports the proposed changes without changing the target scope. Run a plan every time you move an export to a new scope or revise its values. **Dashboard** 1. Open **Settings** → **Import / Export** in the target scope. 2. Upload one or more `.tf` files, or paste a supported Dome configuration. 3. Select **Inspect**. Dome validates the file, lists its resources and variables, and reports missing permissions. 4. Enter required variable values, then select **Preview (plan only)**. 5. Review the plan summary and per-resource results. **CLI** ```bash title="Plan an import without changing the target scope" dome import dome.tf --plan-only --var api_token="$API_TOKEN" ``` The CLI validates the file and prompts for any missing values before it submits the plan job. Use a variable file or environment variables for unattended runs. For structured variables, such as a map of secret headers, pass JSON as the value. For example: `--var headers='{"X-Api-Key":"…"}'`. ### Import file requirements [#import-file-requirements] Import accepts an export from Dome or a hand-authored Dome configuration file. A bundle can contain up to 32 `.tf` files, with a maximum of 1 MiB per file, 2 MiB in total, and 2,000 resource definitions. The values you supply for variables can total up to 256 KiB. Each file must contain only supported Dome configuration. Dome rejects modules, data sources, provisioners, backends, non-Dome providers, and functions that can read from the worker or its filesystem. The inspection step reports these problems before it creates an import job. ### Interpret plan results [#interpret-plan-results] A plan can include these outcomes: | Outcome | Meaning | Next step | | --------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | | Create | The target scope does not contain a matching resource. | Review the resource that will be created. | | Update | A matching resource exists but differs from the export. | Confirm the proposed configuration is intended. | | Import | Dome matched an existing resource during the state-free run. | No separate state is retained. | | Unchanged | The target already matches the export. | No action needed. | | Refused | The plan would be unsafe, the file is unsupported, or permission is missing. | Read the refusal detail, fix the file or access, and plan again. | ## Import configuration [#import-configuration] After you approve the plan, start the import. Dome processes the import on a managed worker and keeps no state: it matches resources that already exist by their natural identity, creates the rest, and never destroys or replaces a resource. Dome refuses any plan that would destroy or replace something. **Dashboard** 1. Return to the inspected file and its reviewed values in **Settings** → **Import / Export**. 2. Select **Import**. 3. Follow the job until it finishes. Complete any displayed handoff, then reveal and store any one-time outputs. **CLI** ```bash title="Import a reviewed export" dome import dome.tf --var api_token="$API_TOKEN" --yes ``` ```bash title="Run an import in CI" dome import dome.tf \ --var-file production-vars.yaml \ --yes # Equivalent environment-variable form for a declared variable named api_token. export DOME_IMPORT_VAR_api_token="$API_TOKEN" dome import dome.tf --yes ``` Use `--detach` to submit without waiting, then follow the job later: ```bash title="Follow an import job" dome import dome.tf --detach --yes dome import status dome import outputs ``` `dome import outputs` reveals secrets created by the job exactly once. Run it only when you are ready to store the values securely. The import job records its status, per-resource results, and any required handoff. A handoff means a shared connection needs a human action, such as OAuth consent. Complete the listed follow-up before relying on that connection. Cancel a job only before it begins applying. Once application begins, wait for the result rather than assuming cancellation took effect. ## Troubleshoot imports [#troubleshoot-imports] | Situation | What it means | What to do | | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- | | Missing permissions | The target role cannot create or update one or more resources in the file. | Review the permissions reported during inspection, then ask an administrator to grant the required access. | | Unsupported file | The file contains unsupported configuration or exceeds a bundle limit. | Inspect again, remove the unsupported content, or split the configuration into smaller files. | | Scope mismatch | The file contains a resource outside the target's scope, such as a tenant resource in a workspace import. | Choose a target that contains the resource or export only resources that fit within the target boundary. | | Preview resource unavailable | The file includes a preview resource, such as a managed agent or trigger, that the target organization cannot use. | Ask an organization owner or administrator to opt the target organization into previews, or remove that resource from the import. | | Cancellation does not complete | The job has already started applying. | Wait for the job result. Dome does not interrupt application after it begins. | | Handoff required | A shared connection needs a person to finish setup, such as granting OAuth consent. | Complete the handoff shown in the job result before relying on the connection. | ## Operational guidance [#operational-guidance] * Keep exports in source control, but protect variable files and CI secrets. * Promote a reviewed export through environments with a preview at each target scope. * Export dependencies with a resource when you need a self-contained configuration. Otherwise, ensure its referenced resources already exist in the target. * Use the export result's omissions and exclusions as a review checklist. Do not assume an export is complete when your access excludes a resource family. * Start with a small export when moving a new type of configuration, then use the preview summary to confirm how Dome matches existing resources. ## Next steps [#next-steps] * [Import CLI reference](/cli/manage/import) to plan, apply, and monitor configuration imports * [Export CLI reference](/cli/manage/export) to create reviewed configuration files * [MCP reference](/reference/mcp/import-export) for agent-driven workflows * [API reference](/api) for REST operations * [Audit event catalog](/reference/events/catalog#import-and-export-configuration) for export and import job activity * [Manage Access](/manage/access) to grant portability permissions * [Prepare Environments](/manage/environments) to organize promotion targets * [Settings](/manage/settings) to configure workspace defaults # Manage (/manage) **Manage** administers the Dome platform: workspace defaults, who can administer Dome, tenants and workspaces, configuration import and export, audit export, and billing. If you are standing up a new boundary, start with [Environments](/manage/environments). The other pages assume a workspace already exists. ## What you administer [#what-you-administer] * [Environments](/manage/environments): Create tenants and workspaces, then select a CLI context. * [Settings](/manage/settings): Set workspace defaults such as audit retention, policy refresh, and rule-bundle history. * [Public preview](/manage/public-preview): Enable public-preview features for your organization and see what is currently available. * [Access](/manage/access): Assign workspace roles and scoped platform API keys for people and automation. * [Dome MCP](/manage/mcp): Connect an MCP client to Dome and manage the platform with your own account. * [Import & Export](/manage/import-export): Move reviewed workspace, tenant, or organization configuration between compatible scopes. * [Export](/manage/export): Send retained audit records to your SIEM or object store, in batches or via continuous streaming. * [Billing](/manage/billing): Review plan status, usage, seats, and invoices. These grants and settings are platform administration only. They do not authorize agent tool or model calls, attach agent-facing resources, or replace investigation under [Operate](/operate). See [Scopes](/concepts/platform/scopes) for tenancy boundaries and [Permissions](/concepts/platform/permissions) for platform RBAC versus runtime agent authorization. ## Typical workflow [#typical-workflow] 1. [Prepare environments](/manage/environments) to create tenants and workspaces, then select a CLI context. 2. [Configure platform](/manage/settings) to set workspace defaults and review configuration changes in audit. 3. [Enable public preview](/manage/public-preview) when you want to use public-preview features offered to your organization. 4. [Manage access](/manage/access) to assign workspace members and create or revoke scoped platform API keys. 5. [Import and export configuration](/manage/import-export) to move reviewed resources between compatible scopes. 6. [Export data](/manage/export) to choose a format, configure a destination, schedule runs, and monitor forwarder health. 7. [Review billing](/manage/billing) for plan status, usage, and invoices. Configure audit destinations and enterprise single sign-on under [Operate → Integrations](/operate/integrations). ## Next steps [#next-steps] * [Build](/build) to create agents, gateways, and managed-agent triggers. * [Connect](/connect) to attach callers, tools, models, and pools. * [Govern](/govern) to authorize actions, inspect content, and cap spend. * [Operate](/operate) to investigate audit events, configure integrations, and subscribe external systems. # Integrations (/manage/integrations) # Configure Dome via MCP (/manage/mcp) Use Dome MCP to manage Dome resources from an MCP client. Each person connects with their own account, chooses a home context at sign-in, and acts with their existing Dome permissions. ## Overview [#overview] The Dome MCP server is available at `https://mcp.domesystems.ai`. It gives clients such as Claude Code, Claude.ai, and Cursor direct access to Dome's management tools for agents, resources, gateways, rules, audit, and other platform resources. It serves the same tools as `dome mcp serve`, using Streamable HTTP. Each person signs in through their browser. They do not need a platform API key, and their actions are attributed to their own session. See the [MCP server reference](/reference/mcp) for the full list of Dome resources and operations you can manage through MCP. ## Requirements [#requirements] Before you begin: * Confirm that Dome MCP sign-in is enabled for the organization you need to use. * Use an MCP client that supports remote Streamable HTTP servers and OAuth sign-in. * Sign in to Dome with an account that can access the required organization, tenant, or workspace. An organization owner or admin controls whether members can sign in from MCP clients. The setting is on by default. ## Connect your client [#connect-your-client] Add Dome MCP without an authorization header. Your client receives an OAuth challenge, opens a browser, and returns to the MCP connection after you sign in. For Claude Code: ```bash claude mcp add --transport http dome https://mcp.domesystems.ai ``` For clients that ask for a server URL, use: ```txt https://mcp.domesystems.ai ``` Use Streamable HTTP, not the legacy SSE transport. The root URL and `https://mcp.domesystems.ai/mcp` address the same server; prefer the root URL unless your client requires `/mcp`. ## Choose and switch contexts [#choose-and-switch-contexts] During sign-in, choose a home context. A context is an organization, tenant, or workspace where you have access. New conversations begin there. Ask your MCP client to use these Dome tools when you need to inspect or change the active context: * `dome_context_current` shows the context for the current conversation. * `dome_context_list` lists contexts you can reach. * `dome_context_use` switches the current conversation to a selected context. Context is scoped to one MCP conversation. Switching in one conversation does not change another, and Dome never silently falls back to a different context when access changes. ## Manage your sessions [#manage-your-sessions] Your Dome MCP sign-in appears alongside your Dashboard browsers and CLI installs. List every active session, then revoke a lost or unneeded client session from the CLI: ```bash dome sessions list dome sessions revoke {{SESSION_ID}} ``` Use the session ID returned by `dome sessions list`. Revoking a session ends every credential it holds, and the client must sign in again before it can act. To sign out of every session except the CLI you are using: ```bash dome sessions revoke --others ``` Sessions belong to the signed-in person. These commands require `dome auth login`; a platform API key cannot list or revoke sessions. ## Control organization access [#control-organization-access] Organization owners and admins can inspect or change the Dome MCP sign-in setting: ```bash dome orgs mcp-sign-in get dome orgs mcp-sign-in set --enabled=false ``` Turning the setting off prevents every member's MCP session from acting in that organization on its next request. It also removes the organization from the sign-in context picker. Their sessions can continue to act in other organizations where Dome MCP sign-in remains enabled. Turn it back on when members should be able to choose the organization again: ```bash dome orgs mcp-sign-in set --enabled=true ``` Pass `--org {{ORG_ID}}` to target another organization instead of the active context's organization. ## Use a platform API key instead [#use-a-platform-api-key-instead] Use a platform API key only when an automated client needs one fixed scope. Add the key as the server's `Authorization` header: ```bash claude mcp add --transport http dome https://mcp.domesystems.ai \ --header "Authorization: Bearer {{PLATFORM_API_KEY}}" ``` A key cannot switch contexts the way a signed-in person can. Prefer Dome MCP sign-in for people who work across organizations, tenants, or workspaces. ## Next steps [#next-steps] * [MCP server reference](/reference/mcp) for the full list of Dome resources and operations you can manage * [Manage Access](/manage/access) to assign roles and issue scoped platform API keys * [Environments](/manage/environments) to manage organizations, tenants, workspaces, and CLI contexts # Public preview (/manage/public-preview) Public-preview features are released features that are not yet generally available. An organization-wide setting controls access to every public-preview feature available to your organization. ## Requirements [#requirements] Before you begin: * Be an organization owner or administrator. * Authenticate the Dome CLI with a context for the organization you want to manage. ## Enable public preview [#enable-public-preview] Turn on public preview for the active organization: ```shell dome orgs previews enable ``` To target another organization, pass its ID: ```shell dome orgs previews enable --org ``` You can also turn on public preview in the Dashboard: go to **Settings → Organization**, then enable **Preview features**. > **Note**: This is one organization-wide setting, not a per-feature selection. Enabling it makes every public-preview feature Dome currently offers your organization available. ## Check available features [#check-available-features] Run the following command to see whether public preview is enabled and the public-preview features currently offered to your organization: ```shell dome orgs previews get ``` The output shows each feature's name, description, and whether it is enabled. Availability can vary by organization and plan, so this command is the source of truth for your organization. ## Current public-preview features [#current-public-preview-features] When available to your organization, enabling public preview gives you access to: * [Managed agents](/build/agents/managed), including scheduled and webhook-triggered runs. Dome runs these agents for you. * Escalations, which pause a governed request for an approval or denial before it proceeds. * Probes, which run adversarial tests against a bot or gateway and report the governance controls that catch them. Probes are available only to eligible organizations. ## Disable public preview [#disable-public-preview] Turn public preview off for the active organization: ```shell dome orgs previews disable ``` Turning public preview off makes every public-preview feature unavailable immediately, including resources already created with those features. Turn it back on to restore access. ## Next steps [#next-steps] * [Managed agents](/build/agents/managed) to configure agents that Dome runs on demand, on a schedule, or from a webhook. * [Govern](/govern) to set policies and controls for governed requests. # Settings (/manage/settings)

{settings}

## Overview [#overview] Each workspace carries its own configuration. Unset keys resolve to their defaults. Set only values that differ from the platform baseline, and validate each change against the supported range before rollout. Configuration writes are audited. Every write emits a `workspace.config.update` event with previous and new values. Sensitive values use `` in the audit payload. The typical workflow is: 1. [List or set workspace defaults](#configure-workspace-defaults) for the keys you need to change. 2. [Review changes](#review-changes) in audit before and after a rollout. ### Workspace configuration keys [#workspace-configuration-keys] These keys control retention, policy sync, and bundle history. | Key | Default | Range | Effect | | ----------------------------------- | ------- | ---------- | ------------------------------------- | | `audit.retention_days` | `90` | `1`–`3650` | Retains audit events before pruning. | | `authorization.rule_sync_interval` | `30s` | `5s`–`10m` | Refreshes the gateway policy bundle. | | `authorization.max_bundle_versions` | `10` | `1`–`100` | Retains policy versions for rollback. | You list and set these keys when you [configure workspace defaults](#configure-workspace-defaults). ## Requirements [#requirements] Before you begin, authenticate the Dome CLI and select a workspace context. ### Permissions [#permissions] Workspace settings writes require an `admin` role (or equivalent cascade) with `config.manage`. Each operation states the permission it requires. For exhaustive flags, tool parameters, and endpoint contracts, refer to the [CLI](/cli/settings/workspace), [MCP](/reference/mcp/workspaces), and [API](/api/tag/platform/get-config) references. | Default roles | Permission | Grants | | ----------------------------------------- | --------------- | ----------------------------------------- | | Workspace `admin` (or equivalent cascade) | `config.manage` | List and set workspace configuration keys | ## Configure workspace defaults [#configure-workspace-defaults] List or set [workspace configuration keys](#workspace-configuration-keys). Unset keys resolve to their defaults. Set only values that differ from the platform baseline. > **Note**: Requires workspace `admin` (or an equivalent cascaded role) with `config.manage`. **CLI** ```bash dome workspaces config list dome workspaces config set --key audit.retention_days --value 90 dome workspaces config set --key authorization.rule_sync_interval --value 15s ``` > **Note**: Reference: [`dome workspaces`](/cli/settings/workspace) **MCP** Tools: `dome_workspaces_config_list`, `dome_workspaces_config_set` > **Note**: Reference: [`dome_workspaces_config_set`](/reference/mcp/workspaces) **API** ```http GET /v1/config/{key}?workspace_id={{WORKSPACE_ID}} PUT /v1/config/{key} ``` > **Note**: Reference: [`GetConfig`](/api/tag/platform/get-config) **Agent** ```text title="Configure workspace defaults" List the workspace configuration. Set workspace config key "audit.retention_days" to "90". ``` Every write emits a `workspace.config.update` event with previous and new values. Sensitive values use `` in the audit payload. ## Review changes [#review-changes] Query configuration changes before and after a rollout. ```bash dome audit query \ --types workspace.config.update \ --primary-resource-kind workspace ``` Use [Audit events](/operate/audit) to filter the full configuration history. ## Next steps [#next-steps] * [Manage Access](/manage/access) * [Prepare Environments](/manage/environments) * [Audit events](/operate/audit) — filter on `workspace.config.update` # Audit events (/operate/audit)

{auditEvent}

Refer to [Audit events](/concepts/audit) concept for how the trail is shaped. ## Overview [#overview] Audit v1 is the public envelope and service version; the current event registry is the schema-v4 catalog. Stream Live Events shows the same record in real time. Export delivers retained history downstream. Continuous SIEM streaming is a separate forward-only path on [Export data](/manage/export#stream-audit-evidence-to-a-siem). The typical workflow is: 1. [Browse the event catalog](#browse-the-event-catalog) when you need field names and filterable payload keys. 2. [Query events](#query-events) with class, actor, resource, correlation, or payload filters. 3. [Get an event](#get-event) by ID when you need the full envelope. 4. [List](#list-activity-chains) or [get](#get-activity-chain) an activity chain, or [emit](#emit-activity-chain) an `activity_id` for a run. ## Requirements [#requirements] Before you begin: * Authenticate to Dome and select a workspace * Have audit events in the workspace, or emit activity so chains appear ### Permissions [#permissions] Audit reads require platform permissions. People and scoped API keys query the trail. Agent credentials are not the usual path for investigation. All workspace roles can query events, get an event by ID, and list or get activity chains with `audit.view`. Org `owner` and `admin` can also use org-scoped `audit.view` to [query across the organization](#query-events-across-an-organization). Live streaming on [Stream Live Events](/operate/observe) uses the same permission. Batch and scheduled delivery live under [Export Data](/manage/export). | Default roles | Permission | Grants | | ---------------------- | ---------------- | --------------------------------------------------------- | | All workspace roles | `audit.view` | Query events, get by ID, list and get activity chains | | Org `owner` or `admin` | Org `audit.view` | Query events across every tenant and workspace in the org | ## Browse the event catalog [#browse-the-event-catalog] List every audit event type Dome emits, then show field detail for one type. The same catalog powers the dashboard Event Catalog tab. > **Note**: Requires `audit.view`. **CLI** ```bash dome audit catalog list dome audit catalog show tool.call ``` List is complete and unpaginated. Filter locally, then call show for field detail. > **Note**: Reference: [`dome audit catalog`](/cli/operate/audit#catalog) **MCP** Tools: `dome_audit_catalog_list`, `dome_audit_catalog_show` ```json { "event_type": "tool.call" } ``` > **Note**: Reference: [`dome_audit_catalog_show`](/reference/mcp/audit#catalog-show) **Dashboard** Open **Settings → Eventing → Event Catalog** to browse payload fields, sample bodies, and JSON schemas. ## Query events [#query-events] Query recent audit events. The default page returns the latest 50. Combine class, result, actor, resource, correlation, payload, and time filters to narrow the trail. > **Note**: Requires `audit.view`. Common flags: `--limit`, `--types`, `--classes`, `--results`, `--agent-id`, `--since`, `--until`, and repeatable `--payload-filter`. Full flags: refer to the CLI, MCP, and API references in the callouts below. **CLI** ```bash dome audit query --limit 10 ``` > **Note**: Reference: [`dome audit query`](/cli/operate/audit#query-events) **MCP** Tool: `dome_audit_query` ```json { "limit": 10 } ``` > **Note**: Reference: [`dome_audit_query`](/reference/mcp/audit#audit-query) **API** ```http GET /v1/audit/events?page_size=10 ``` Filtered: ```json { "event_types": ["tool.call"], "stages": ["STAGE_ATTEMPTED", "STAGE_COMPLETED"], "event_classes": ["EVENT_CLASS_GOVERNING"], "results": ["RESULT_DENIED"], "agent_id": "", "page_size": 50 } ``` > **Note**: Reference: [`QueryEvents`](/api/tag/audit/query-events) **Agent** ```text title="Query recent audit events" Query the last 10 audit events. ``` The response returns matched events plus a cursor. CLI, MCP, and dashboard use short enum tokens. The raw API uses full constants. Refer to [enum rendering](/reference/events/contracts#enum-rendering) reference. ```json { "events": [{ "event_id": "", "event_type": "tool.call", "event_class": "governing", "stage": "completed", "result": "allowed", "occurred_at": "2026-05-30T10:30:00Z", "scope": { "kind": "workspace", "workspace_id": "ws_..." }, "actor": { "kind": "agent", "id": "agent_..." }, "primary_resource": { "kind": "tool_connection", "id": "conn_..." }, "request_surface": { "surface": "gateway_mcp" }, "correlation": { "trace_id": "0af7651916cd43dd8448eb211c80319c" }, "payload": { "@type": "type.googleapis.com/dome.audit.v1.ToolCallV1", "toolName": "database-query" } }], "next_page_token": "..." } ``` The pre-v1 `total` counter is gone. Use the cursor to walk the full result set. ## Query events across an organization [#query-events-across-an-organization] Read audit across every tenant and workspace in one organization from an organization-scoped session or API key. Scope is derived from the authenticated identity; the request does not accept `org_id`. Set `workspace_id` only when you want to narrow an organization- or tenant-scoped read to one workspace. > **Note**: Requires org-scoped `audit.view` (org `owner` or `admin`, or an org-scoped API key with `audit.view`). **API** ```http GET /v1/audit/events?event_classes=EVENT_CLASS_GOVERNING&results=RESULT_DENIED&start_time=2026-07-01T00:00:00Z&page_size=100 ``` > **Note**: Reference: [`QueryEvents`](/api/tag/audit/query-events) `QueryActivityChains` remains workspace- and tenant-scoped. Org-scoped chains are not available yet. CLI and MCP audit tools stay workspace-scoped today. Use the API (or an org-scoped platform key against `QueryEvents`) for org-wide reads. ### Paginate results [#paginate-results] Each response includes `next_page_token`. An empty token means the page was the last one. ```bash dome audit query --limit 200 # ... copy the printed "Next page token: ..." value dome audit query --limit 200 --page-token ``` ```json { "page_size": 200, "page_token": "" } ``` ### Filter by class and result [#filter-by-class-and-result] Use class and result together to find denials, security signals, or audit access. Refer to [event classes](/reference/events/catalog#event-classes) reference for the catalog. ```bash # Every authorization deny in the workspace dome audit query --classes governing --results denied # All audit-access events — who looked at what dome audit query --classes audit_access # Failed logins and rejected agent-token exchanges dome audit query --classes security --results denied --since 2026-06-01T00:00:00Z ``` ### Filter by actor and producer [#filter-by-actor-and-producer] Slice by who acted and which service emitted the event. ```bash dome audit query --actor-kind scheduled_job dome audit query --producer-service gateway --request-surface gateway_mcp ``` For a gateway, use `producer_gateway_id` through the [QueryEvents API](/api/tag/audit/query-events). ### Filter by resource [#filter-by-resource] ```bash dome audit query \ --primary-resource-kind rule_bundle \ --primary-resource-id ``` ### Reconstruct a request chain [#reconstruct-a-request-chain] Filter on a `trace_id` to return events from one request. Refer to [correlation](/reference/events/contracts#correlation) reference for the `trace_id`, `operation_id`, and `parent_event_id` contract. ```bash dome audit query --trace-id 0af7651916cd43dd8448eb211c80319c ``` ### Filter by payload [#filter-by-payload] Apply [payload filters](/reference/events/contracts#payload-filters) to a query. ```bash # Every tool call that targeted database-query dome audit query --payload-filter "tool.call:toolName=database-query" # Multiple values, multiple filters dome audit query \ --payload-filter "tool.call:toolName=database-query,vector-search" \ --types authorization.evaluate --results denied ``` Use the JSON form for `exists`: ```bash dome audit query --payload-filter '[ {"event_type":"tool.call","field":"toolName","operator":"exists"} ]' ``` > **Note**: `tool.call` and `model.call` payloads carry bounded content references rather than raw request arguments by default. Cedar rules still evaluate `resource.arguments.`. ### Filter by time range [#filter-by-time-range] ```bash dome audit query \ --since 2026-05-01T00:00:00Z \ --until 2026-06-01T00:00:00Z ``` ## Get event [#get-event] Retrieve a single audit event by ID. Scope is derived from the caller's session. There is no `workspace_id` argument. > **Note**: Requires `audit.view`. **CLI** ```bash dome audit get ``` > **Note**: Reference: [`dome audit get`](/cli/operate/audit#get-event) **MCP** Tool: `dome_audit_get_event` ```json { "event_id": "" } ``` > **Note**: Reference: [`dome_audit_get_event`](/reference/mcp/audit#audit-get-event) **API** ```http GET /v1/audit/events/ ``` > **Note**: Reference: [`GetEvent`](/api/tag/audit/get-event) Governing decision events that applied a loaded rule bundle include [decision provenance](/reference/events/contracts#decision-provenance) in the payload (`bundle_etag`, `contributing_bundles`, `rule_id`). The dashboard decision explainer deep-links those bundles to `/rules/bundles?scope=&scopeId=`. ## List activity chains [#list-activity-chains] List activity chains in the active workspace. A chain is listed when any of its events matches the filter. Summary counts reflect the full chain. Refer to [activity chains](/reference/events/contracts#correlation) reference for their contract. > **Note**: Requires `audit.view`. ```bash # Recent chains in the active workspace dome audit chains --limit 20 # Chains that contain a denied governing event dome audit chains --classes governing --results denied # Chains for one agent in the last 24 hours dome audit chains --agent-id agent_01HQ... --since 2026-06-05T00:00:00Z ``` > **Note**: Reference: [`dome audit chains`](/cli/operate/audit#list-chains) ```json { "chains": [{ "activity_id": "case-12345", "workspace_id": "ws_...", "event_count": 47, "first_at": "2026-06-05T10:30:00Z", "last_at": "2026-06-05T10:34:21Z", "allowed_count": 41, "denied_count": 3, "error_count": 1, "agents": ["agent_..."], "event_types": ["tool.call", "authorization.evaluate"], "server_owned_count": 0, "caller_asserted_count": 47 }], "next_page_token": "" } ``` ## Get activity chain [#get-activity-chain] Retrieve every event in one activity chain. Pass an `activity_id` to QueryEvents (or `dome audit chain`) to return events in cursor order. ```bash # All events in one chain dome audit chain case-12345 # Live tail one chain dome audit stream --activity-id case-12345 # Filter the chain's events further dome audit query --activity-id case-12345 --classes governing --results denied ``` > **Note**: Reference: [`dome audit chain`](/cli/operate/audit#show-chain) ## Denied operations [#denied-operations] A refusal is the denied result of the operation itself. For example, a refused tool invocation is `event_type=tool.call`, `stage=completed`, and `result=denied`. The shared `denial` block names why. There is no separate denial event type. `denial.reason` is a closed vocabulary: `permission_denied`, `wrong_caller_type`, `tenant_mismatch`, `unauthenticated`, `immutable_entity`, `service_disabled`, `policy_denied`, `stale_policy`, `guard_blocked`, `act_as_rejected`, `credential_required`, `rate_limited`, `oversize`, `quota_exceeded`, `plan_limit`, `billing_locked`, `subscription_canceled`, and `org_suspended`. Read `denial.required_permission` only when `reason=permission_denied`. Plan, quota, guard, and identity refusals are not permission deficits. Treat `denial.detail` as operator context, not a stable programmatic contract. Responses deliberately avoid exposing internal scope-resolution chains. Filter and automate on `reason` and, where present, `required_permission`. ```bash # Every denied operation in the last hour dome audit query --results denied --since 1h # Denied tool calls caused by a stale tenant scope dome audit query \ --types tool.call \ --results denied \ --deny-reasons tenant_mismatch # Guard-blocked tool and model calls dome audit query \ --types tool.call,model.call \ --results denied \ --deny-reasons guard_blocked ``` A `tenant_mismatch` row on a dashboard-initiated action almost always means the browser session's tenant scope drifted from the workspace's owning tenant — sign out and back in to re-scope the session. ## Emit activity chain [#emit-activity-chain] Set `activity_id` on the emit side so events from one unit of work correlate. Pick an ID that maps to that unit, such as a case ID, job run, or conversation UUID. Chains are workspace-local, so human-meaningful IDs are safe. **CLI** Set `--activity` (or `DOME_ACTIVITY_ID`) so every API call in the run carries `X-Dome-Activity-Id`. ```bash export DOME_ACTIVITY_ID="case-12345" dome agents register --name worker dome rules deploy ./rules dome audit query --limit 5 dome audit chain case-12345 ``` `--activity` overrides `DOME_ACTIVITY_ID`. There is no implicit mint. **Python SDK** Wrap Dome API reads in `client.session()`. Pass an explicit ID to correlate work across processes. ```python with client.session() as session: page = client.control.query_audit_events( AuditQuery(event_types=("tool.call",), page_size=50), ) event = client.control.get_audit_event(page.events[0].id) ``` **HTTP** Send `X-Dome-Activity-Id` on every API request. Dome stamps the ID with caller-asserted trust and strips the header before third-party LLM or MCP egress. ```http GET /v1/audit/events X-Dome-Activity-Id: case-12345 ``` ## Migrate legacy event queries [#migrate-legacy-event-queries] | Legacy audit query | Schema-v4 query | | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | | `mcp.tool_call.attempted` / `mcp.tool_call.completed` | `tool.call` plus `stage=attempted` / `stage=completed` | | `llm.model_call.attempted` / `llm.model_call.completed` | `model.call` plus the stage filter | | `mcp.tool_request.filtered`, `mcp.tool_result.filtered`, or LLM filter types | `guard.filter.evaluate`; use payload `direction`, connection type, tool, or model fields | | `access.denied` | The operation type plus `result=denied`; use `--deny-reasons` for the shared `denial.reason` | | `agent.registered`, `agent.suspended`, and other past-tense lifecycle names | Present-tense operations such as `agent.register`, `agent.suspend`, and `agent.revoke` | Webhook subscriptions keep the public `dome.webhook.v1` catalog. Do not rewrite webhook event names to audit names; where they differ, the webhook name remains authoritative on webhook deliveries. ## Next steps [#next-steps] * [Event catalog](/reference/events/catalog) reference for every event type and its class * [Event contracts](/reference/events/contracts) reference for the Audit v1 envelope, enum forms, and filter syntax * [Stream Live Events](/operate/observe) to stream events as they happen * [Export Data](/manage/export) to ship retained records to SIEM and archival sinks * [Subscribe to Events](/operate/webhooks) to push signed events to external systems # Operate (/operate) **Operate** makes governed traffic visible and actionable. Query the durable audit trail, stream live events, configure integrations, and subscribe external systems to signed deliveries. ## What you operate [#what-you-operate] * [Audit events](/operate/audit): Query and filter the durable Audit v1 trail by class, actor, resource, correlation, and payload, then follow activity chains. * [Stream live events](/operate/observe): Watch that trail in real time alongside calls and denials, health and latency, token usage and cost, and quotas. * [Integrations](/operate/integrations): Configure audit destinations and enterprise single sign-on for the systems that work alongside Dome. * [Subscribe to events](/operate/webhooks): Push a public projection of selected events to your HTTPS endpoint or a provider, signed, retried, and replayable. Audit events is the durable record. Stream watches activity inside Dome; subscribe delivers selected public events when another system must react. [Integrations](/operate/integrations) configures supported destinations for retained audit evidence. Neither replaces batch export under [Manage](/manage/export). The [Callers](/connect/callers#inspect-callers) registry under Connect is a separate projection derived from the same evidence. See [Audit events](/concepts/audit) for how the one trail works, the [Event catalog](/reference/events/catalog) for every event type, and [Event contracts](/reference/events/contracts) for the shared envelope. ## Typical workflow [#typical-workflow] 1. [Audit events](/operate/audit) to query, get, and correlate retained events when you investigate a decision or prepare evidence. 2. [Stream live events](/operate/observe) for governed traffic in real time, including token usage, cost, OpenTelemetry, and product telemetry. 3. [Integrate systems](/operate/integrations) to configure audit destinations or enterprise single sign-on. 4. [Subscribe to events](/operate/webhooks) to create destinations and subscriptions for the event types your automation must handle. Afterward you can add destinations, widen subscriptions, or change retention without touching Connect or Govern configuration. ## Next steps [#next-steps] * [Build](/build) to create agents, gateways, and managed-agent triggers. * [Connect](/connect) to attach callers, tools, models, and pools. * [Govern](/govern) to authorize actions, inspect content, and cap spend. * [Manage](/manage) to administer platform settings, access, environments, imports, exports, and billing. # Integrations (/operate/integrations) Connect supported audit destinations and configure organization single sign-on. Keep provider credentials in Dome's secret store instead of agent code or shell history. ## Supported integrations [#supported-integrations] The workspace integration catalog currently supports four provider-backed destinations: | Integration | Use it for | Delivery | | -------------------- | ------------------------------------------------------- | ------------------------------------- | | Datadog | Export audit records and stream new audit evidence | Batch export and continuous streaming | | Grafana Loki | Stream new audit evidence to Grafana Cloud Logs or Loki | Continuous streaming | | Amazon S3 | Export retained audit records to object storage | Batch export | | Google Cloud Storage | Export retained audit records to object storage | Batch export | The catalog can show entries that are unavailable in your deployment. Use this list as the implementation-backed support matrix. ## Configure an integration [#configure-an-integration] 1. Open **Operate → Integrations** in the dashboard. 2. Select a provider card. 3. Enter the provider configuration and credential. 4. Select **Connect**. Dome stores the configuration in its secret store. The dashboard does not return saved credential values. Use [Export data](/manage/export) to create batch exports. Enable or manage continuous Datadog and Grafana Loki streams from the connected integration's Streaming tab. ## Monitor integration health [#monitor-integration-health] Dome checks connected integrations in the background and shows the most recently observed result in the catalog and on the integration page. Use it to repair credentials or connectivity before an export or stream fails. | Status | Meaning | Next step | | ----------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------- | | **Connected** | Dome reached the destination with the configured credentials. | Continue monitoring normal delivery. | | **Invalid credentials** | The destination rejected the configured credentials. | Update the credential and reconnect the integration. | | **Unreachable** | Dome could not reach the destination. | Check the destination URL, network policy, and service availability. | Run `dome integrations list` to inspect the same status from the CLI. ### Permissions and limits [#permissions-and-limits] | Permission | Grants | | --------------------- | ---------------------------------------------------- | | `integrations.view` | View the catalog and connected instances | | `integrations.manage` | Connect, edit, and disconnect workspace integrations | Your plan limits integration instances per workspace. Reaching that limit prevents new connections but preserves access to connected instances. ## Identity providers [#identity-providers] Enterprise SSO connects the identity provider your organization already uses to the Dome Dashboard and CLI. Configure a guided connection for common providers or bring your own SAML or OIDC configuration. | Capability | Support | | --------------------- | ----------------------------------------------------------------------------------------------------------------- | | Guided provider setup | Common identity providers, including Okta, Microsoft Entra ID, Google, ADP, Auth0, CAS, ClassLink, and Cloudflare | | Custom SAML | Any compatible SAML 2.0 identity provider | | Custom OIDC | Any compatible OpenID Connect identity provider | Use the provider picker to search the available guided configurations. Select **Custom SAML** or **Custom OIDC** when your provider is not listed. > **Note**: Single sign-on is organization-scoped: one configured connection applies to every tenant and workspace in that organization. Platform API keys remain available for CI and other non-interactive automation. ### Configure single sign-on [#configure-single-sign-on] Configure the connection through **Settings → Single Sign-On** in the dashboard. * Requires organization `config.manage`. * Requires an organization plan with enterprise SSO enabled. * Opens a guided administrator setup flow for the corporate connection. * Requires a verified organization domain before you can require SSO for that domain. * Requires an active SSO connection before you can enforce the requirement. Disabling required SSO remains available if the plan or provider changes. This keeps an organization from being locked behind an unavailable connection. ### Keep identity paths separate [#keep-identity-paths-separate] | Path | Purpose | | ----------------- | ----------------------------------------------------------------- | | Enterprise SSO | Sign platform users into the Dome Dashboard and CLI | | Delegated Act-As | Carry an end user beside an agent credential | | Interactive OAuth | Let a human MCP client use one designated agent through a gateway | Agent identities and Act-As verification are separate from platform SSO. Configure OIDC or HMAC verification under [Callers](/connect/callers). ## Related integrations [#related-integrations] Agent-facing integrations use their own connection surfaces: * [Models](/connect/models) for LLM providers * [Tools](/connect/tools) for MCP servers and managed REST adapters * [All integrations](/concepts/integrations) for the complete documentation index # Stream live events (/operate/observe)

{streamLiveEvents}

Refer to [Audit events](/concepts/audit) concept for how the one trail works. Contracts are on the [Event contracts](/reference/events/contracts) reference. ## Overview [#overview] Streaming correlates several signals on the same governed traffic. Each signal answers a different operational question. | Signal | What it shows | | ------------------- | ------------------------------------------------------------- | | Live events | Governed requests as they occur, without polling | | Calls and denials | Allowed, denied, filtered, and failed outcomes | | Health and failures | Unavailable services, backends, and policy paths | | Latency | Slow tools, models, gateways, and rule evaluations | | Tokens and cost | LLM consumption by agent, API key, identity, and served model | | quotas | Rate-limit and resource-exhausted events by scope | | OpenTelemetry | Traces, metrics, and logs on your collector | | Product telemetry | Feature adoption. Not compliance evidence | Streaming reads the same Audit v1 trail as [Audit events](/operate/audit). Stream for live operations. Query and export for history and compliance. The typical workflow is: 1. [Stream events](#stream-events) for live governed traffic. 2. Optionally review [token usage and cost](#token-usage-and-cost). 3. Optionally [configure OpenTelemetry](#configure-opentelemetry) or [product usage telemetry](#configure-product-usage-telemetry) for your own stack. ### Token classes [#token-classes] Every LLM call resolves to a disjoint partition across five token classes. The window total is their sum. | Class | Description | | ------------------------ | ------------------------------------------------------------------------------ | | `llm_input_tokens` | Fresh input tokens that bypassed the prompt cache. | | `llm_cache_read_tokens` | Prompt-cache hits. Cheapest class. | | `llm_cache_write_tokens` | Prompt-cache writes. Carry a premium over fresh input. | | `llm_output_tokens` | Tokens emitted in the visible response. | | `llm_reasoning_tokens` | Hidden reasoning tokens (e.g. OpenAI `o1` reasoning). Bill at the output rate. | | `llm_calls` | Completed LLM calls that reported usage in the window. | Adapters normalize provider-specific usage records into this partition. Per-class pricing is applied at read time and surfaced as `estimated_cost_usd`. ### Usage cubes [#usage-cubes] Token usage and call counts fan out across the workspace aggregate and four read-time **cubes** so you can attribute consumption by the dimension you care about. | Cube | Key | What it answers | | ------------------ | --------------- | -------------------------------------------------------------------------------------------------------------------------------- | | Workspace summary | workspace | What did this workspace consume in the window? | | By agent | `agent_id` | Which agents drive cost? | | By API key | `key_id` | Which key (and therefore which workload) is responsible? Survives key revocation. | | By act-as identity | `act_as_sub` | Which assumed human identity ran up the bill? Keyed on the stable OIDC subject. | | By model | `connection_id` | Which upstream model connection actually served the call? Failover-aware: surfaces the served connection, not the requested one. | ## Requirements [#requirements] Before you begin: * Authenticate to Dome and select a workspace * Have traffic in the workspace when you want live events to appear ### Permissions [#permissions] Live event streams and token-usage reads require platform permissions. People and scoped API keys call these surfaces. Agent credentials are not the usual path. All workspace roles can stream events and read token usage with `audit.view`. OpenTelemetry and product usage telemetry are configured on the api-server and gateway processes with environment variables. They do not use workspace permissions. | Default roles | Permission | Grants | | ------------------- | ------------ | ---------------------------------- | | All workspace roles | `audit.view` | Stream events and read token usage | ## Stream events [#stream-events] Stream audit events in real time with server-sent events (SSE). The stream delivers events as they occur, without polling. > **Note**: Requires `audit.view`. **CLI** ```bash dome audit stream ``` Filter by class, type, agent, or trace: ```bash dome audit stream --classes governing --results denied --agent-id ``` For the complete stream flag reference, refer to [`dome audit stream`](/cli/operate/audit#stream-events). Find valid event types in the [Event catalog](/reference/events/catalog) reference. > **Note**: Reference: [`dome audit stream`](/cli/operate/audit#stream-events) **MCP** Real-time streaming is not available via MCP tools. Poll recent events with `dome_audit_query` instead. > **Note**: Reference: [`dome_audit_query`](/reference/mcp/audit#audit-query) **API** ```http GET /v1/audit/events/stream?event_classes=EVENT_CLASS_GOVERNING&results=RESULT_DENIED&agent_id= ``` Server-sent events. Returns a stream of `AuditEventV1` envelopes as they occur. Accepts the same filter set as `QueryEvents` except time-range and pagination fields. > **Note**: Reference: [`StreamEvents`](/api/tag/audit/stream-events) **Agent** ```text title="Query recent audit events" Query the most recent 20 audit events of type authorization.evaluate for agent "a1b2c3d4-...". ``` Each streamed event is a full `AuditEventV1` envelope. ```json { "event_id": "", "event_type": "tool.call", "event_class": "EVENT_CLASS_GOVERNING", "stage": "STAGE_COMPLETED", "result": "RESULT_ALLOWED", "occurred_at": "2026-05-30T10:30:00Z", "scope": { "workspace_id": "ws_..." }, "actor": { "kind": "ACTOR_KIND_AGENT", "id": "agent_..." }, "correlation": { "trace_id": "0af7651916cd43dd8448eb211c80319c" }, "payload": { "@type": "type.googleapis.com/dome.audit.v1.ToolCallV1", "tool": "database-query", "backend": "my-mcp-server", "latency_ms": 142 } } ``` ### Filter the stream [#filter-the-stream] Narrow the stream further by combining multiple type filters. > **Note**: Requires `audit.view`. **CLI** ```bash dome audit stream --types tool.call ``` > **Note**: Reference: [`dome audit stream`](/cli/operate/audit#stream-events) **MCP** Real-time streaming is not available via MCP tools. Poll with `dome_audit_query` and `since` / `until` instead. > **Note**: Reference: [`dome_audit_query`](/reference/mcp/audit#audit-query) **API** ```http GET /v1/audit/events/stream?event_types=tool.call ``` > **Note**: Reference: [`StreamEvents`](/api/tag/audit/stream-events) **Agent** ```text title="Query filtered audit events" Query the most recent 20 audit events of type tool.call. ``` The stream remains open until you terminate it. It fits live monitoring during deployments, incident investigation, or development testing. ## Token usage and cost [#token-usage-and-cost] Query LLM consumption across every agent, API key, identity, and served model in the workspace. The dashboard token panel, the `dome usage` CLI, and the `dome_usage` MCP tool share one summary endpoint, so numbers line up everywhere. > **Note**: Requires `audit.view`. > **Warning**: Estimated cost is derived from token usage at read time and is not a bill. Model-aware usage is priced from the organization or Dome rate era that covered each usage window, so opening a new rate era preserves historical pricing. Aggregate usage without a model dimension uses the fallback blended rate. The rate eras are persisted; calculated cost is not. **CLI** Print the workspace token total and estimated cost for the last 24 hours. ```bash dome usage ``` The output mirrors the dashboard token panel. Add `--json` for machine-readable output and pipe into `jq` for scripted budgets. > **Note**: Reference: [`dome usage`](/cli/operate/usage) **MCP** Agents and assistants read the same numbers through `dome_usage`. > **Note**: Reference: [`dome_usage`](/reference/mcp/audit#audit-usage) **API** All token-usage reads are workspace-scoped. Time-range params `from` and `to` accept RFC 3339. Absent values default to the last 24 hours. `limit` defaults vary per endpoint and clamps at 200. | Route | Returns | | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET /api/v1/metrics/summary` | Workspace totals (`evaluations_*`, `tool_calls_*`, the five token classes, `llm_total_tokens`, `llm_calls`, `estimated_cost_usd`) plus time-series buckets. | | `GET /api/v1/metrics/agents` | Top agents ranked by activity or denies, with token totals and cost per agent. `sort=activity\|denies`. | | `GET /api/v1/metrics/agents/{agent_id}` | Per-agent detail with time-series buckets. | | `GET /api/v1/metrics/agents/{agent_id}/keys` | Per-API-key token usage and cost for one agent. Revoked keys still surface their historical usage. | | `GET /api/v1/metrics/models` | Top served model connections ranked by tokens. Joins the connection table for the live display name. | | `GET /api/v1/metrics/pools/{pool_id}` | Pool activity: `failover_served_calls`, `request_failures`, member breakdown, and time-series buckets for the window. | | `GET /api/v1/metrics/act-as` | Top act-as identities ranked by tokens. `email` is a last-wins display snapshot. `sub` is the stable key. | Per-agent detail buckets include `llm_calls` alongside evaluations and tool calls. LLM audit events carry `pool_id` so you can attribute spend and failover to a pool. Sample summary response: ```json { "evaluations_allow": 1842, "evaluations_deny": 17, "tool_calls_total": 921, "llm_input_tokens": 412000, "llm_cache_read_tokens": 1820000, "llm_cache_write_tokens": 88000, "llm_output_tokens": 64000, "llm_reasoning_tokens": 12000, "llm_total_tokens": 2396000, "llm_calls": 318, "estimated_cost_usd": 3.4521, "agents_active": 12, "buckets": [ { "window_start": "2026-06-05T10:00:00Z", "llm_input_tokens": 18000, "llm_output_tokens": 2400, "estimated_cost_usd": 0.092 } ] } ``` > **Note**: Reference: REST metrics under `/api/v1/metrics/*` ## Configure OpenTelemetry [#configure-opentelemetry] Every Dome service exports OpenTelemetry traces, metrics, and logs over OTLP/HTTP. Point the standard `OTEL_*` env vars at your collector (Jaeger, Tempo, Datadog agent, OTel Collector, Axiom, or anything that speaks OTLP) to wire Dome into your existing observability stack. > **Note**: Dome is vendor-neutral: it emits standard OTLP and reads standard `OTEL_*` variables. The collector decides where data lands. Swap backends without redeploying Dome. ### Enable [#enable] Set `OTEL_EXPORTER_OTLP_ENDPOINT` on the api-server and gateway processes. When the variable is unset, the SDK runs in silent no-op mode. That is useful for local development without a collector. ```bash export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 export OTEL_SERVICE_NAME=dome-api-server # also: dome-gateway export OTEL_RESOURCE_ATTRIBUTES=deployment.environment=production ``` | Env var | Description | | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP/HTTP collector URL. Unset disables the SDK. | | `OTEL_SERVICE_NAME` | Service name on every signal (e.g. `dome-api-server`, `dome-gateway`). | | `OTEL_RESOURCE_ATTRIBUTES` | Comma-separated resource attrs (`key=value,key=value`). | | `OTEL_SDK_DISABLED` | Set to `true` to force the no-op provider. | | `OTEL_TRACES_EXPORTER` | Set to `none` to drop only traces while keeping metrics and logs. Same pattern for `OTEL_METRICS_EXPORTER` and `OTEL_LOGS_EXPORTER`. | | `OTEL_TRACES_SAMPLER_ARG` | Head-sampling ratio for root spans. Defaults to `0.01` (1%). Use `1.0` for full traces in local dev. | | `DOME_BUILD_VERSION` | Overrides the `service.version` resource attribute. Defaults to the build-time version. | Health probes (`/healthz`, `/readyz`, `/health`, `/ready`) are filtered out of traces and HTTP metrics automatically. ### Identity attributes [#identity-attributes] Every span and log record carries the same `dome.*` vocabulary so you can pivot from a trace to its logs with a single tag filter: | Attribute | Value | | --------------------------- | --------------------------------------------- | | `dome.caller_type` | `agent`, `platform_user`, or `gateway` | | `dome.tenant_id` | Tenant UUID | | `dome.org_id` | Org UUID | | `dome.workspace_id` | Workspace UUID | | `dome.agent_id` | agent UUID (agent callers) | | `dome.gateway_id` | gateway UUID (gateway callers) | | `dome.platform_user_key_id` | Platform API key UUID (platform-user callers) | Logs also carry the OTel `trace_id`, so a single query (`dome.tenant_id="..."`) returns the full request story across spans and logs for that tenant. ### Product metrics [#product-metrics] Eight product-level instruments emit on the global OTel meter. Counters omit `tenant_id` to keep cardinality bounded. Pivot per-tenant via the span attributes above. | Instrument | Type | Tags | Source | | ---------------------------------- | ---------------- | ----------------------------------------------------------------------------------------- | ------------------------------ | | `dome.authz.decisions` | Counter | `decision` (`allow`\|`deny`) | Every authorization evaluation | | `dome.authz.deny` | Counter | `reason` (`permission_denied`\|`wrong_caller_type`\|`tenant_mismatch`\|`unauthenticated`) | Every deny audit event | | `dome.audit.events_ingested` | Counter | `event_type` | Audit ingest endpoint | | `dome.gateway.tool_calls` | Counter | `tool_name`, `outcome` (`allowed`\|`denied`\|`error`) | gateway tool calls | | `dome.gateway.sync_cycle.duration` | Histogram (s) | `outcome` (`applied`\|`skipped`\|`error`) | gateway rule-sync cycle | | `dome.rules.evaluation.duration` | Histogram (s) | `engine`, `scope_kind` | Authorization rule evaluation | | `dome.agents.active` | Observable gauge | `tenant_id` | Active agents per tenant | ### Sampling and cost [#sampling-and-cost] Trace volume is head-sampled at 1% by default. Boilerplate database spans from `otelpgx` (transaction state, pool acquire, prepare statements) are dropped at the source. They accounted for \~99% of trace volume in early staging. Tail-sampling decisions belong at your collector. ```bash # Local dev: full traces, full logs export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 export OTEL_TRACES_SAMPLER_ARG=1.0 ``` ## Configure product usage telemetry [#configure-product-usage-telemetry] Stream product-usage events to your own analytics backend to see which features each tenant exercises. Telemetry is separate from audit. It answers "which orgs are active, which features get used, where do users get stuck", not "what did this agent do". > **Warning**: Use audit for compliance evidence. Use telemetry for product analytics. Telemetry is best-effort: events drop on queue overflow, sink errors, or shutdown, and the request path is never blocked or failed because of telemetry. Telemetry is **opt-in** and **off by default**. Set `USAGE_TELEMETRY_ENABLED=true` on the api-server and gateway processes to turn it on. Any other value, including unset, installs a no-op client and emits nothing. ### Sinks [#sinks] Select a sink with `USAGE_TELEMETRY_SINK`. Leave it unset to use the env-driven default. | Sink | When to use | Default for | | -------- | ------------------------------------------------------------------------------------- | --------------------------------------------- | | `logger` | Local development. Emits one `product_usage_event` line per event at **DEBUG** level. | `DOME_ENV=local`, `dev`, `test` | | `otlp` | Production. Ships events as OTLP HTTP/logs to your collector. | — (explicit) | | `noop` | Disable without unsetting the feature. | Fallback when no other sink can be configured | A misconfigured sink (missing token, unreachable endpoint at startup, malformed headers) falls back to `noop` and logs the error. Startup never fails because of telemetry. ### Configure [#configure] Set the telemetry envvars in the api-server and gateway environments. One client per process. The same configuration applies to both. | Env var | Required | Description | | ------------------------------- | ---------- | ----------------------------------------------------------------------------------------- | | `USAGE_TELEMETRY_ENABLED` | yes | Opt-in switch. `1`, `true`, `yes`, `on`, `enabled` turn it on. Anything else disables it. | | `USAGE_TELEMETRY_SINK` | no | `logger` \| `otlp` \| `noop`. Unset uses the env-driven default above. | | `USAGE_TELEMETRY_OTLP_ENDPOINT` | for `otlp` | Collector base URL. `/v1/logs` is appended if the path is empty. | | `USAGE_TELEMETRY_OTLP_HEADERS` | no | Comma-separated `key=value` headers (e.g. collector auth). | | `USAGE_TELEMETRY_PII_HASH_KEY` | no | HMAC-SHA256 key for hashing sensitive identifiers in future events. Secret. | Local development (logger sink, visible at DEBUG): ```bash export DOME_ENV=local export DOME_LOG_LEVEL=debug export USAGE_TELEMETRY_ENABLED=true ``` Self-hosted OTLP collector: ```bash export USAGE_TELEMETRY_ENABLED=true export USAGE_TELEMETRY_SINK=otlp export USAGE_TELEMETRY_OTLP_ENDPOINT={{COLLECTOR_URL}} export USAGE_TELEMETRY_OTLP_HEADERS=Authorization=Bearer {{COLLECTOR_TOKEN}} ``` ### Event coverage [#event-coverage] Telemetry covers two surfaces: **lifecycle** events when resources are created, changed, or removed, and **runtime** events on every request the gateway evaluates. **Lifecycle events** | Event | When it fires | | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `org.created` | Organization created | | `tenant.created` | Tenant created | | `workspace.created`, `workspace.deleted` | Workspace lifecycle | | `agent.registered`, `agent.activated`, `agent.updated`, `agent.suspended`, `agent.reactivated`, `agent.revoked`, `agent.deleted` | Product telemetry agent lifecycle (not Audit v1 event types) | | `api_key.created`, `api_key.revoked`, `api_key.rotated` | API key lifecycle | | `mcp_connection.created`, `mcp_connection.updated`, `mcp_connection.deleted` | gateway MCP backend lifecycle | | `llm_connection.created`, `llm_connection.updated`, `llm_connection.deleted` | LLM backend lifecycle | | `rule_bundle.deployed`, `rule_bundle.rolled_back`, `cedar_rules.deleted` | rule bundle lifecycle | | `credential_link.issued`, `credential_link.consumed` | Per-user credential magic links | | `oauth.consent_granted` | OAuth consent completed | | `llm_pool.created`, `llm_pool.defaulted` | LLM pool lifecycle | **Runtime events** | Event | When it fires | Key fields | | --------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | | `rule_evaluation.completed` | Every authorization decision | `decision` (`allow`\|`deny`), `reason_class`, `action`, `resource_type`, `duration_bucket`, `trace_id` | | `tool_call.completed` | Every tool call, allowed or denied | `result` (`success`\|`denied`\|`failure`), `tool`, `backend`, `duration_ms`, `status_code`, `fields_redacted`, `trace_id` | | `llm_call.completed` | Every LLM dispatch | `result`, `model`, `pool`, `duration_ms`, `status_code`, `trace_id` | | `tool_list.completed` | Every `tools/list` MCP call | `result`, `backend`, `tool_count`, `trace_id` | Each runtime event carries `trace_id` so you can join a usage event to the matching audit event for the same call. ### Event envelope [#event-envelope] Every event, regardless of sink, has the same normalized shape: ```json { "name": "tool_call.completed", "version": 1, "timestamp": "2026-05-15T14:22:18.041Z", "scope": { "org_id": "org_...", "tenant_id": "tenant_...", "workspace_id": "ws_..." }, "entity": { "type": "agent", "id": "agent_..." }, "properties": { "result": "success", "tool": "database-query", "backend": "my-mcp-server", "duration_ms": 142, "trace_id": "trace_..." } } ``` Add a new field to an existing event freely. Additive changes do not bump `version`. Renaming or repurposing a field requires a new event name or a version bump. ### PII handling [#pii-handling] Telemetry drops sensitive properties before any sink sees them. Property keys matching `email`, `username`, `password`, `secret`, `token`, `prompt`, `response`, `arguments`, or `args`, and keys containing `oauth_code`, `tool_result`, `user_name`, `raw_*`, or `act_as_subject`, are stripped at the client. Runtime constructors never accept raw tool args, prompts, or model responses in the first place. Putting PII under a non-matching key name does not bypass this. The package is the second line of defense. ### Tuning behavior [#tuning-behavior] V1 ships with fixed batching parameters: 100 events per batch, 10 s flush interval, 10,000-event in-memory queue, 5 s send timeout, 2 retries with 250 ms backoff. These are not configurable via env in V1. * **Queue full** → event drops, warn log, `dropped` counter increments. * **Sink error** → batch retries once, then drops, error log, `dropped` increments by batch size. * **Shutdown** → queue drains, final batch flushes, sink shuts down. ## Next steps [#next-steps] * [Audit events](/operate/audit) for historical queries, exports, and the full event envelope * [Subscribe to Events](/operate/webhooks) to push signed events to external systems * [Set Usage Limits](/govern/quotas) when quota exhaustion shows up in the stream # Webhooks (/operate/webhooks)

{webhook}

Refer to [Webhooks](/concepts/audit/webhooks) concept for how signed delivery works. Refer to [Event contracts](/reference/events/contracts#webhooks) reference for the wire contract. ## Overview [#overview] A **subscription** matches events by type and filter; the [Event catalog](/reference/events/catalog) marks which types are delivered. A **destination** receives them as signed HTTP POSTs. Create both in one call with `subscriptions create`, or attach a second subscription to an existing destination. Providers and custom URLs use the same model. Discover provider fields with `dome webhooks providers list`. Operating limits (body cap, rate, retention) are on [Webhooks](/concepts/audit/webhooks#operating-limits). Webhook `event_type` values use the same names as Audit schema-v4 operations (`agent.suspend`, `tool.call`, `guard.filter.evaluate`). There is no `access.denied` type: subscribe to the operation and filter on `result=denied`. Retired names such as `mcp.tool_call.completed` and `llm.output.filtered` do not match. The typical workflow is: 1. [Create a subscription](#create-a-subscription) and optional [filters](#filters). 2. [Test](#test-a-subscription) the destination, then [verify signatures](#verify-a-signature) on custom HTTPS endpoints. 3. [Inspect](#inspect-deliveries) attempt history and [replay](#replay-deliveries) failures when needed. 4. [Rotate the signing secret](#rotate-the-signing-secret) when credentials change. ## Requirements [#requirements] Before you begin, authenticate to Dome and select a workspace. ### Permissions [#permissions] Webhook operations require platform permissions. People and scoped API keys call the webhooks API. Agent credentials cannot. Most roles can inspect subscriptions and deliveries. Creating destinations, rotating secrets, and changing subscriptions need `eventing.manage`. Replay re-sends requests to your systems and can trigger downstream automation, so it uses a separate `eventing.replay` permission. | Default roles | Permission | Grants | | ------------------- | ----------------- | --------------------------------------------------------------------- | | All workspace roles | `eventing.view` | List and inspect subscriptions, deliveries, providers | | `admin`, `operator` | `eventing.manage` | Create, update, disable, delete, rotate secrets, test, cancel retries | | `admin`, `operator` | `eventing.replay` | Single and bulk replay | ## Create a subscription [#create-a-subscription] Create a subscription and its destination atomically. A failed request leaves neither record behind. The response reveals the destination's `whsec_…` signing secret **once**. Store it before moving on. It is only rotatable afterward, never readable. On the API, pass either `delivery_endpoint` (create a new destination) or `destination_id` (attach to an existing one). Never both. Standalone destination RPCs (`ListDestinations`, `CreateDestination`, `UpdateDestination`, `RotateDestinationSecret`, `DeleteDestination`) support shared-destination setups. CLI and MCP create the destination inline with the subscription. The dashboard can also pick an existing destination. > **Note**: Requires `eventing.manage`. Custom HTTPS endpoint: ```bash dome webhooks subscriptions create alerts \ --url https://ops.example.com/hooks/dome \ --event-type agent.suspend \ --event-type bundle.deploy ``` Slack via incoming-webhook URL: ```bash dome webhooks subscriptions create slack-alerts \ --provider slack \ --setting webhook_url=https://hooks.slack.com/services/T.../B.../XXXX \ --event-type agent.suspend \ --event-type agent.revoke \ --filter 'result=denied' ``` For provider-specific settings, credentials, shared destinations, MCP, and API examples, see the [webhooks CLI reference](/cli/operate/webhooks). ### Filters [#filters] You can narrow which events deliver. An event must satisfy every filter that applies to its type. A filter constrains only event types that carry its field. Exact match ```bash dome webhooks subscriptions create prod-only \ --url https://... --event-type agent.suspend \ --filter 'agent_name=checkout-worker' ``` Glob pattern (`*` any run, `?` one char, full-value match) ```bash dome webhooks subscriptions create demo-tools \ --url https://... --event-type tool.call \ --filter 'tool_name~=demo-mcp/*' ``` OR set (repeat the same key) ```bash dome webhooks subscriptions create critical-agents \ --url https://... --event-type agent.suspend \ --filter 'agent_name=checkout-worker' \ --filter 'agent_name=billing-worker' ``` Envelope filters apply to every event type: `stage` (`attempted` / `completed`), `result` (`allowed` / `denied`), `denial.reason`, and `error` (boolean presence). Payload filters include `agent_name`, `connection_name` (resolved from IDs at delivery time), `agent_id`, `tool_name`, plus each event type's own filterable fields. [`dome audit catalog`](/operate/audit#browse-the-event-catalog) and the dashboard Event catalog mark them. Repeated keys OR. Distinct keys AND. Caps: 16 keys, 16 alternatives per key, 256-byte patterns with up to 8 wildcards. Per-request events (`tool.call`, `guard.filter.evaluate`, `guard.validator.evaluate`) are high volume. Point them at a log sink rather than a chat channel, and narrow with filters. `model.call` is on the audit trail and is not delivered as a webhook. ## Test a subscription [#test-a-subscription] Send a fixed `eventing.test` event through a subscription's destination to verify signing, headers, and the destination's own routing. > **Note**: Requires `eventing.manage`. **CLI** ```bash dome webhooks subscriptions test alerts ``` The command prints the queued delivery ID. Check the outcome with `dome webhooks deliveries get `. > **Note**: Reference: [`dome webhooks subscriptions test`](/cli/operate/webhooks#send-test-event) **MCP** Tool: `dome_webhooks_subscription_test` > **Note**: Reference: [`dome_webhooks_subscription_test`](/reference/mcp/webhooks#subscription-test) **Agent** ```text title="Test a webhook subscription" Send a test event through the webhook subscription named alerts. ``` ## Verify a signature [#verify-a-signature] Verify custom HTTPS deliveries with any Standard Webhooks library. Return `2xx` within 10 seconds to acknowledge. Acknowledge first, process async. Slow handlers time out and burn retry budget. **Node.js** ```javascript import { Webhook } from "standardwebhooks"; const wh = new Webhook(process.env.DOME_WEBHOOK_SECRET); // whsec_... app.post("/webhooks/dome", express.raw({ type: "application/json" }), (req, res) => { try { const event = wh.verify(req.body, req.headers); // Dedupe on req.headers["dome-event-id"], then process async. res.status(202).send(); } catch { res.status(400).send("invalid signature"); } }); ``` **Python** ```python from standardwebhooks.webhooks import Webhook wh = Webhook(os.environ["DOME_WEBHOOK_SECRET"]) # whsec_... @app.post("/webhooks/dome") def receive(request): try: event = wh.verify(request.body, dict(request.headers)) # Dedupe on request.headers["dome-event-id"], then process async. return HttpResponse(status=202) except Exception: return HttpResponse(status=400) ``` ## Inspect deliveries [#inspect-deliveries] Inspect delivery attempt history, including the retained body while it is available. > **Note**: Requires `eventing.view`. **CLI** Failed deliveries in a time window: ```bash dome webhooks deliveries list --status failed --start 2026-07-14T00:00:00Z ``` One delivery with attempt history and the retained body: ```bash dome webhooks deliveries get --body ``` > **Note**: Reference: [`dome webhooks deliveries list`](/cli/operate/webhooks#list-deliveries), [`get`](/cli/operate/webhooks#get-delivery) **MCP** Tools: `dome_webhooks_delivery_list`, `dome_webhooks_delivery_get`. > **Note**: Reference: [`dome_webhooks_delivery_list`](/reference/mcp/webhooks#delivery-list), [`dome_webhooks_delivery_get`](/reference/mcp/webhooks#delivery-get) **Agent** ```text title="List failed webhook deliveries" List failed webhook deliveries since 2026-07-14T00:00:00Z. ``` ## Replay deliveries [#replay-deliveries] Replay one delivery or bulk-replay failures in a window. A replay creates a **new** delivery from the retained body (fresh `webhook-id`, same `Dome-Event-Id`) so consumers that dedupe correctly ignore the overlap. Bulk replay processes up to 500 deliveries per run. Repeat to continue. Canceled deliveries are never recovered. > **Note**: Requires `eventing.replay`. **CLI** Replay one delivery: ```bash dome webhooks deliveries replay ``` Bulk-replay terminal failures from the last 24 hours: ```bash dome webhooks deliveries replay-failed --since 24h ``` Narrow by subscription and status: ```bash dome webhooks deliveries replay-failed --since 7d --subscription alerts --status failed,dlq ``` `replay-failed` prints `matched · replayed · skipped (body expired) · failed`. It is safe to re-run: deliveries with a live or succeeded replay are not matched again. > **Note**: Reference: [`dome webhooks deliveries replay`](/cli/operate/webhooks#replay-delivery), [`replay-failed`](/cli/operate/webhooks#replay-failed-deliveries) **MCP** Tools: `dome_webhooks_delivery_replay`, `dome_webhooks_delivery_replay_failed`, `dome_webhooks_delivery_cancel`. ```json { "name": "dome_webhooks_delivery_replay_failed", "arguments": { "since": "24h", "subscription": "alerts" } } ``` > **Note**: Reference: [`dome_webhooks_delivery_replay_failed`](/reference/mcp/webhooks#delivery-replay-failed) **API** ```http POST /v1/webhooks/deliveries/replay-failed Content-Type: application/json { "workspace_id": "ws_...", "since": "2026-07-14T00:00:00Z", "destination_id": "dst_...", "statuses": ["failed", "dlq"], "max_deliveries": 500 } ``` The response returns `matched`, `replayed`, `skipped_body_expired`, and `failed` counts plus `replay_delivery_ids`. Also available: `ReplayDelivery`, `CancelDeliveryRetry`. > **Note**: Reference: Eventing `ReplayFailedDeliveries` RPC **Agent** ```text title="Replay failed webhook deliveries" Replay all failed webhook deliveries from the last 24 hours. ``` ## Rotate the signing secret [#rotate-the-signing-secret] Rotate a destination's signing secret without dropping deliveries. For 24 hours, the `webhook-signature` header carries a signature per key (current first, previous second) so a consumer verifying with either secret keeps working. Update your verifier to the new secret within the 24-hour grace window. > **Note**: Requires `eventing.manage`. **CLI** ```bash dome webhooks subscriptions rotate-secret alerts ``` The command prints the new signing secret once (`whsec_…`) with its key ID. > **Note**: Reference: [`dome webhooks subscriptions rotate-secret`](/cli/operate/webhooks#rotate-signing-secret) **MCP** Tool: `dome_webhooks_subscription_rotate_secret` > **Note**: Reference: [`dome_webhooks_subscription_rotate_secret`](/reference/mcp/webhooks#subscription-rotate-secret) **Agent** ```text title="Rotate a webhook signing secret" Rotate the signing secret for the webhook subscription named alerts. ``` ## Next steps [#next-steps] * [Audit events](/operate/audit) for the durable record * [Export Data](/manage/export) for scheduled batch export * [Stream Live Events](/operate/observe) for live Audit v1 streaming # Glossary (/reference/glossary) {/* Definitions below are imported from /snippets/glossary.mdx — the shared source of truth also used as the opening intro on matching concept and usage pages (and in glossary tooltips). Edit the snippet, not a local copy here. */} The core terms you'll meet across Dome, each with a one-line definition and a link to the page that covers it in depth. ### Access [#access]

{access}

**Related:** [Manage access](/manage/access) · [Permissions](/concepts/platform/permissions) concept ### Access grant [#access-grant]

{accessGrant}

**Related:** [Architecture](/concepts/architecture#gateways) concept · [Gateways](/build/gateways) ### Act-as [#act-as]

{actAs}

**Related:** [Delegated agents](/build/agents/delegated) · [Identity Patterns](/concepts/identity-patterns) concept ### Agent [#agent]

{agent}

**Related:** [Agents](/concepts/agents) concept · [Agent Identity](/concepts/agents/identity) concept · [Agents](/build/agents) ### Agent identity [#agent-identity]

{agentIdentity}

**Related:** [Agent Identity](/concepts/agents/identity) concept · [Agents](/build/agents) · [Identity Patterns](/concepts/identity-patterns) concept ### External agent [#external-agent]

{externalAgent}

**Related:** [Agents](/build/agents) · [Agents](/concepts/agents) concept ### Interactive agent [#interactive-agent]

{interactiveAgent}

**Related:** [Interactive access](/build/gateways/interactive-mcp-access) · [Agents](/concepts/agents) concept ### Agent lifecycle [#agent-lifecycle]

{agentLifecycle}

**Related:** [Agent lifecycle](/concepts/agents/agent-lifecycle) concept · [Agents](/build/agents) ### Managed agent [#managed-agent]

{managedAgent}

**Related:** [Managed agents](/build/agents/managed) · [Managed agents](/reference/entities/managed-agents) ### Trigger [#trigger]

{trigger}

**Related:** [Managed agents](/build/agents/managed) · [Triggers](/reference/entities/triggers) ### Agent Registry [#agent-registry]

{agentRegistry}

**Related:** [Agents](/concepts/agents) concept · [Agents](/build/agents) · [Architecture](/concepts/architecture) concept ### API key [#api-key]

{apiKey}

**Related:** [Agent Identity](/concepts/agents/identity) concept · [Agents](/build/agents) ### Audit event [#audit-event]

{auditEvent}

**Related:** [Audit events](/concepts/audit) concept · [Audit events](/operate/audit) ### Authorization model [#authorization-model]

{authorizationModel}

**Related:** [Authorization Model](/concepts/architecture/authorization-model) concept · [Rules](/govern/rules) · [Rules](/reference/controls/rules) reference ### Caller [#caller]

{caller}

**Related:** [Callers](/connect/callers) · [Delegated agents](/build/agents/delegated) · [Identity Patterns](/concepts/identity-patterns) concept ### Cedar [#cedar]

{cedar}

**Related:** [Authorization Model](/concepts/architecture/authorization-model) concept · [Rules](/govern/rules) ### Control plane [#control-plane]

{controlPlane}

**Related:** [Architecture](/concepts/architecture) concept · [Data plane](/concepts/architecture/dataplane) concept ### Data plane [#data-plane]

{dataPlane}

**Related:** [Data plane](/concepts/architecture/dataplane) concept · [Architecture](/concepts/architecture#how-requests-move-through-dome) concept ### Delegated agents [#delegated-agents]

{delegatedAgent}

**Related:** [Delegated agents](/build/agents/delegated) · [Identity Patterns](/concepts/identity-patterns) concept · [Act-as](/reference/glossary#act-as) ### Effective Rules [#effective-rules]

{effectiveRules}

**Related:** [Rules](/concepts/controls/rules) concept · [Authorize Access](/govern/rules) · [Authorization Model](/concepts/architecture/authorization-model) concept ### Egress header [#egress-header]

{egressHeader}

**Related:** [Tools](/concepts/resources/tools) concept · [Tools](/connect/tools) ### Environment [#environment]

{environment}

**Related:** [Prepare environments](/manage/environments) · [Scope hierarchy](/concepts/platform/scopes) concept ### Export [#export]

{dataExport}

**Related:** [Export data](/manage/export) · [Audit events](/operate/audit) ### Filter [#filter]

{filter}

**Related:** [Guards](/concepts/controls/guards) concept · [Configure Guards](/govern/guards) ### Gateways [#gateways]

{gateways}

**Related:** [Gateways](/concepts/gateways) concept · [Gateways](/build/gateways) ### Guard [#guard]

{guard}

**Related:** [Guards](/concepts/controls/guards) concept · [Configure Guards](/govern/guards) · [Guards](/reference/controls/guards) reference ### Identity patterns [#identity-patterns]

{identityPatterns}

**Related:** [Identity Patterns](/concepts/identity-patterns) concept · [Delegated agents](/build/agents/delegated) ### Interactive OAuth [#interactive-oauth]

{interactiveOAuth}

**Related:** [Identity Patterns](/concepts/identity-patterns) concept · [Agents CLI](/cli/build/agents#interactive-access) · [Interactive grant MCP tools](/reference/mcp/agents#interactive-grants) ### Integrations [#integrations]

{integrations}

**Related:** [Integrations](/operate/integrations) ### LLM gateway [#llm-gateway]

{llmGateway}

**Related:** [LLM gateway](/concepts/gateways/llm-gateway) concept · [Data plane](/concepts/architecture/dataplane) concept · [Model Broker](/reference/glossary#model-broker) ### Membership [#membership]

{membership}

**Related:** [Architecture](/concepts/architecture#gateways) concept · [Gateways](/build/gateways) ### Model Broker [#model-broker]

{modelBroker}

**Related:** [Models](/connect/models) · [LLM gateway](/concepts/gateways/llm-gateway) concept · [Architecture](/concepts/architecture) concept ### Model connection [#model-connection]

{modelConnection}

**Related:** [Models](/concepts/resources/models) concept · [Models](/connect/models) · [LLM gateway](/concepts/gateways/llm-gateway) concept ### Organization [#organization]

{organization}

**Related:** [Scope hierarchy](/concepts/platform/scopes) concept ### Permissions [#permissions]

{permissions}

**Related:** [Permissions](/concepts/platform/permissions) concept · [Manage access](/manage/access) ### Platform API key [#platform-api-key]

{platformApiKey}

**Related:** [Manage access](/manage/access) · [Permissions](/concepts/platform/permissions) concept ### Pool [#pool]

{modelPool}

**Related:** [Pools](/concepts/resources/model-pools) concept · [Pools](/connect/pools) · [LLM gateway](/concepts/gateways/llm-gateway) concept ### Quota [#quota]

{quota}

**Related:** [Quotas](/concepts/controls/quotas) concept · [Set Usage Limits](/govern/quotas) · [Architecture](/concepts/architecture#quotas) concept ### Resource [#resource]

{resource}

**Related:** [Resources](/concepts/resources) concept · [Architecture](/concepts/architecture#resources) concept · [Connect](/connect) ### Rule [#rule]

{rule}

**Related:** [Rules](/govern/rules) · [Authorization Model](/concepts/architecture/authorization-model) concept ### Rule bundle [#rule-bundle]

{ruleBundle}

**Related:** [Rules](/govern/rules) ### Rules assistant [#rules-assistant]

{cedarAssistant}

**Related:** [Rules assistant](/govern/rules/assistant) · [Rules](/govern/rules) ### Scope [#scope]

{scope}

**Related:** [Scope hierarchy](/concepts/platform/scopes) concept ### Settings [#settings]

{settings}

**Related:** [Configure platform](/manage/settings) ### Simulation [#simulation]

{simulation}

**Related:** [Simulate rules](/govern/rules/simulate) · [Rules](/govern/rules) ### Standing identity [#standing-identity]

{standingIdentity}

**Related:** [Identity Patterns](/concepts/identity-patterns) concept · [Agents](/build/agents) ### Stream Live Events [#stream-live-events]

{streamLiveEvents}

**Related:** [Stream Live Events](/operate/observe) · [Audit events](/concepts/audit) concept · [Event catalog](/reference/events/catalog) reference ### Tenant [#tenant]

{tenant}

**Related:** [Scope hierarchy](/concepts/platform/scopes) concept ### Tool [#tool]

{tool}

**Related:** [Tools](/concepts/resources/tools) concept · [Tools](/connect/tools) · [Architecture](/concepts/architecture#resources) concept ### Tools gateway [#tools-gateway]

{toolsGateway}

**Related:** [Tools gateway](/concepts/gateways/tools-gateway) concept · [Data plane](/concepts/architecture/dataplane) concept ### Validator [#validator]

{validator}

**Related:** [Guards](/concepts/controls/guards) concept · [Configure Guards](/govern/guards#validators) · [Guards](/reference/controls/guards#validators) reference ### Verification provider [#verification-provider]

{verificationProvider}

**Related:** [Delegated agents](/build/agents/delegated) · [Identity Patterns](/concepts/identity-patterns) concept ### Webhook [#webhook]

{webhook}

**Related:** [Webhooks](/operate/webhooks) · [Webhooks](/concepts/audit/webhooks) concept ### Workspace [#workspace]

{workspace}

**Related:** [Scope hierarchy](/concepts/platform/scopes) concept ## Next steps [#next-steps] Definitions stay short on purpose. Concepts carry the full model: * [Core Concepts](/concepts) for how Dome's pieces fit together * [What is Dome?](/what-is-dome) for platform purpose * [Quickstart](/quickstart) to register an agent and verify governed traffic # Permissions (/reference/permissions) Field and catalog reference for platform RBAC. Agent runtime authorization uses Cedar and is separate from this catalog. Refer to [Permissions](/concepts/platform/permissions) concept for how platform RBAC works. Assign members and keys on [Manage Access](/manage/access). ## Workspace roles [#workspace-roles] Every workspace member has one of six roles. | Role | Description | Key capabilities | | ---------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **admin** | Full workspace management | All workspace operations including member management, configuration, and workspace deletion | | **operator** | Day-to-day workspace operations | Register, suspend, revoke, and delete agents. Manage agent and API keys. Deploy and roll back rules. Manage gateway and integrations. Export audit. Cannot delete the workspace or change the admin roster. | | **security** | Authorization rules and audit | Deploy and roll back rules, simulate, suspend agents, query and export audit | | **developer** | agent integration work | Register and update agents, manage agent keys, view rules, audit, gateway, and integrations (no deploy, no export) | | **viewer** | Read-only access | List agents, view rules, gateway, audit, and integrations | | **impersonator** | Reserved for impersonation flows | No standing permissions. Used by sessions impersonating another user. | ### Workspace-scoped permissions [#workspace-scoped-permissions] ✅ means the role has the permission. ❌ means it does not. | Permission | admin | operator | security | developer | viewer | | ------------------------- | :---: | :------: | :------: | :-------: | :----: | | `agents.view` | ✅ | ✅ | ✅ | ✅ | ✅ | | `agents.register` | ✅ | ✅ | ❌ | ✅ | ❌ | | `agents.suspend` | ✅ | ✅ | ✅ | ✅ | ❌ | | `agents.revoke` | ✅ | ✅ | ❌ | ✅ | ❌ | | `agents.delete` | ✅ | ✅ | ❌ | ❌ | ❌ | | `agentkeys.manage` | ✅ | ✅ | ❌ | ✅ | ❌ | | `managedagents.view` | ✅ | ✅ | ✅ | ✅ | ✅ | | `managedagents.manage` | ✅ | ✅ | ❌ | ✅ | ❌ | | `managedagents.invoke` | ✅ | ✅ | ❌ | ✅ | ❌ | | `deviceenroll.manage` | ✅ | ✅ | ❌ | ❌ | ❌ | | `rules.view` | ✅ | ✅ | ✅ | ✅ | ✅ | | `rules.deploy` | ✅ | ✅ | ✅ | ❌ | ❌ | | `rules.rollback` | ✅ | ✅ | ✅ | ❌ | ❌ | | `gateways.view` | ✅ | ✅ | ✅ | ✅ | ✅ | | `gateways.manage` | ✅ | ✅ | ❌ | ❌ | ❌ | | `audit.view` | ✅ | ✅ | ✅ | ✅ | ✅ | | `audit.export` | ✅ | ✅ | ✅ | ❌ | ❌ | | `workspaces.manage` | ✅ | ✅ | ❌ | ❌ | ❌ | | `workspaces.delete` | ✅ | ❌ | ❌ | ❌ | ❌ | | `workspaces.manage_admin` | ✅ | ❌ | ❌ | ❌ | ❌ | | `apikeys.manage` | ✅ | ✅ | ❌ | ❌ | ❌ | | `config.manage` | ✅ | ✅ | ❌ | ❌ | ❌ | | `integrations.view` | ✅ | ✅ | ✅ | ✅ | ✅ | | `integrations.manage` | ✅ | ✅ | ❌ | ❌ | ❌ | | `eventing.view` | ✅ | ✅ | ✅ | ✅ | ✅ | | `eventing.manage` | ✅ | ✅ | ❌ | ❌ | ❌ | | `eventing.replay` | ✅ | ✅ | ❌ | ❌ | ❌ | | `guards.view` | ✅ | ✅ | ✅ | ✅ | ✅ | | `guards.manage` | ✅ | ✅ | ❌ | ❌ | ❌ | `eventing.*` gates [Subscribe to Events](/operate/webhooks). `guards.*` gates both guard kinds, filters and validators, and the legacy `filters.view` / `filters.manage` aliases still satisfy it during the cutover. See those how-tos for operation detail. `workspaces.manage_admin` is the workspace-direct admin marker. It gates adding, removing, or changing the role of any user to or from workspace admin. It distinguishes workspace `admin` from workspace `operator`. The latter operates the workspace end-to-end but cannot reshape its admin roster. The distinction collapses at the tenant scope. Tenant `admin` and tenant `operator` cascades both grant `workspaces.manage_admin` across every workspace in the tenant. Org `owner` and `admin` cascades grant it as well. ## Tenant roles [#tenant-roles] Tenant roles grant tenant-scoped permissions and cascade workspace permissions into every workspace in the tenant. | Role | Description | Workspace cascade | | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | | **admin** | Full tenant management, including tenant deletion | Full workspace `admin` permissions in every workspace, including `workspaces.delete` and `workspaces.manage_admin` | | **operator** | Tenant operations end-to-end except tenant deletion | Identical to tenant `admin` cascade | | **security** | Security review across the tenant | Workspace `security` permissions in every workspace | | **member** | Tenant membership without standing management permissions | None | | **impersonator** | Reserved for impersonation flows | None | | **unprivileged** | Cross-domain workspace invitee in an org with at least one verified domain. No tenant-scoped permissions. Access is limited to workspaces they were explicitly invited to. | None | ### Tenant-scoped permissions [#tenant-scoped-permissions] ✅ means the role has the permission. ❌ means it does not. | Permission | admin | operator | security | member | unprivileged | | ---------------- | :---: | :------: | :------: | :----: | :----------: | | `tenants.view` | ✅ | ✅ | ✅ | ✅ | ❌ | | `tenants.manage` | ✅ | ✅ | ❌ | ❌ | ❌ | | `tenants.delete` | ✅ | ❌ | ❌ | ❌ | ❌ | | `apikeys.manage` | ✅ | ✅ | ❌ | ❌ | ❌ | | `audit.view` | ✅ | ✅ | ✅ | ❌ | ❌ | | `config.manage` | ✅ | ✅ | ❌ | ❌ | ❌ | Tenant admin, operator, and security inherit workspace permissions across every workspace in the tenant. Tenant member receives no workspace cascade. Assign a workspace role separately to grant workspace access. `tenants.delete` is the admin-only marker at the tenant-direct scope, analogous to `workspaces.delete`. Tenant operators run the tenant end-to-end but cannot delete it. Org `owner` and `admin` cascade `tenants.delete` across every tenant. ## Organization roles [#organization-roles] Organization roles cascade into every tenant and workspace in the org. | Role | Description | Cascade | | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | | **owner** | Full org management. Create and delete tenants. Manage org members. | Full tenant admin and workspace admin grants across every tenant, including `tenants.delete` | | **admin** | Tenant management. Create workspaces. Assign workspace roles. | Same as owner | | **member** | Org membership without standing permissions | None | | **unprivileged** | Cross-domain workspace invitee in an org with at least one verified domain. No org-scoped permissions and no auto-enrollment into open tenants. Access is limited to workspaces they were explicitly invited to. | None | ### Org-scoped permissions [#org-scoped-permissions] ✅ means the role has the permission. ❌ means it does not. | Permission | owner | admin | member | unprivileged | | ------------------- | :---: | :---: | :----: | :----------: | | `org.view` | ✅ | ✅ | ✅ | ❌ | | `tenants.manage` | ✅ | ✅ | ❌ | ❌ | | `apikeys.manage` | ✅ | ✅ | ❌ | ❌ | | `audit.view` | ✅ | ✅ | ❌ | ❌ | | `billing.manage` | ✅ | ✅ | ❌ | ❌ | | `modelrates.manage` | ✅ | ✅ | ❌ | ❌ | | `config.manage` | ✅ | ✅ | ❌ | ❌ | `org.view` gates "I'm a real participant in this org" reads. The `ListJoinableTenants` endpoint requires it, so unprivileged invitees cannot enumerate the org's open tenants. `tenants.manage` at the org scope also gates org-membership management (`ListOrgMembers`, `AssignOrgRole`, `RemoveOrgMember`). Only an org `owner` may grant or remove the `owner` role — admins cannot self-escalate. A last-owner guard prevents removing the final owner: the request returns `FailedPrecondition` so an org can never reach zero owners. Grants require the target user to already exist on the platform; there is no implicit user creation. `audit.view` at the org scope widens audit reads across every tenant and workspace in the org. Owner and admin only; platform-user sessions or org-scoped API keys. See [Query events across an organization](/operate/audit#query-events-across-an-organization). `billing.manage` covers the organization's commercial relationship with Dome: plan, seats, payment methods, invoices, and billing status. `modelrates.manage` is separate: it covers the organization's upstream provider rate card, including reads because those rates are contract terms. Neither permission cascades from a workspace or tenant role. ## Permission combinations [#permission-combinations] Some operations change both an object and the authorization rules derived from it. Registering or updating an agent with any access or delegation field requires `agents.register` and `rules.deploy`. This includes ID-based pool grants (`allowed_pool_ids`) as well as pool names, direct models, tools, gateways, act-as allow-lists, and required act-as settings. An identity-only agent registration or update does not require `rules.deploy`. ## Grantable permission discovery [#grantable-permission-discovery] Platform API keys take an explicit permission list. Discover what the caller may grant with: * CLI: [`dome platform-keys permissions`](/cli/settings/platform-keys) * MCP: [`dome_platform_keys_available_permissions`](/reference/mcp/platform) * API: [`GetGrantablePermissions`](/api/tag/access-control/get-grantable-permissions), [`ResolvePermissions`](/api/tag/access-control/resolve-permissions) ## Next steps [#next-steps] Grant these from Manage Access. Agent runtime auth is Cedar: * [Permissions](/concepts/platform/permissions) concept for how platform RBAC relates to agent authorization * [Manage Access](/manage/access) to assign members and create platform keys * [Scopes](/concepts/platform/scopes) concept for the org → tenant → workspace hierarchy * [Authorization Model](/concepts/architecture/authorization-model) concept for Cedar agent authorization * [Rules](/reference/controls/rules) reference for the entity, action, and attribute catalogs # How agents work (/learn/agents) ## Every agent is code, models, and tools [#every-agent-is-code-models-and-tools] An agent combines application code, one or more models, and a set of tools. The language, framework, and deployment can vary, but those three parts are consistent. * **Code** handles input, keeps track of state, and makes calls. * **Models** decide what to do next based on the conversation so far. * **Tools** connect the agent to other systems: APIs, databases, Slack, or a payments endpoint. The balance depends on the job. A support chatbot may have a small amount of code, one model, and no tools. A workflow agent may have much more code, several models, and dozens of tools. The agent runtime (code) sends the available context to the model. If the model requests a tool, the runtime executes the call and includes the result in the next model request. One pass through those steps is a round. If the model is not ready to answer, the loop runs again. Rather than writing a branch for every next step, you let the model choose at runtime. You supply a question and a list of tools, and the model picks. It can also request more than one tool at a time. Two independent lookups may run together in the same round. So the same question, asked twice, can take a different route. One ask might make three calls across three rounds, two of them together. The next might make one call and stop, because one was enough. Both can reach the same answer. That variation is expected. You decide which tools the agent can reach. During a run, the model decides which ones to use, in what order, with which arguments, and when to stop. ## Tool approval does not control access [#tool-approval-does-not-control-access] Teams usually approve tools one at a time for a specific agent, and each approval may be reasonable on its own. An HR assistant needs to read HR records. A standup bot needs to post to Slack. A payouts service needs to move money. Approval alone does not prevent another agent from calling the same tool. The system that handles the call must enforce the restriction at runtime. Now consider one agent with access to all four tools and no check in front of them. It can call the tools in any order, feed one result into the next call, or request several calls in the same round. An agent with several tools can combine them in ways that were not part of the individual reviews. It could read an HR record and post it to a channel with two hundred people, or take an amount from the ledger and use it in a transfer. Reviewing every combination would not stop an agent from using tools approved for someone else. Give a new agent the same tools and it gets the same access. The authorization check has to know which agent is making each call. ## Where today's controls stop [#where-todays-controls-stop] Suppose an agent is about to move $48,000 to an unfamiliar account. A normal stack may already have these protections: * **Access control** asks whether this caller may use the agent. Yes, she is on the finance team. * **Scoped credentials** ask whether this key is valid for the payments API. Yes, and it reaches nothing else. * **Network policy** asks whether this host is on the allowed list. Yes. * **Audit logging** asks whether the call can be recorded. Yes, once it completes. All four checks can pass correctly. The missing question is whether this agent, acting for this person, should make this particular transfer. The log records the transfer and the 200 response after the fact. It may not say which agent acted, who the agent was acting for, or which rule allowed the call, because none of those controls made an authorization decision. ## Authorize each call before it runs [#authorize-each-call-before-it-runs] The authorization check has to run before the call reaches the tool. It also needs enough information to decide whether that specific call should run. The check needs four facts: 1. **Which agent** is calling. 2. **Which action** it is attempting. 3. **The arguments** it is attempting them with. 4. **Who it is acting for.** With only the action and arguments, the check can cap transfers, but the cap also blocks the payroll agent's legitimate $48,000 payment. Add the agent identity and the finance director still has the same limit as the intern. The person's identity is what allows a shared agent to apply different permissions to different users. The check also has to run in the right place: * **In the prompt**, the model decides whether to follow the instruction. * **In the agent's code**, it covers that agent and the code paths where the check was added. Other agents and overlooked retry paths may bypass it. * **In front of every call**, it covers every agent that uses that boundary, regardless of language or deployment. Rules and logs need an identity for the agent's code. Tool calls need authorization before they have an effect, and model calls need it before context leaves the agent. ## How Dome does it [#how-dome-does-it] Dome provides three control points, one for each part of the agent: * The [Registry](/build/agents) governs the code. It gives the agent an identity that rules, logs, and operators can reference. * The [Tool Gateway](/build/gateways) governs tool calls. It decides each call before it runs, keeps backend credentials out of the agent, and runs [Guards](/govern/guards) on the response. * The [Model Broker](/connect/models) governs model calls. It routes calls to the provider, evaluates them with the same [Rules](/govern/rules) and guards, and records them in the same audit trail. All three use the same control plane for access, authorization, and audit. Dome uses [Cedar](/concepts/architecture/authorization-model) to evaluate the same request consistently. The audit trail records the reason for a denial as well as the result. To try it on an agent of your own, see [Govern your first agent](/tutorials/get-started/govern-your-first-agent). # How agents borrow your identity (/learn/identity) ## Two ways an agent can act [#two-ways-an-agent-can-act] An agent can act as itself or for a person. That choice decides whether its access stays the same or changes depending on who is using it. With **standing identity**, the agent acts as itself. No one asked it to run and no one is waiting for it, so the access it needs belongs to the job rather than a person. The authorization check only needs the agent identity. * A reconciler that runs at 2am and does the same work every night. * A CI reviewer for one repository. * An incident responder with a fixed set of actions. Most unattended automation works this way. Giving a nightly job someone's permissions would give it more access than it needs. Most of the agents people call theirs work this way too. Dana's assistant knows how she writes, which of her reports to loop in, and what she decided last quarter, and that history is what makes it feel like hers. It is memory, not permission. It shapes the answers, and it changes nothing about what she is allowed to do. The credentials behind every call are the same either way, so the same permissions apply no matter who is asking. Standing identity is right for Dana because she is the only one using it. If two people with different access share the agent, standing identity no longer works. Now take a finance assistant shared by the whole company. Marina is the CFO, Leo is an intern, and both ask it for the private Q3 forecast. The agent makes the same tool call for either person: `send_forecast({ "quarter": "Q3", "to": "me" })` With standing identity, both people get the forecast. Your app knew who signed in, but the tool call includes only `finance-assistant`, so the authorization check cannot tell Marina and Leo apart. Leo could not access that forecast on his own, but the assistant gives it to him. Remove the agent's access and Marina loses it too. The permission is not the problem; the request is missing the person using the agent. With **delegated identity**, the agent sends two things: its own identity, and the person it is acting for. * `finance-assistant` acting for `marina@acme.com`, a finance executive: allowed. * `finance-assistant` acting for `leo@acme.com`, an intern: refused. Marina gets the forecast and Leo is refused. Both calls use the same code, endpoint, prompt, and tools. Only the person on the request changes, and each person gets the access they would have without the assistant. The same approach works for other shared agents: * A shared HR assistant where an HR partner can open anyone's record and everyone else can open only their own. * A support assistant where the customer who signed in decides which tenant's data is in reach, rather than an argument the model picks. Marina's identity is attached to one request. The agent does not keep it, so the next call has to include her again. Delegation cannot give the agent access that Marina does not already have. ## You do not need one agent per person [#you-do-not-need-one-agent-per-person] A shared agent runs as one service. The same deployment handles Marina's request and Leo's request. You could give people different permissions by registering a separate agent for each of them. Every one of those agents runs the same code, and each still needs a key to rotate, grants to review, and someone to delete it the day its owner leaves. Register the code once as `finance-assistant` and attach the person to each request instead: `agent=finance-assistant acting_for=` The two identities answer different questions. The agent identity says which service called. The person says who it called for this time. In an ordinary week, someone joins, someone is promoted, someone moves teams, and someone leaves. The finance assistant stays the same. When each request includes the person, Leo gets his new access on his next call. With one agent per person, all four changes create work for the platform team. ## The agent cannot pick who it acts for [#the-agent-cannot-pick-who-it-acts-for] The agent cannot simply write "I am the CFO" into its own request. An identity provider has to verify the person outside the model. Marina signs in wherever your company already signs people in, such as Okta, Google Workspace, Microsoft Entra ID, or Auth0. That provider hands back a token that says who she is: her email, her roles, her groups. Nobody typed any of it, and the signature gets checked against the provider's published keys before a rule reads a word of it. The request can arrive in three states. An unsigned identity from the agent is no more trustworthy than one added by application code: * **No person attached.** Nothing about a person rides along on the call, so there is nothing to verify and nothing for a rule to read. * **A claim nobody signed.** The request has an address but no proof of who put it there, so Dome drops it rather than trusting it. * **Signed by your identity provider.** The signature matches, so the token opens into claims a rule can act on without taking anyone's word for it. Once a call goes through, both identities are on the record. Every audit event carries an `identity_chain`, and a delegated call fills in two hops: the agent that ran, then the person it ran for, with their roles. A refusal is a record too. Marina's forecast wrote `tool.call` at attempted and completed stages. Leo asked for the same forecast and wrote a completed `tool.call` with `result=denied`, his identity, and the refusing rule in the shared `denial` block. ## Which one you need [#which-one-you-need] Should two people using this agent have the same access? If not, the person has to be on the request. If everyone should have the same access, standing identity is enough. Use **standing identity** when the agent does its own job with fixed permissions: * Nobody is waiting on the other end of the call. * It runs on a schedule, or reacts to a system rather than a person. * Everyone who can trigger it should reach the same things anyway. That covers nightly reconciliation, a deploy bot, a monitoring agent, and the personal assistant only its owner ever uses. Use **delegated identity** when one deployment acts for many people and the person changes what it may call: * One service is shared by people with different access. * A tool the CFO is allowed to use is one the intern should be refused. * You need to be able to say who a call was for, months later. That covers the finance assistant, an internal support copilot, and anything sitting behind a login that people query about their own work. Neither model is always better. Standing identity cannot distinguish between people sharing an agent. Delegated identity adds a person where unattended jobs do not need one. ## How Dome does it [#how-dome-does-it] Dome verifies the person against that provider using OIDC, HMAC, or a server-bound enrollment identity, and a workspace can require a verified person on every call. See [Delegated agents](/build/agents/delegated) to set it up. Once the check passes, the person's claims land on `principal.act_as` as their subject, email, roles, groups, and anything custom your provider sends. Rules read them directly: ```cedar permit( principal, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"send_forecast" ) when { principal has act_as && principal.act_as.roles.contains("finance-executive") }; ``` The agent is still `finance-assistant`, and Marina's identity applies only to this call. Dome records both identities, the result, and the reason for the decision. To try this with one shared HR application, follow [Govern per end user](/tutorials/get-started/govern-per-end-user). For the technical model and configuration, see [Identity patterns](/concepts/identity-patterns) and [Agent identity](/concepts/agents/identity). # Learn (/learn) Work through the ideas behind agent governance. Each lesson uses interactive diagrams and short checks so you can see what changes as an agent acts. * [How agents work](/learn/agents): Follow code, models, and tools through the agent loop, then see why each call needs a control point. * [How agents borrow your identity](/learn/identity): Standing and delegated identity, and how one shared agent lets the CFO reach tools an intern cannot without running an agent per person. # SDKs (/sdks) 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. * [Python SDK](/sdks/python/quickstart): `pip install dome-sdk` — gateway-first `Client` and `AsyncClient`, framework adapters, optional local policy sync. ## What the SDK does [#what-the-sdk-does] The client wraps the Dome data plane and presents one surface per concern. | Surface | Purpose | | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | `client.gateway.tools` | List and call MCP tools through the [gateway](/concepts/architecture/dataplane). Bounded in-memory `tools/list` cache | | `client.gateway.llm` | OpenAI- and Anthropic-shaped LLM calls through the [LLM gateway](/connect/pools), 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.audit` | Cursor-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 [#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](/concepts/architecture/dataplane) directly. Agents that don't run Python use the gateway over MCP without an SDK. ## Lifecycle [#lifecycle] ```mermaid flowchart LR A["Construct"] --> B["connect"] B --> C["gateway calls"] C -.->|optional| D["start_policy_sync + check"] C --> E["close"] D --> E ``` | Step | Purpose | Network | | ---------------------------------------------- | --------------------------------------------------------------------------- | --------------------------- | | **Construct** | Validate configuration, build transports | None | | **connect** | Prepare credentials. Token exchange when needed for control-plane discovery | Yes when exchanging | | **gateway calls** | `tools.list`, `tools.call`, `llm.chat`, `llm.messages`, `audit.query` | Yes — per call | | **start\_policy\_sync** *(optional)* | Launch background Cedar bundle sync for local checks | Yes — blocking initial sync | | **close** | Release transports, stop background sync, drain pending audit | Flush only | ## Next steps [#next-steps] Python Client first. Adapters and Develop cover frameworks and credentials: * [Python reference](/sdks/python/reference) for Client, gateway calls, and act-as * [Adapters](/sdks/python/adapters) for LangChain and other frameworks * [Develop](/develop) for runtime credentials and gateway endpoints * [Examples](/tutorials/examples) for governed agent patterns # Hands-on Labs (/tutorials) Every tutorial runs in a workspace and ends with a governed call you can verify in the audit trail. Follow the guided path in order, or jump to the track that matches your role. ## Get started [#get-started] Four tutorials, in sequence. Each one builds on the workspace the one before it left behind. 1. [Govern your first agent](/tutorials/get-started/govern-your-first-agent): Allow, redact, and deny tool calls from Cursor, Claude, or curl. 2. [Call a model through a pool](/tutorials/get-started/call-a-model-through-a-pool): Route chat through a model pool with failover and server-side keys. 3. [Build a governed app](/tutorials/get-started/build-a-governed-app): Wire model and tool calls in one app. Watch allow, redact, and deny. 4. [Govern per end user](/tutorials/get-started/govern-per-end-user): Give each user different tool access and answers from the same agent. ## Choose your role [#choose-your-role] What developer, security, operator, and platform admin each own on Dome, with a guided workspace walk for each. * [Developer](/tutorials/role/developer): Register an agent, call tools through a gateway, and confirm allow and deny. * [Security](/tutorials/role/security): Author and simulate Cedar, redact sensitive fields, prove denials, and export evidence. * [Operator](/tutorials/role/operator): Attach tools, expose a gateway, grant access, and watch audit. * [Platform Admin](/tutorials/role/platform-admin): Set who may administer Dome, check platform health, and export an audit snapshot. ## Production [#production] Take what you built in the workspace and run it for real. * [Use Dome as an MCP gateway](/tutorials/production/use-dome-as-an-mcp-gateway): Let Cursor, Claude Code, or Codex sign in with your own Dome account and call MCP tools, individually audited. * [Use Dome as a model broker](/tutorials/production/use-dome-as-a-model-broker): Hold the provider key server-side and let Cursor, Claude Code, or Codex call any model, not just their own. * [Govern callers with OIDC](/tutorials/production/govern-callers-with-oidc): Authorize a shared assistant from each employee's verified identity, then inspect every caller. * [Deploy an always-on agent](/tutorials/production/deploy-your-agent/always-on): Build and deploy a governed HTTP service that stays ready for requests. * [Deploy an event-driven agent](/tutorials/production/deploy-your-agent/event-driven): Build and deploy a governed handler that wakes for an event and exits. ## Examples [#examples] Working applications you can clone and adapt. * [Interactive app](/tutorials/examples/interactive-agent): A chess coach that acts for each player, beside a standing opponent. * [Scheduled agent](/tutorials/examples/noninteractive-agent): A nightly GitHub report that cannot merge, comment, or file. Python, TypeScript, or Go. # dome agents (/cli/build/agents) `dome agents` registers the agents a workspace governs and manages their lifecycle, the rules assigned to them, and the API keys they authenticate with. An agent must be registered before the gateway will authorize anything it calls. Refer to [Agents](/build/agents) for the concept model. | Command | | | ----------------------------------------------------- | --------------------------------------------------- | | [Register agent](#register-agent) | `dome agents register` | | [List agents](#list-agents) | `dome agents list` | | [Get agent](#get-agent) | `dome agents get [name-or-id]` | | [Update agent](#update-agent) | `dome agents update [name-or-id]` | | [Suspend agent](#suspend-agent) | `dome agents suspend [name-or-id]` | | [Reactivate agent](#reactivate-agent) | `dome agents reactivate [name-or-id]` | | [Revoke agent](#revoke-agent) | `dome agents revoke [name-or-id]` | | [Delete agent](#delete-agent) | `dome agents delete [name-or-id]` | | [Assign policy](#assign-policy) | `dome agents assign-policy [name-or-id] [files...]` | | [Get policies](#get-policies) | `dome agents get-policies [name-or-id]` | | [Create key](#create-key) | `dome agents create-key [name-or-id]` | | [List keys](#list-keys) | `dome agents list-keys [name-or-id]` | | [Rotate key](#rotate-key) | `dome agents rotate-key [name-or-id] [key-name]` | | [Revoke key](#revoke-key) | `dome agents revoke-key [name-or-id] [key-name]` | | [List interactive grants](#list-interactive-grants) | `dome agents interactive-grants list` | | [Revoke interactive grant](#revoke-interactive-grant) | `dome agents interactive-grants revoke ` | ## Register agent [#register-agent] ```bash dome agents register ``` Register a new agent in the current workspace. Pass fields with per-field flags or load the full definition from a JSON/YAML file with `--file`. ```bash dome agents register --name [flags] dome agents register --file ``` | Flag | Type | Required | Description | | ------------------------- | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--file`, `-f` | string | Yes\* | Path to a JSON/YAML file with the full agent definition. Use `-` for stdin. Mutually exclusive with per-field flags | | `--name` | string | Yes\* | agent name | | `--parent-id` | string | No | Parent agent ID | | `--metadata` | key=value | No | agent metadata (repeatable) | | `--token-ttl` | duration | No | Access-token lifetime for this agent, such as `15m` (`1m`–`24h`). Blank uses the `10m` default | | `--if-not-exists` | bool | No | Return existing agent if name is taken | | `--pool` | string\[] | No | LLM pool the agent may route to (repeatable). Emits a `permit` against `Dome::LLMModel` matched via `resource.pool == ""` in the agent's generated bundle | | `--model` | string\[] | No | LLM model connection the agent may invoke directly (repeatable, advanced — pools are preferred). Emits a `permit` against `Dome::LLMModel` | | `--tool` | string\[] | No | MCP tool the agent may call, as `/` (repeatable). Emits `mcp:call` and `mcp:discover` permits against `Dome::MCPTool` | | `--gateway` | string\[] | No | [Gateway](/build/gateways) ID (UUID) the agent may reach (repeatable). Admits the agent at the gateway endpoint and generates a membership-conditioned permit. | | `--actas-allowed-group` | string\[] | No | Group the agent's verified act-as identity may belong to (repeatable). Emits a `forbid` unless the verified group matches | | `--actas-allowed-email` | string\[] | No | Email the agent may act on behalf of (repeatable). Emits a `forbid` unless the verified email matches | | `--actas-allowed-subject` | string\[] | No | Subject the agent may act on behalf of (repeatable). Emits a `forbid` unless the verified subject matches | | `--actas-method` | string | No | Act-as verification: `none`, `oidc`, `hmac` | | `--actas-required` | bool | No | Require act-as header on every request | | `--actas-provider` | string | No | Workspace verification provider ID | | `--actas-oidc-url` | string | No | Inline OIDC discovery URL | | `--actas-hmac-secret` | string | No | Inline HMAC shared secret | | `--actas-config-name` | string | No | Label for agent-specific verification config | | `--interactive-access` | bool | No | Let authorized humans ride this agent through interactive OAuth | | `--pool` | string\[] | No | LLM pool name the agent may route to (repeatable) | | `--model` | string\[] | No | LLM model connection name the agent may invoke directly (advanced; repeatable) | | `--tool` | string\[] | No | MCP tool the agent may call as `/` (repeatable) | | `--actas-allowed-group` | string\[] | No | Group claim the agent's verified act-as identity may belong to (repeatable) | | `--actas-allowed-email` | string\[] | No | Email the agent may act on behalf of (repeatable) | | `--actas-allowed-subject` | string\[] | No | Subject the agent may act on behalf of (repeatable) | Populating `--pool`, `--model`, `--tool`, `--gateway`, or an act-as access field triggers generation of an agent-scope `kind='generated'` rule bundle permitting or restricting the corresponding actions. Registering with any of these fields requires `rules.deploy` in addition to `agents.register`. Leaving all three `--actas-allowed-*` lists empty means "any verified identity is acceptable"; populating any one restricts the agent via a forbid-unless rule. Identity-only registration needs `agents.register` alone. \* Provide either `--name` (per-field mode) or `--file`. The two modes cannot be combined. ### Register from a file [#register-from-a-file] Use `--file` to register from a single JSON or YAML document. The file shape mirrors the `RegisterAgentRequest` proto — the same schema the SDKs and Terraform provider consume — so a typo in a field name fails fast rather than silently dropping. The workspace is always taken from the active context; a `workspace_id` in the file is ignored. ```yaml agent.yaml name: claude-research allowed_pool_names: [openai-prod] allowed_tools: [github/list_repos] actas_config: method: oidc required: true oidc_discovery_url: https://idp.example.com ``` ```bash dome agents register --file agent.yaml # JSON works too dome agents register -f agent.json # Read from stdin printf '{"name":"x"}' | dome agents register -f - ``` ## List agents [#list-agents] ```bash dome agents list ``` List agents in the current workspace. ```bash dome agents list [flags] ``` | Flag | Type | Description | | ---------- | ------ | ----------------------------------------------------------------- | | `--status` | string | filter by status: `active`, `provisioned`, `suspended`, `revoked` | | `--limit` | int | Maximum results (default: 100) | ## Get agent [#get-agent] ```bash dome agents get [name-or-id] ``` Get details for a specific agent. Pass `--gateway ` to select an accessible gateway and include its complete protocol endpoints. Without the flag, the command returns agent metadata only. ```text Output Name: data-pipeline-agent ID: a1b2c3d4-… Status: active Gateway ID: {{GATEWAY_ID}} Gateway URL: https://gateway.example.dome.dev/gateways/{{GATEWAY_ID}} MCP URL: https://gateway.example.dome.dev/gateways/{{GATEWAY_ID}}/mcp ``` | Flag | Type | Description | | ----------- | ------ | ---------------------------------------------------------------------------------------------- | | `--gateway` | string | gateway ID used to resolve endpoints; required when the agent can access more than one gateway | ## Update agent [#update-agent] ```bash dome agents update [name-or-id] ``` Update an agent's metadata, token lifetime, allowed resources, or act-as config. | Flag | Type | Description | | ------------------------- | --------- | ---------------------------------------------------------------------------------------------------- | | `--metadata` | key=value | Updated metadata | | `--token-ttl` | duration | Set the agent's access-token lifetime, such as `15m` (`1m`–`24h`). Empty resets to the `10m` default | | `--pool` | string\[] | Replace the agent's allowed LLM pool list | | `--model` | string\[] | Replace the agent's allowed direct-model list | | `--tool` | string\[] | Replace the agent's allowed MCP tool list (`/`) | | `--gateway` | string\[] | Replace the agent's allowed [Gateway](/build/gateways) ID list (UUIDs; repeatable) | | `--actas-allowed-group` | string\[] | Replace the agent's act-as allowed-groups list | | `--actas-allowed-email` | string\[] | Replace the agent's act-as allowed-emails list | | `--actas-allowed-subject` | string\[] | Replace the agent's act-as allowed-subjects list | | `--actas-method` | string | Act-as verification: `none`, `oidc`, `hmac` | | `--actas-required` | bool | Require act-as header | | `--actas-provider` | string | Workspace verification provider ID | | `--actas-oidc-url` | string | Inline OIDC discovery URL | | `--actas-hmac-secret` | string | Inline HMAC shared secret | | `--actas-config-name` | string | Label for agent-specific verification config | | `--interactive-access` | bool | Enable or disable interactive OAuth for this agent | | `--pool` | string\[] | Replace the agent's allowed LLM pool list (repeatable) | | `--model` | string\[] | Replace the agent's allowed direct-model list (advanced; repeatable) | | `--tool` | string\[] | Replace the agent's allowed MCP tool list (repeatable; each `/`) | | `--actas-allowed-group` | string\[] | Replace the agent's act-as allowed-groups list (repeatable) | | `--actas-allowed-email` | string\[] | Replace the agent's act-as allowed-emails list (repeatable) | | `--actas-allowed-subject` | string\[] | Replace the agent's act-as allowed-subjects list (repeatable) | The `--pool`, `--model`, `--tool`, and `--actas-allowed-*` flags use **PUT semantics**: whatever you send IS the new state, including an empty value meaning "clear". To update only one field, get the agent first and pass the current values back. Changing any of these four-pillar fields (or `--actas-method` / `--actas-required`) regenerates the agent's `kind='generated'` rule bundle and therefore requires the `rules.deploy` permission in addition to `agents.register`. Identity-only updates (name, metadata, token TTL) pass through on `agents.register` alone. ## Lifecycle [#lifecycle] ### Suspend agent [#suspend-agent] ```bash dome agents suspend [name-or-id] ``` Suspend an agent temporarily. | Flag | Type | Description | | ----------- | ------ | ------------------------- | | `--reason` | string | Suspension reason | | `--cascade` | bool | Also suspend child agents | ### Reactivate agent [#reactivate-agent] ```bash dome agents reactivate [name-or-id] ``` Reactivate a suspended agent. ### Revoke agent [#revoke-agent] ```bash dome agents revoke [name-or-id] ``` Permanently revoke an agent. Always cascades to all descendants. | Flag | Type | Description | | ---------- | ------ | ----------------- | | `--reason` | string | Revocation reason | ### Delete agent [#delete-agent] ```bash dome agents delete [name-or-id] ``` Permanently hard-delete a revoked agent and all its data. Requires the agent to be in a revoked state. | Flag | Type | Description | | ----------- | ------ | ----------------------------- | | `--reason` | string | Deletion reason | | `--cascade` | bool | Also delete descendant agents | ## Rules [#rules] ### Assign policy [#assign-policy] ```bash dome agents assign-policy [name-or-id] [files...] ``` Deploy Cedar rules scoped to a specific agent. ### Get policies [#get-policies] ```bash dome agents get-policies [name-or-id] ``` Get Cedar rules assigned to an agent. ## API keys [#api-keys] ### Create key [#create-key] ```bash dome agents create-key [name-or-id] ``` Create an agent authentication key. Prints the token and the selected gateway's complete endpoints once. | Flag | Type | Required | Description | | ----------- | ------ | -------- | ---------------------------------------------------------------------------------------------- | | `--name` | string | Yes | Key name | | `--gateway` | string | No | gateway ID used to resolve endpoints; required when the agent can access more than one gateway | ```text Output ✓ API key "default" created for agent my-first-agent ✓ Token: dome_… Gateway ID: {{GATEWAY_ID}} Gateway URL: https://gateway.example.dome.dev/gateways/{{GATEWAY_ID}} MCP URL: https://gateway.example.dome.dev/gateways/{{GATEWAY_ID}}/mcp ℹ Save this token — it will not be shown again. ``` Use the URL for the protocol your application speaks. JSON output returns `gatewayId` and `gatewayEndpoints`. ### List keys [#list-keys] ```bash dome agents list-keys [name-or-id] ``` List API keys for an agent. ### Rotate key [#rotate-key] ```bash dome agents rotate-key [name-or-id] [key-name] ``` Rotate an agent's API key — revokes the old secret and issues a new one. Use `--gateway ` to select the gateway when the agent can access more than one. Output includes `gatewayId` and `gatewayEndpoints`. ### Revoke key [#revoke-key] ```bash dome agents revoke-key [name-or-id] [key-name] ``` Revoke an agent's API key permanently. ## Interactive access [#interactive-access] Set `--interactive-access` only when human MCP clients should ride this agent. Interactive access requires at least one `--actas-allowed-email` or `--actas-allowed-subject`; matching is exact and case-sensitive. Interactive access is mutually exclusive with device binding. Group allow-lists do not match interactive logins. Human traffic spends the selected agent's quotas. ### List interactive grants [#list-interactive-grants] ```bash dome agents interactive-grants list ``` List grants owned by the signed-in person. This self-service view requires no workspace permission. ```bash dome agents interactive-grants list --all-users dome agents interactive-grants list --agent ``` List all grants in the active workspace with `--all-users`. This requires `agents.view`. `--agent` filters the workspace result and implies `--all-users`. | Flag | Type | Description | | ------------- | ------ | ------------------------------------------------- | | `--all-users` | bool | List every grant in the active workspace | | `--agent` | string | filter by agent name or ID; implies `--all-users` | A platform API key has no personal grants. Use `--all-users` with a workspace-, tenant-, or org-scoped key that grants `agents.view`. The output contains grant IDs, agent and client identity, status, creation, last use, expiration, and refresh count. It never returns tokens or secret material. ### Revoke interactive grant [#revoke-interactive-grant] ```bash dome agents interactive-grants revoke ``` Revoke the refresh-token family immediately. The current access token remains usable only until its short expiry. Anyone can revoke their own grant. Revoking another person's grant requires `agentkeys.manage` on the grant's workspace. A platform API key always uses this administrator path. # dome gateways (/cli/build/gateway) `dome gateways` manages workspace-scoped groupings of callable resources — MCP tool connections, LLM pools, and direct LLM model connections — plus the agent access grants that govern each grouping. Refer to [Gateways](/build/gateways) for the concept model. Resource-side mirrors live under [`dome tools gateways`](/cli/connect/tools#gateway-membership) and [`dome models pool gateways`](/cli/connect/models#gateway-membership) (each with `list`, `add`, `remove`). Attach at create time with `--gateway` on `dome tools add`, `dome models add`, and `dome models pool create`. | Command | | | --------------------------------------------------------------- | ---------------------------------------------------------- | | [List gateways](#list-gateways) | `dome gateways list` | | [Get gateway](#get-gateway) | `dome gateways get ` | | [Create gateway](#create-gateway) | `dome gateways create ` | | [Update gateway](#update-gateway) | `dome gateways update ` | | [Enable gateway](#enable-gateway) | `dome gateways enable ` | | [Disable gateway](#disable-gateway) | `dome gateways disable ` | | [Set default gateway](#set-default-gateway) | `dome gateways set-default ` | | [Delete gateway](#delete-gateway) | `dome gateways delete ` | | [Add tool](#add-tool) | `dome gateways tools add ` | | [Remove tool](#remove-tool) | `dome gateways tools remove ` | | [Add tool source](#add-tool-source) | `dome gateways tool-sources add ` | | [Remove tool source](#remove-tool-source) | `dome gateways tool-sources remove ` | | [Add model pool](#add-model-pool) | `dome gateways model-pools add ` | | [Remove model pool](#remove-model-pool) | `dome gateways model-pools remove ` | | [Add model](#add-model) | `dome gateways models add ` | | [Remove model](#remove-model) | `dome gateways models remove ` | | [List access](#list-access) | `dome gateways access list ` | | [Grant access](#grant-access) | `dome gateways access grant ` | | [Revoke access](#revoke-access) | `dome gateways access revoke ` | | [Grant access to all agents](#grant-access-to-all-agents) | `dome gateways access grant-all ` | | [Revoke access from all agents](#revoke-access-from-all-agents) | `dome gateways access revoke-all ` | | [Enable interactive access](#enable-interactive-access) | `dome gateways interactive enable ` | | [Disable interactive access](#disable-interactive-access) | `dome gateways interactive disable ` | ## Gateways [#gateways] ### List gateways [#list-gateways] ```bash dome gateways list ``` List gateways in the active workspace: name, default marker, ID, state, and canonical endpoint path (`/gateways/`). Alias: `ls`. The endpoint column shows one path per gateway — the single URL every client points at. The Dome SDK and Anthropic clients use it as-is; MCP clients append `/mcp`; OpenAI-compatible clients append `/v1`. Refer to [Endpoint shape](/build/gateways#build-the-runtime-endpoint). ### Get gateway [#get-gateway] ```bash dome gateways get ``` Show a gateway's members — tools, tool sources (connections), LLM pools, and direct model connections — plus its canonical endpoint path (`/gateways/`), state, default marker, and grant settings. ### Create gateway [#create-gateway] ```bash dome gateways create ``` Create a gateway. Starts active with empty membership; attach resources with the membership commands or `--gateway` at resource create. | Flag | Type | Required | Default | Description | | --------------- | ------ | -------- | ------- | -------------------------- | | `--description` | string | No | — | Human-readable description | ```bash dome gateways create prod-tools --description "Production MCP tools for the ops agent" ``` ### Update gateway [#update-gateway] ```bash dome gateways update ``` Rename or edit the description. Toggle state with [`enable`](#enable-gateway) / [`disable`](#disable-gateway). | Flag | Type | Required | Default | Description | | --------------- | ------ | -------- | ------- | ---------------- | | `--name` | string | No | — | New gateway name | | `--description` | string | No | — | New description | ### Enable gateway [#enable-gateway] ```bash dome gateways enable ``` Re-enable a disabled gateway. Membership and grants are preserved. ### Disable gateway [#disable-gateway] ```bash dome gateways disable ``` Disable a gateway. Its endpoint fails closed until re-enabled. ### Set default gateway [#set-default-gateway] ```bash dome gateways set-default ``` Mark a gateway as the workspace default — the pre-checked (but overridable) gateway in the dashboard's tool, pool, and model create dialogs. A suggestion only; it enforces no membership and grants no access. Setting a new default clears the previous one. A disabled default is never pre-selected. ### Delete gateway [#delete-gateway] ```bash dome gateways delete ``` Delete a gateway. Its memberships are removed, but the underlying tools, pools, and model connections are unchanged. Aliases: `rm`, `remove`. > **Warning**: Callers pointed at this gateway's `/gateways//…` endpoint will fail closed after deletion. Repoint them at another gateway first. ## Tools [#tools] ### Add tool [#add-tool] ```bash dome gateways tools add ``` Add a single MCP tool to a gateway. `` is the observed tool's ID from [`dome tools catalog list`](/cli/connect/tools#list-tools). To include every tool from a connection — with newly discovered tools joining automatically — use [`tool-sources add`](#add-tool-source) instead. ### Remove tool [#remove-tool] ```bash dome gateways tools remove ``` Remove a single MCP tool. Alias: `rm`. ## Tool sources [#tool-sources] ### Add tool source [#add-tool-source] ```bash dome gateways tool-sources add ``` Add an MCP server connection as a tool source. The gateway includes every tool observed on the connection; newly discovered tools propagate automatically. ### Remove tool source [#remove-tool-source] ```bash dome gateways tool-sources remove ``` Remove the tool source. Tools that joined only through this source stop being included. Alias: `rm`. ## Model pools [#model-pools] ### Add model pool [#add-model-pool] ```bash dome gateways model-pools add ``` Add an LLM pool. The gateway exposes the pool's models at its `/gateways//v1` endpoint. ### Remove model pool [#remove-model-pool] ```bash dome gateways model-pools remove ``` Alias: `rm`. ## Models [#models] ### Add model [#add-model] ```bash dome gateways models add ``` Add a direct (un-pooled) LLM model connection. The gateway exposes the model without going through a pool — useful when a single provider serves one purpose. ### Remove model [#remove-model] ```bash dome gateways models remove ``` Alias: `rm`. ## Access [#access] ### List access [#list-access] ```bash dome gateways access list ``` List agents and whether each is currently granted access to the gateway. Revoked agents are excluded — they cannot exchange their API key for a JWT, so they can never reach a gateway. Suspended agents remain in the list because suspension is reversible. ```bash dome gateways access list prod-tools --json ``` ### Grant access [#grant-access] ```bash dome gateways access grant ``` Grant one agent access. Requires the agent-access permission set (`agents.register` + `rules.deploy`). ### Revoke access [#revoke-access] ```bash dome gateways access revoke ``` Revoke one agent's access. ### Grant access to all agents [#grant-access-to-all-agents] ```bash dome gateways access grant-all ``` Grant every current and future workspace agent access to this gateway. Requires `rules.deploy` + `gateways.manage`. ### Revoke access from all agents [#revoke-access-from-all-agents] ```bash dome gateways access revoke-all ``` Clear the all-agents grant. Per-agent grants are unaffected. ## Interactive access [#interactive-access] ### Enable interactive access [#enable-interactive-access] ```bash dome gateways interactive enable \ --email \ --subject ``` Enable browser sign-in for human MCP clients. Requires `gateways.manage` and `rules.deploy`. The command creates or updates a visible interactive agent named `gateway-interactive-`. Human traffic spends that agent's quotas and uses its rules. | Flag | Type | Required | Description | | ----------- | --------- | ----------- | -------------------------------------------------- | | `--email` | string\[] | Conditional | Allowed email; repeatable and case-sensitive | | `--subject` | string\[] | Conditional | Allowed IdP subject; repeatable and case-sensitive | Pass at least one email or subject. The command replaces both allow-lists with exactly the supplied values. Interactive login does not match group allow-lists. Use `dome gateways get ` to inspect the interactive agent and current allow-lists. Use its `mcp_url` as the remote server URL in the MCP client. ### Disable interactive access [#disable-interactive-access] ```bash dome gateways interactive disable ``` Disable new sign-ins and token renewal. The interactive agent and allow-lists remain for later re-enabling; existing access tokens expire within minutes. Cap gateway LLM spend with [`dome quotas`](/cli/govern/quota) (`--subject gateway --gateway `). # dome managed-agents (/cli/build/managed-agents) `dome managed-agents` manages managed agents, whose execution worker Dome runs. For agents whose worker you run in your own runtime, use [`dome agents`](/cli/build/agents). Refer to [Managed agents](/build/agents/managed) for the operating model and trigger configuration. | Command | | | --------------------------------------------- | -------------------------------------------------------------- | | [Create managed agent](#create-managed-agent) | `dome managed-agents create` | | [List managed agents](#list-managed-agents) | `dome managed-agents list` | | [Get managed agent](#get-managed-agent) | `dome managed-agents get [name-or-id]` | | [Update managed agent](#update-managed-agent) | `dome managed-agents update [name-or-id]` | | [Rotate runner key](#rotate-runner-key) | `dome managed-agents rotate-runner-key [name-or-id]` | | [Delete managed agent](#delete-managed-agent) | `dome managed-agents delete [name-or-id]` | | [Run managed agent](#run-managed-agent) | `dome managed-agents run [name-or-id]` | | [Create webhook](#create-webhook) | `dome managed-agents webhook create [name-or-id]` | | [List webhooks](#list-webhooks) | `dome managed-agents webhook list [name-or-id]` | | [Revoke webhook](#revoke-webhook) | `dome managed-agents webhook revoke [name-or-id] [webhook-id]` | | [List runs](#list-runs) | `dome managed-agents runs list [name-or-id]` | | [Get run](#get-run) | `dome managed-agents runs get [run-id]` | ## Create managed agent [#create-managed-agent] ```bash dome managed-agents create \ --name nightly-triage \ --system-prompt "Triage issues filed since the last run." \ --model openai-prod \ --gateway production ``` Create a managed agent in the active workspace. Supply fields directly or load a JSON or YAML definition with the same fields as the [Create managed agent API request](/api/tag/managed-agents/create-managed-agent). | Flag | Type | Required | Description | | ----------------- | ------ | -------- | ----------------------------------------------------------------------- | | `--name` | string | Yes\* | Managed-agent name | | `--system-prompt` | string | No | Persistent instructions for every run | | `--model` | string | No | model or pool name the worker invokes | | `--gateway` | string | Yes\* | gateway name or ID; each managed agent runs through exactly one gateway | | `--file`, `-f` | string | Yes\* | Path to a JSON or YAML `CreateManagedAgentRequest`; use `-` for stdin | \*Provide fields directly or use `--file`. The gateway can be omitted only when exactly one workspace gateway admits every agent. The gateway grant permits every tool the gateway exposes. Managed agents cannot carry separate tool grants. Creating or changing the gateway grant also requires `rules.deploy`. ### Create from a file [#create-from-a-file] Use `--file` when you want to keep the complete managed-agent definition in source control. The `agent` object is the underlying agent registration; it contains the name and its one gateway grant. ```yaml managed-agent.yaml agent: name: nightly-triage allowed_gateway_ids: [production] system_prompt: Triage issues filed since the last run. default_model: openai-prod ``` ```bash dome managed-agents create --file managed-agent.yaml ``` For every available field, refer to [Create managed agent](/api/tag/managed-agents/create-managed-agent). ## List managed agents [#list-managed-agents] ```bash dome managed-agents list ``` List managed agents in the active workspace, including their status, model, and gateway. This command has no command-specific flags. ## Get managed agent [#get-managed-agent] ```bash dome managed-agents get [name-or-id] ``` Show a managed agent's prompt, model, gateway, status, and attached triggers. Pass either its name or ID. This command has no command-specific flags. ## Update managed agent [#update-managed-agent] ```bash dome managed-agents update [name-or-id] [flags] ``` Update one or more managed-agent fields. Fields you omit retain their current values. | Flag | Type | Description | | ----------------- | ------ | ---------------------------------------------- | | `--system-prompt` | string | Replace the system prompt | | `--model` | string | Replace the model or pool | | `--gateway` | string | Replace the one gateway the agent runs through | Use [`dome agents update`](/cli/build/agents#update-agent) for the agent's name, metadata, or act-as settings. Use [`dome triggers update`](/cli/build/triggers#update-trigger) to change a schedule or webhook. ## Rotate runner key [#rotate-runner-key] ```bash dome managed-agents rotate-runner-key [name-or-id] ``` Rotate the runner key Dome holds for the managed agent. Dome stores the replacement before the prior key stops working, and never prints either key. Runs already in progress and later runs use the replacement. Requires `managedagents.manage`. Use this command rather than `dome agents rotate-key`, which does not apply to managed agents. ## Delete managed agent [#delete-managed-agent] ```bash dome managed-agents delete [name-or-id] ``` Delete a managed agent and its underlying agent. Pass the managed agent's name or ID. This command has no command-specific flags. ## Run managed agent [#run-managed-agent] ```bash dome managed-agents run [name-or-id] --input "Review new issues." ``` Queue an immediate run and return its run ID. | Flag | Type | Description | | --------- | ------ | --------------------------------------- | | `--input` | string | Optional first user message for the run | Use [`dome managed-agents runs get`](#get-run) with the returned ID to inspect the run. ## Create webhook [#create-webhook] ```bash dome managed-agents webhook create [name-or-id] --description "GitHub issues" ``` Create an inbound webhook trigger for a managed agent. The response returns the endpoint URL and signing secret once. Every request must carry a Standard Webhooks v1 signature. | Flag | Type | Description | | --------------- | ------ | --------------------------------------- | | `--description` | string | Optional operator label for the webhook | For a trigger that can target more than one managed agent, use [`dome triggers create`](/cli/build/triggers#create-trigger) instead. ## List webhooks [#list-webhooks] ```bash dome managed-agents webhook list [name-or-id] ``` List a managed agent's webhook triggers. The list includes each endpoint URL but never its signing secret. This command has no command-specific flags. ## Revoke webhook [#revoke-webhook] ```bash dome managed-agents webhook revoke [name-or-id] [webhook-id] ``` Permanently revoke a webhook trigger. Its endpoint stops accepting requests. This command has no command-specific flags. ## List runs [#list-runs] ```bash dome managed-agents runs list [name-or-id] --limit 50 ``` List a managed agent's runs, newest first. | Flag | Type | Description | | --------- | ---- | -------------------------------------------------- | | `--limit` | int | Maximum runs to return (default: 50; maximum: 200) | ## Get run [#get-run] ```bash dome managed-agents runs get [run-id] ``` Show one run's status, source, attempts, timestamps, output, and error when available. This command has no command-specific flags. ## Permissions [#permissions] `list`, `get`, and run-history commands require `managedagents.view`. Creating, updating, deleting, and configuring webhooks require `managedagents.manage`. `run` requires `managedagents.invoke`. # dome triggers (/cli/build/triggers) `dome triggers` manages schedules and inbound webhooks that start managed-agent runs. Refer to [Managed agents](/build/agents/managed) for the operating model. | Command | | | --------------------------------------- | -------------------------------------------------- | | [Create trigger](#create-trigger) | `dome triggers create` | | [List triggers](#list-triggers) | `dome triggers list` | | [Get trigger](#get-trigger) | `dome triggers get [name-or-id]` | | [Update trigger](#update-trigger) | `dome triggers update [name-or-id]` | | [Delete trigger](#delete-trigger) | `dome triggers delete [name-or-id]` | | [Fire trigger](#fire-trigger) | `dome triggers fire [name-or-id]` | | [List trigger runs](#list-trigger-runs) | `dome triggers runs [name-or-id]` | | [Enable target](#enable-target) | `dome triggers targets enable [trigger] [target]` | | [Disable target](#disable-target) | `dome triggers targets disable [trigger] [target]` | ## Create trigger [#create-trigger] ```bash dome triggers create \ --name nightly-triage \ --kind schedule \ --cron "0 2 * * *" \ --timezone America/Los_Angeles \ --target nightly-triage \ --max-concurrent 1 ``` Create a schedule or webhook trigger in the active workspace. Supply fields directly or load a full `CreateTriggerRequest` from a JSON or YAML file. | Flag | Type | Required | Description | | --------------------- | --------- | -------- | --------------------------------------------------------------------- | | `--name` | string | Yes\* | Trigger name | | `--kind` | string | Yes\* | `schedule` or `webhook` | | `--description` | string | No | Operator label | | `--cron` | string | Schedule | Cron expression; minimum interval is five minutes | | `--timezone` | string | No | IANA time zone for a schedule; defaults to UTC | | `--input` | string | No | First user message for every fired run | | `--target` | string\[] | No | Managed agent name or ID; repeat to attach several targets | | `--max-concurrent` | int | No | Maximum concurrent runs across targets; `0` is unlimited | | `--disabled` | bool | No | Create the trigger switched off | | `--catch-up` | string | Schedule | Missed-occurrence policy: `once`, `all`, or `skip` | | `--catch-up-deadline` | duration | Schedule | Latest time a missed occurrence can run; `0` is one schedule interval | | `--max-retries` | int | No | Infrastructure retry budget; `0` disables retries | | `--file`, `-f` | string | Yes\* | Path to a JSON or YAML `CreateTriggerRequest`; use `-` for stdin | \*Provide fields directly or use `--file`. A webhook trigger returns its URL and signing secret once. Sign each request with Standard Webhooks v1. Use a fresh `webhook-id` for every distinct message; reuse it only when retrying the same delivery. Dome accepts repeated IDs for 24 hours but starts no additional run. A schedule has a default concurrency limit of one; a webhook has unlimited concurrency by default. ## List triggers [#list-triggers] ```bash dome triggers list [--agent ] ``` List triggers in the active workspace. | Flag | Type | Description | | --------- | ------ | ------------------------------------------------- | | `--agent` | string | Show only triggers that target this managed agent | ## Get trigger [#get-trigger] ```bash dome triggers get [name-or-id] ``` Show a trigger's configuration, targets, state, concurrency limit, and schedule policy. This command has no command-specific flags. ## Update trigger [#update-trigger] ```bash dome triggers update [name-or-id] [flags] ``` Update only the fields supplied. `--target` replaces the target list; use `targets enable` or `targets disable` to change one target without replacing the others. | Flag | Type | Description | | --------------------- | --------- | ------------------------------------------------------------- | | `--name` | string | Rename the trigger | | `--description` | string | Replace the description | | `--cron` | string | Replace the schedule expression | | `--timezone` | string | Replace the schedule time zone | | `--input` | string | Replace the default run input | | `--target` | string\[] | Replace the target list; repeat for several targets | | `--clear-targets` | bool | Remove every target | | `--max-concurrent` | int | Replace the concurrency cap; `0` is unlimited | | `--catch-up` | string | Replace the missed-occurrence policy | | `--catch-up-deadline` | duration | Replace the missed-occurrence deadline | | `--max-retries` | int | Replace the infrastructure retry budget; `0` disables retries | | `--enabled` | bool | Switch the trigger on | | `--disabled` | bool | Switch the trigger off | The trigger kind cannot change. Delete the trigger and create another to switch between a schedule and webhook. ## Delete trigger [#delete-trigger] ```bash dome triggers delete [name-or-id] ``` Permanently delete a trigger and cancel its pending runs. This command has no command-specific flags. ## Fire trigger [#fire-trigger] ```bash dome triggers fire [name-or-id] --input "Review new issues." ``` Queue one run for every enabled target that can run now. | Flag | Type | Description | | --------- | ------ | ----------------------------------------------------------------------------------- | | `--input` | string | Optional first user message; overrides the trigger's configured input for this fire | ## List trigger runs [#list-trigger-runs] ```bash dome triggers runs [name-or-id] --limit 50 ``` List runs fired by a trigger, newest first. | Flag | Type | Description | | --------- | ---- | -------------------------------------------------- | | `--limit` | int | Maximum runs to return (default: 50; maximum: 200) | ## Enable target [#enable-target] ```bash dome triggers targets enable [trigger] [target] ``` Enable one managed-agent target without changing the trigger's other targets. The target can be a managed agent name, ID, or `managed_agent:`. This command has no command-specific flags. ## Disable target [#disable-target] ```bash dome triggers targets disable [trigger] [target] ``` Disable one managed-agent target without removing it from the trigger. Other enabled targets continue to run. This command has no command-specific flags. ## Permissions [#permissions] Reading triggers and their runs requires `managedagents.view`. Creating, updating, deleting, and changing targets requires `managedagents.manage`. Firing a trigger requires `managedagents.invoke`. # dome callers (/cli/connect/callers) `dome callers` reads the workspace Callers registry projected from audit evidence. Use it to inspect Act-As identities, verification methods, and attributed activity. Interactive MCP users are excluded. Their session identity is represented by an interactive grant, while this registry tracks customer end users carried through delegated Act-As. Entries appear here only for identities a provider verified. Refer to [`dome verification-providers`](/cli/connect/verification-providers) for the OIDC and HMAC providers that do that verifying. | Command | | | ------------------------------- | --------------------------------- | | [List callers](#list-callers) | `dome callers list` | | [Get caller](#get-caller) | `dome callers get ` | | [Delete caller](#delete-caller) | `dome callers delete ` | ## List callers [#list-callers] ```bash dome callers list ``` List callers in the active workspace. Requires `audit.view`. | Flag | Type | Description | | ------------- | ------ | ----------------------------------- | | `--search` | string | Substring match on subject or email | | `--group` | string | Exact group membership | | `--attribute` | string | Exact claim filter as `key=value` | | `--provider` | string | Verification provider ID | | `--page` | int | Zero-based page number | | `--page-size` | int | Page size; default 50, maximum 200 | The result reports lifetime LLM calls, tool calls, and LLM tokens. `METHODS` is the set of verification methods observed for that identity. ## Get caller [#get-caller] ```bash dome callers get ``` Get identity claims, verification history, attributed agents, and resource activity. Requires `audit.view`. Use the record UUID when the same subject appears under multiple verification providers. `--json` on the list command returns that UUID. Current-month blocks appear only when the caller was active during the current UTC calendar month. Lifetime totals remain available independently. ## Delete caller [#delete-caller] ```bash dome callers delete ``` Erase the projected caller record and its per-agent activity rows. Requires `config.manage`. The command prompts before erasure. Pass `--yes` for non-interactive use. ```bash dome callers delete {{CALLER_ID}} --yes ``` Erasure does not delete underlying audit evidence. Later traffic for the same identity recreates the caller record. # dome models (/cli/connect/models) `dome models` registers LLM upstreams the gateway proxies and groups them into routing pools that fan out across providers with priority, weighting, and failover. Supported upstreams: Anthropic, OpenAI, Azure OpenAI, Google, Bedrock, hosted OpenAI-compatible vendors (Groq, Mistral, Together, Fireworks, DeepSeek, xAI, Perplexity, Cohere, OpenRouter, Cerebras, NVIDIA, DeepInfra, SambaNova, AI21, Databricks), and self-hosted endpoints. | Command | | | ----------------------------------------------------- | -------------------------------------------------------------- | | [List connections](#list-connections) | `dome models list [workspace-id-or-slug]` | | [List providers](#list-providers) | `dome models providers` | | [model rates](#model-rates) | `dome models rates` | | [Get connection](#get-connection) | `dome models get ` | | [Add connection](#add-connection) | `dome models add ` | | [Update connection](#update-connection) | `dome models update ` | | [Inspect connection usage](#inspect-connection-usage) | `dome models usage ` | | [Remove connection](#remove-connection) | `dome models rm ` | | [Connect OAuth](#connect-oauth) | `dome models oauth-connect ` | | [Disconnect OAuth](#disconnect-oauth) | `dome models oauth-disconnect ` | | [Create pool](#create-pool) | `dome models pool create ` | | [List pools](#list-pools) | `dome models pool list [workspace-id-or-slug]` | | [Get pool](#get-pool) | `dome models pool get ` | | [Update pool](#update-pool) | `dome models pool update ` | | [Inspect pool usage](#inspect-pool-usage) | `dome models pool usage ` | | [Set default pool](#set-default-pool) | `dome models pool set-default ` | | [Move pool](#move-pool) | `dome models pool move --before \| --after ` | | [Remove pool](#remove-pool) | `dome models pool rm ` | | [gateway membership](#gateway-membership) | `dome models pool gateways list\|add\|remove [gateway]` | | [Add member](#add-member) | `dome models pool member add ` | | [List members](#list-members) | `dome models pool member list ` | | [Update member](#update-member) | `dome models pool member update ` | | [Remove member](#remove-member) | `dome models pool member rm ` | ## Model rates [#model-rates] ```bash dome models rates [--model ] ``` Show Dome's current model rate book and the byte-to-token conversion used when a provider returns no token usage. The default view requires authentication but no organization permission. It does not include the organization's negotiated provider rates. ```bash dome models rates --effective dome models rates --effective --model claude ``` `--effective` shows the rate card resolved for the active organization: its contract rates and explicit model associations layered over Dome's book. It requires the organization-scoped `modelrates.manage` permission, held by organization owners and admins by default. | Flag | Type | Default | Description | | ------------- | ------ | ------------------- | ----------------------------------------------------------------------------------- | | `--effective` | bool | `false` | Resolve the active organization's effective rate card; requires `modelrates.manage` | | `--model` | string | — | filter model-match strings by substring | | `--org-id` | string | active organization | Organization to resolve; used only with `--effective` | Rates are micro-USD per one million tokens. Every rate is time-windowed: historical usage is priced at the era covering its own time rather than today's rate. Provider cost is an estimate of the organization's upstream bill, not a Dome charge. When token counts are unavailable, the displayed byte-to-token formula explains the additional estimate Dome applies. Organization rate-card management is also available under this command: | Command | Behavior | Permission | | ---------------------------------------- | ----------------------------------------------------------------------------- | ------------------- | | `dome models rates set ` | Open a new rate era or associate a custom model with a Dome rate | `modelrates.manage` | | `dome models rates remove ` | Close the current era; history is retained unless `--discard-history` is used | `modelrates.manage` | | `dome models rates edit-era ` | Correct one existing era and its boundaries | `modelrates.manage` | | `dome models rates history ` | Show the winning rate across each historical time span | `modelrates.manage` | | `dome models rates suggest ` | Suggest possible Dome rate associations without binding one | Authentication only | ### Set an organization rate [#set-an-organization-rate] ```bash dome models rates set [flags] ``` Open a new pricing era. Supply literal rates or bind the model match to a Dome-owned rate with `--priced-as`. | Flag | Type | Description | | ------------------- | ------- | ---------------------------------------------------------------- | | `--input` | int64 | Micro-USD per million input tokens | | `--cache-read` | int64 | Micro-USD per million cache-read tokens | | `--cache-write` | int64 | Micro-USD per million cache-write tokens | | `--output` | int64 | Micro-USD per million output tokens | | `--priced-as` | string | Dome-owned model match whose rates this model follows | | `--name` | string | Rate label | | `--sort-order` | int32 | Precedence hint; lower values win over longer matches | | `--effective-from` | RFC3339 | Start of the pricing era; defaults to now | | `--effective-until` | RFC3339 | End of a closed historical era | | `--org-id` | string | Organization UUID; defaults to the active context's organization | ### Remove an organization rate [#remove-an-organization-rate] ```bash dome models rates remove dome models rates remove --era ``` By default, removal closes the current era and retains it for historical pricing. | Flag | Type | Description | | ------------------- | ------ | ------------------------------------------------------------------ | | `--discard-history` | bool | Delete the open era and reprice that period using Dome's rate book | | `--era` | string | Delete one specific historical era | | `--org-id` | string | Organization UUID | ### Edit a rate era [#edit-a-rate-era] ```bash dome models rates edit-era [flags] ``` Correct an existing era's rates, association, label, or boundaries. Omitted fields remain unchanged. | Flag | Type | Description | | ------------------- | ------- | ------------------------------------------------------------- | | `--input` | int64 | Corrected input rate | | `--cache-read` | int64 | Corrected cache-read rate | | `--cache-write` | int64 | Corrected cache-write rate | | `--output` | int64 | Corrected output rate | | `--priced-as` | string | New Dome-owned rate association; pass empty to clear | | `--name` | string | New label | | `--from` | RFC3339 | Corrected era start | | `--until` | RFC3339 | Corrected era end | | `--adjust-adjacent` | bool | Adjust an adjacent era when a moved boundary would overlap it | | `--org-id` | string | Organization UUID | ### Show rate history [#show-rate-history] ```bash dome models rates history [--org-id ] ``` Show the rate that wins for each historical time span and the source of that rate. ### Suggest a rate association [#suggest-a-rate-association] ```bash dome models rates suggest ``` Rank Dome-owned rate matches for a custom model. This command does not create an association. > **Warning**: `--discard-history` is irreversible. The discarded period is re-priced using Dome's rate book. ## Connections [#connections] ### List connections [#list-connections] ```bash dome models list [workspace-id-or-slug] ``` List LLM models in the workspace. Aliases: `ls`. ### List providers [#list-providers] ```bash dome models providers ``` List the supported provider catalog and each provider's curated model ids. Use it to discover valid `--provider` and `--model` values for `dome models add`. The catalog is backend-owned — the same source the dashboard Provider→model picker and the MCP `dome_models_providers` tool read. Providers with stable public model ids (OpenAI, Anthropic, Google) carry a curated model list with one default. Other providers show an empty list and accept any model string the upstream accepts. The catalog is a convenience, not authoritative — a model your upstream supports but the catalog does not list is still valid. ```bash title="List providers and known models" dome models providers ``` ```bash title="Pick the curated default and pipe into add" dome models add claude-prod \ --provider anthropic \ --model "$(dome models providers --format json | jq -r '.providers[] | select(.provider=="anthropic") | .models[] | select(.default) | .id')" \ --api-key "$ANTHROPIC_API_KEY" ``` ### Get connection [#get-connection] ```bash dome models get ``` Show details for one model, including provider config and Cedar attributes. ### Add connection [#add-connection] ```bash dome models add ``` Register an LLM model upstream. The shared API key, when supplied, is stored under the provider's managed auth header — `Authorization: Bearer …` for OpenAI, Bedrock, and OpenAI-compatible hosted vendors; `x-api-key` for Anthropic; `api-key` for Azure OpenAI; `x-goog-api-key` for Google. When `--endpoint` is omitted, the CLI prefills the vendor's default base URL from the provider registry. | Flag | Type | Required | Default | Description | | ------------------------ | ------------------- | -------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `--provider` | string | Yes | — | `openai`, `anthropic`, `google`, `bedrock`, `azure_openai`, `mistral`, `groq`, `together`, `fireworks`, `deepseek`, `xai`, `perplexity`, `cohere`, `openrouter`, `cerebras`, `nvidia`, `deepinfra`, `sambanova`, `ai21`, `databricks`, `openai_compatible`, `custom`. Refer to [Supported providers](/reference/resources/models#providers) reference. | | `--model` | string | No | — | model id (e.g. `gpt-4o-mini`, `claude-3-5-sonnet-20241022`) | | `--endpoint` | string | No | registry default | Provider endpoint URL. Required for `azure_openai`, `bedrock`, `databricks`, `openai_compatible`, and `custom`. | | `--auth-method` | string | No | `api-key` | `none`, `api-key`, `oauth` | | `--credential-type` | string | No | `shared` | `none`, `shared`, `per-user` | | `--api-key` | string | No | — | API key (use with `--auth-method=api-key --credential-type=shared`) | | `--provider-config` | JSON | No | — | Full `provider_config` as JSON; merges with `--model`/`--endpoint` | | `--attributes` | JSON | No | — | Cedar attributes as JSON object | | `--filter-window-bytes` | uint32 | No | `0` | Outbound filter window in bytes for this connection. `0` inherits the workspace floor; the engine takes the max of workspace, connection, and per-request. | | `--filter-window-tokens` | uint32 | No | `0` | Outbound filter window in tokens for this connection. `0` inherits the workspace floor. | | `--gateway` | string (repeatable) | No | — | Attach directly to the named [Gateway](/build/gateways) (name or ID). Without it the model is unreachable until attached. | ```bash title="Anthropic shared API key" dome models add claude-sonnet \ --provider anthropic \ --model claude-3-5-sonnet-20241022 \ --api-key "$ANTHROPIC_API_KEY" ``` ```bash title="Groq (endpoint prefilled from registry)" dome models add fast-groq \ --provider groq \ --model llama-3.3-70b-versatile \ --api-key "$GROQ_API_KEY" ``` ```bash title="Azure OpenAI" dome models add gpt-4o \ --provider azure_openai \ --model gpt-4o \ --endpoint https://my-resource.openai.azure.com \ --api-key "$AZURE_OPENAI_KEY" \ --provider-config '{"api_version":"2024-08-01-preview","deployment":"gpt-4o-prod"}' ``` ### Update connection [#update-connection] ```bash dome models update ``` Update a model. Only provided flags change. Provider is immutable post-create — switch by adding a new connection. When `--name` renames a model, managed agents configured to run on it follow the new name. | Flag | Type | Description | | ------------------------ | ------ | ---------------------------------------------------------------------------------------- | | `--name` | string | New connection name | | `--model` | string | New model id | | `--endpoint` | string | New endpoint URL | | `--auth-method` | string | New auth method | | `--credential-type` | string | New credential scope | | `--api-key` | string | Replace the shared API key | | `--provider-config` | JSON | Replace `provider_config` wholesale | | `--attributes` | JSON | Replace Cedar attributes (pass `'{}'` to clear) | | `--filter-window-bytes` | uint32 | Per-connection outbound filter window in bytes. `0` clears back to the workspace floor. | | `--filter-window-tokens` | uint32 | Per-connection outbound filter window in tokens. `0` clears back to the workspace floor. | ### Inspect connection usage [#inspect-connection-usage] ```bash dome models usage ``` Show managed agents configured to run on the model, agents granted it, gateways that expose it, and pools that contain it. The command requires `gateways.view`; agent names can be omitted when you cannot view that type of agent. Run it before deleting or renaming a model. ### Remove connection [#remove-connection] ```bash dome models rm ``` Remove an LLM model. Aliases: `remove`, `delete`. When dependents exist, the CLI displays their impact and asks for confirmation in an interactive terminal. | Flag | Type | Description | | --------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | | `--reassign-to` | string | Replacement model connection or pool. Moves managed agents configured for the deleted model and grants the replacement to agents that held it. | | `--yes` | bool | Skip the interactive confirmation. | Without `--reassign-to`, managed agents configured to run on the model cannot run and agents with no other model grant lose model access. ## OAuth [#oauth] ### Connect OAuth [#connect-oauth] ```bash dome models oauth-connect ``` Begin the shared-OAuth admin consent flow for a model configured with `--auth-method=oauth --credential-type=shared`: Anthropic OAuth, Azure AAD/Entra service principal, Google Workload Identity for Vertex. Prints a one-shot URL valid for \~10 minutes. Open it in a browser to complete consent — Dome stores the tokens on the callback. Per-user OAuth models do not use this command; consent is gateway-triggered on each end user's first call. ### Disconnect OAuth [#disconnect-oauth] ```bash dome models oauth-disconnect ``` Revoke shared OAuth credentials. The OAuth client configuration is preserved, so a subsequent `oauth-connect` reuses the same client. Idempotent. ## Pools [#pools] ### Create pool [#create-pool] ```bash dome models pool create ``` Create a logical pool that fans out across one or more model connections. | Flag | Type | Default | Description | | -------------------- | ------------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--description` | string | — | Pool description | | `--match-when` | JSON | — | Predicate selecting this pool by request shape (e.g. `'{"prompt_tokens":{"gt":100000}}'`). Refer to [match\_when predicates](/reference/resources/model-pools#pool-resolution) reference. | | `--default` | bool | `false` | Mark as workspace default (or use [`set-default`](#set-default-pool) later) | | `--cache-ttl-secs` | int32 | `0` | Exact-match cache TTL (`0` disables) | | `--cache-scope` | string | `workspace` | `workspace` or `caller` | | `--routing-strategy` | string | `priority_weighted` | `priority_weighted`, `round_robin`, `least_loaded`, `most_quota_remaining`. Refer to [Routing strategies](/reference/resources/model-pools#routing-strategies) reference. | | `--strategy-scope` | string | `workspace` | Scope of stateful routing counters: `workspace` or `caller`. Ignored by `priority_weighted`. Scopes only the tiebreak for `most_quota_remaining`. | | `--failover-max` | string | `all` | Failover ceiling. `all` walks every member; integer `N` gives primary + N retries (`0` disables failover). | | `--gateway` | string (repeatable) | — | Attach to the named [Gateway](/build/gateways) (name or ID). Without it the pool is unreachable until attached. | ```bash title="Pool with two providers and weighted distribution" dome models pool create default --failover-max 2 dome models pool member add default claude-sonnet --priority 0 --weight 3 dome models pool member add default gpt-4o --priority 0 --weight 1 dome models pool member add default claude-haiku --priority 1 dome models pool set-default default # Drain the highest-headroom member first when members carry different spend caps dome models pool create budget-aware \ --routing-strategy most_quota_remaining ``` ### List pools [#list-pools] ```bash dome models pool list [workspace-id-or-slug] ``` List pools. Aliases: `ls`. ### Get pool [#get-pool] ```bash dome models pool get ``` Show pool config and its members. ### Update pool [#update-pool] ```bash dome models pool update ``` Update a pool. Only provided flags change. Pass `--match-when '{}'` to clear the match predicate. When `--name` renames a pool, managed agents configured to run on it follow the new name. | Flag | Type | Description | | -------------------- | ------ | ------------------------------------------------------------------------------- | | `--name` | string | Rename the pool | | `--description` | string | New description | | `--match-when` | JSON | Replace match predicate (pass `'{}'` to clear) | | `--cache-ttl-secs` | int32 | New cache TTL (`0` disables) | | `--cache-scope` | string | New cache scope | | `--routing-strategy` | string | `priority_weighted`, `round_robin`, `least_loaded`, or `most_quota_remaining` | | `--strategy-scope` | string | `workspace` or `caller` | | `--failover-max` | string | `all` (walk every member) or non-negative integer `N`. Omit to leave unchanged. | ### Set default pool [#set-default-pool] ```bash dome models pool set-default ``` Mark this pool as the workspace default. Replaces any prior default. ### Move pool [#move-pool] ```bash dome models pool move --before # or --after ``` Reposition a pool in its workspace's `match_when` evaluation order. Pools with non-empty predicates evaluate in ascending `sort_key`; the first match wins. Refer to [Pool order](/reference/resources/model-pools#pool-resolution) reference. | Flag | Type | Description | | ---------- | ------ | ------------------------------------------------------------ | | `--before` | string | Anchor pool name; the moved pool lands immediately before it | | `--after` | string | Anchor pool name; the moved pool lands immediately after it | Exactly one of `--before` or `--after` is required. ### Inspect pool usage [#inspect-pool-usage] ```bash dome models pool usage ``` Show managed agents configured to run on the pool, agents granted it, and gateways that expose it. The command requires `gateways.view`; agent names can be omitted when you cannot view that type of agent. Run it before deleting or renaming a pool. ### Remove pool [#remove-pool] ```bash dome models pool rm ``` Remove a pool. Aliases: `remove`, `delete`. When dependents exist, the CLI displays their impact and asks for confirmation in an interactive terminal. | Flag | Type | Description | | --------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------- | | `--reassign-to` | string | Replacement model connection or pool. Moves managed agents configured for the deleted pool and grants the replacement to agents that held it. | | `--yes` | bool | Skip the interactive confirmation. | Without `--reassign-to`, managed agents configured to run on the pool cannot run and agents with no other model grant lose model access. ### Gateway membership [#gateway-membership] ```bash dome models pool gateways [gateway-name-or-id] ``` Manage the pool's membership in [Gateways](/build/gateways) from the pool side. Mirrors [`dome gateways model-pools`](/cli/build/gateway#add-model-pool). * `list ` — gateways this pool belongs to. Alias: `ls`. * `add ` — expose the pool's models at the gateway's `/gateways//v1` endpoint. * `remove ` — detach. Alias: `rm`. ## Pool members [#pool-members] ### Add member [#add-member] ```bash dome models pool member add ``` Add a model to a pool. Failover walks ascending priority; within a bucket, requests distribute by weight. | Flag | Type | Default | Description | | ------------ | ----- | ------- | -------------------------------------------------- | | `--priority` | int32 | `0` | Priority (`0` = primary; failover walks ascending) | | `--weight` | int32 | `1` | Weight within the priority bucket | | `--enabled` | bool | `true` | Whether the member is included in routing | ### List members [#list-members] ```bash dome models pool member list ``` List members of a pool with priority, weight, and enabled state. Aliases: `ls`. ### Update member [#update-member] ```bash dome models pool member update ``` Update a member's priority, weight, or enabled flag. | Flag | Type | Description | | ------------ | ----- | ---------------- | | `--priority` | int32 | New priority | | `--weight` | int32 | New weight | | `--enabled` | bool | New enabled flag | ### Remove member [#remove-member] ```bash dome models pool member rm ``` Remove a member from a pool. Aliases: `remove`, `delete`. Cap model spend, tokens, or calls with [`dome quotas`](/cli/govern/quota). Use `--subject model`, `--subject pool`, `--subject workspace`, or `--subject gateway` as needed. # dome tools (/cli/connect/tools) `dome tools` registers upstream MCP servers (the "tools" an agent reaches through Dome) and manages their auth, outbound headers, and field classifications. To list which tools each agent may call, use [`dome agents list`](/cli/build/agents#list-agents) instead. | Command | | | ----------------------------------------- | -------------------------------------------------------------- | | [List connections](#list-connections) | `dome tools list [workspace-id-or-slug]` | | [Get connection](#get-connection) | `dome tools get [workspace-id-or-slug]` | | [Add connection](#add-connection) | `dome tools add [workspace-id-or-slug]` | | [Update connection](#update-connection) | `dome tools update [workspace-id-or-slug]` | | [Remove connection](#remove-connection) | `dome tools remove [workspace-id-or-slug]` | | [Connect OAuth](#connect-oauth) | `dome tools oauth-connect [workspace-id-or-slug]` | | [Disconnect OAuth](#disconnect-oauth) | `dome tools oauth-disconnect [workspace-id-or-slug]` | | [gateway membership](#gateway-membership) | `dome tools gateways list\|add\|remove [gateway]` | | [List headers](#list-headers) | `dome tools header list ` | | [Add header](#add-header) | `dome tools header add ` | | [Remove header](#remove-header) | `dome tools header remove ` | | [List tools](#list-tools) | `dome tools catalog list [workspace-id-or-slug]` | | [Sync tools](#sync-tools) | `dome tools catalog sync [workspace-id-or-slug]` | | [Block tool](#block-tool) | `dome tools catalog block ` | | [Deprecate tool](#deprecate-tool) | `dome tools catalog deprecate ` | | [Restore tool](#restore-tool) | `dome tools catalog restore ` | ## Connections [#connections] ### List connections [#list-connections] ```bash dome tools list [workspace-id-or-slug] ``` List MCP server connections. Aliases: `ls`. ### Get connection [#get-connection] ```bash dome tools get [workspace-id-or-slug] ``` Show details for one tool connection. ### Add connection [#add-connection] ```bash dome tools add [workspace-id-or-slug] ``` Register a new MCP server. | Flag | Type | Required | Default | Description | | ----------------------------- | ----------------------------- | ---------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--name` | string | Yes | — | tool name (unique within workspace) | | `--url` | string | Streamable | — | URL (required for `streamable-http`) | | `--command` | string | Stdio | — | Command to exec (required for `stdio`) | | `--arg` | string (repeatable) | No | — | Command argument for `stdio` | | `--protocol` | string | No | `streamable-http` | `streamable-http`, `stdio` | | `--header-literal` | `Name=Value` (repeatable) | No | — | Literal outbound header | | `--header-secret` | `Name=SecretKey` (repeatable) | No | — | Outbound header sourced from a stored secret | | `--header-actas` | `Name` (repeatable) | No | — | Header that reinjects the verified `X-Dome-Act-As` | | `--authorization` | string | No | — | `Authorization` HTTP header value. REQUIRED with `--auth-method=api-key --credential-type=shared`. The server auto-injects the managed `Authorization` header — do not declare it via `--header-secret`. | | `--secret-value` | `KEY=VALUE` (repeatable) | No | — | Advanced: per-tool credential bundle entry for custom secret-source headers. The `Authorization` key is reserved — use `--authorization` instead. | | `--auth-method` | string | No | `none` | `none`, `api-key`, `oauth` | | `--credential-type` | string | No | — | `shared`, `per-user` | | `--oauth-authorize-url` | string | No | — | OAuth: authorize endpoint | | `--oauth-token-url` | string | No | — | OAuth: token endpoint | | `--oauth-revoke-url` | string | No | — | OAuth: revocation endpoint | | `--oauth-registration-url` | string | No | — | OAuth: RFC 7591 registration endpoint (for `client-origin=dcr`) | | `--oauth-client-id` | string | No | — | OAuth: client ID (required when `client-origin=manual`) | | `--oauth-client-secret` | string | No | — | OAuth: client secret | | `--oauth-default-scope` | string (repeatable) | No | — | OAuth: default scope | | `--oauth-client-origin` | string | No | — | OAuth: `dcr` or `manual` | | `--oauth-token-endpoint-auth` | string | No | `auto` | OAuth: `auto`, `client_secret_basic`, `client_secret_post`. `auto` discovers the server's preferred method via RFC 8414 metadata. | | `--field-classification` | `key=value` | No | — | Field sensitivity labels (e.g. `email=PII,phone=PII`) | | `--write-tools` | string | No | — | Comma-separated list of tool names classified as write operations | | `--gateway` | string (repeatable) | No | — | Attach as a tool source to the named [Gateway](/build/gateways) (name or ID). Without it the connection is unreachable until attached. | When `--auth-method=oauth --credential-type=shared`, `add` automatically prints the URL to start the admin consent flow. Open it in a browser to complete consent. If the flow can't start automatically, run [`oauth-connect`](#connect-oauth) afterwards. ```bash title="Shared OAuth tool (manual client)" dome tools add \ --name notion \ --url https://mcp.notion.com/mcp \ --auth-method oauth \ --credential-type shared \ --oauth-client-origin manual \ --oauth-authorize-url https://api.notion.com/v1/oauth/authorize \ --oauth-token-url https://api.notion.com/v1/oauth/token \ --oauth-client-id "$NOTION_CLIENT_ID" \ --oauth-client-secret "$NOTION_CLIENT_SECRET" \ --oauth-default-scope read_content \ --oauth-default-scope update_content ``` ```bash title="Per-user OAuth tool (dynamic client registration)" dome tools add \ --name jira \ --url https://mcp.atlassian.com/v1/sse \ --auth-method oauth \ --credential-type per-user \ --oauth-client-origin dcr \ --oauth-authorize-url https://auth.atlassian.com/authorize \ --oauth-token-url https://auth.atlassian.com/oauth/token \ --oauth-registration-url https://auth.atlassian.com/oauth/clients ``` ### Update connection [#update-connection] ```bash dome tools update [workspace-id-or-slug] ``` Update an MCP server connection. Only provided flags change. Switching `--auth-method` between `api-key` and `oauth` clears the previously stored credential bundle. | Flag | Type | Description | | ------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------- | | `--url` | string | New URL | | `--command` | string | New command (stdio) | | `--arg` | string (repeatable) | Replace command args | | `--protocol` | string | `streamable-http`, `stdio` | | `--header-literal` | `Name=Value` (repeatable) | Replace literal-header list | | `--header-secret` | `Name=SecretKey` (repeatable) | Replace secret-header list | | `--header-actas` | `Name` (repeatable) | Replace act-as header list | | `--authorization` | string | New `Authorization` value. Use to rotate an `api-key`+`shared` tool's token. | | `--secret-value` | `KEY=VALUE` (repeatable) | Advanced: replace per-tool credential bundle | | `--auth-method` | string | `none`, `api-key`, `oauth` | | `--credential-type` | string | `shared`, `per-user` | | `--oauth-*` | various | OAuth client config overrides (same shape as `add`). Empty `--oauth-client-secret` keeps the existing secret. | | `--field-classification` | `key=value` | Add or update field classifications | | `--remove-field-classification` | string\[] | Remove field classifications by name | | `--write-tools` | string | Comma-separated write-tools list (replaces current) | ### Remove connection [#remove-connection] ```bash dome tools remove [workspace-id-or-slug] ``` Remove an MCP server connection. ### Gateway membership [#gateway-membership] ```bash dome tools gateways [gateway-name-or-id] ``` Manage the connection's tool-source membership in [Gateways](/build/gateways) from the connection side. Mirrors [`dome gateways tool-sources`](/cli/build/gateway#add-tool-source). * `list ` — gateways this connection is a tool source of. Alias: `ls`. * `add ` — attach as a tool source; every observed tool joins, and newly discovered tools propagate automatically. * `remove ` — detach. Alias: `rm`. ```bash dome tools gateways add notion prod-tools ``` ## OAuth [#oauth] ### Connect OAuth [#connect-oauth] ```bash dome tools oauth-connect [workspace-id-or-slug] ``` Begin the shared-OAuth admin consent flow. Prints a one-shot URL valid for \~10 minutes. Open it in a browser to complete consent at the upstream's authorization server. After consent, Dome stores the tokens. Only valid for `--auth-method=oauth --credential-type=shared` tools. Per-user OAuth tools trigger consent automatically on each end user's first call. ```bash dome tools oauth-connect notion ``` ### Disconnect OAuth [#disconnect-oauth] ```bash dome tools oauth-disconnect [workspace-id-or-slug] ``` Revoke shared OAuth credentials. The OAuth client configuration is preserved, so a subsequent `oauth-connect` reuses the same client. Idempotent. ```bash dome tools oauth-disconnect notion ``` ## Headers [#headers] ### List headers [#list-headers] ```bash dome tools header list [workspace-id-or-slug] ``` List the outbound headers configured on a tool. ### Add header [#add-header] ```bash dome tools header add [workspace-id-or-slug] ``` Append outbound headers to a tool without replacing the existing list. Combine `--header-literal`, `--header-secret`, and `--header-actas` flags (refer to [`add`](#add-connection) for shapes). ### Remove header [#remove-header] ```bash dome tools header remove [workspace-id-or-slug] ``` Remove outbound headers by name from a tool. ## Catalog [#catalog] ### List tools [#list-tools] ```bash dome tools catalog list [workspace-id-or-slug] ``` List the persistent MCP tool catalog for a connection — the tools the gateway has observed on the upstream MCP server. The catalog survives gateway restarts and stays queryable without a live data plane. | Flag | | | ---------------- | -------------------------------------------------------------------------------------------------------------------- | | `--with-schema` | Include input schema in the output (truncated). | | `--seen-since` | Only include tools seen within this window (e.g. `30d`, `24h`). Pass `0` for all-time. Defaults to `720h` (30 days). | | `--show-blocked` | Include blocked tools (hidden by default). | ```bash dome tools catalog list notion --seen-since 7d ``` ### Sync tools [#sync-tools] ```bash dome tools catalog sync [workspace-id-or-slug] ``` Sync the persistent MCP tool catalog for a `per-user` connection by dispatching exactly one upstream `tools/list` against the calling admin's own per-user credential. Shared connections already pre-warm via the gateway's startup discovery and are rejected client-side. Attach your per-user credential first through the normal magic-link flow (refer to [`oauth-connect`](#connect-oauth) or the per-user provisioning flow in the dashboard), then run this command. Sync works both before any agent traffic (pre-warm) and after (refresh). The result is recorded through the shared catalog observation path and is visible to `dome tools catalog list` immediately afterwards. | Flag | | | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--act-as-sub` | Workspace-verified act-as subject under which the admin attached the per-user credential. Defaults to the calling admin's email. Required when the workspace's act-as verifier does not use email as Sub (e.g. OIDC/HMAC verifiers issuing opaque subs, or `local-auth` which sets Sub to a user UUID). | ```bash dome tools catalog sync notion ``` Prints four counters: tools observed, inserted, updated schema, and updated last-seen. Requires the `gateways.manage` permission. Returns `FailedPrecondition` when no per-user credential exists at the resolved sub-hash — the error message names both remedies (attach the credential, or pass `--act-as-sub`). ### Block tool [#block-tool] ```bash dome tools catalog block ``` Hide a discovered MCP tool from agents. The gateway filters the tool out of `tools/list` and denies any `tools/call` against it. A block takes precedence over ordinary connection-level access. Blocks persist across re-observation. | Flag | Type | Required | Description | | ----------- | ------ | -------- | --------------------------------------------------------------------------------------------- | | `--message` | string | No | Operator note shown alongside the tool in dashboards and CLI (e.g. `"dangerous mass-delete"`) | Requires the `gateways.manage` permission. Blocked-call attempts emit a `tool.blocked_call_denied` audit event. ```bash dome tools catalog block notion delete_page --message "dangerous mass-delete; use archive_page" ``` ### Deprecate tool [#deprecate-tool] ```bash dome tools catalog deprecate ``` Mark a tool as deprecated. The tool stays callable and visible to agents; the dashboard renders a warning chip and operators see the status in `dome tools catalog list`. Use when an upstream replaces a tool and you want to soft-signal callers without breaking them. | Flag | Type | Required | Description | | ----------- | ------ | -------- | ------------------------------------------- | | `--message` | string | No | Operator note (e.g. `"use create_page_v2"`) | Requires the `gateways.manage` permission. ```bash dome tools catalog deprecate notion create_page --message "use create_page_v2" ``` ### Restore tool [#restore-tool] ```bash dome tools catalog restore ``` Return a tool to `active`, clearing any prior block or deprecation. Requires the `gateways.manage` permission. ```bash dome tools catalog restore notion delete_page ``` > **Tip**: `dome tools catalog list ` shows the current `STATUS` column for every observed tool. Blocked tools are hidden by default — pass `--show-blocked` to include them. Cap tool spend or call volume with [`dome quotas`](/cli/govern/quota) (`--subject tool`, `--subject agent`, or `--subject workspace`). # dome verification-providers (/cli/connect/verification-providers) `dome verification-providers` manages the named OIDC and HMAC configurations Dome verifies an Act-As assertion against. An agent bound to a provider may act for a person, and the gateway checks every such call against that provider before authorizing it. Set up alongside [`dome callers`](/cli/connect/callers): providers are what you configure, callers are the end users those providers turned out to verify. | Command | | | ----------------------------------------------------- | -------------------------------------------------- | | [List providers](#list-providers) | `dome verification-providers list` | | [Get provider](#get-provider) | `dome verification-providers get ` | | [Create provider](#create-provider) | `dome verification-providers create` | | [Update provider](#update-provider) | `dome verification-providers update ` | | [Delete provider](#delete-provider) | `dome verification-providers delete ` | | [Get workspace selection](#workspace-act-as) | `dome workspaces actas get` | | [Update workspace selection](#workspace-act-as) | `dome workspaces actas update` | | [Get tenant selection](#tenant-act-as) | `dome tenant actas get` | | [Update tenant selection](#tenant-act-as) | `dome tenant actas update` | | [Get organization selection](#organization-act-as) | `dome orgs actas get` | | [Update organization selection](#organization-act-as) | `dome orgs actas update` | Every command requires `config.manage` at the target scope, and the CLI hides them when the active context does not carry it. Alias: `list` = `ls`. > **Note**: These commands configure runtime Act-As only. Signing operators into Dome is [`dome auth login`](/cli/session/auth) and the SSO connection under **Settings → Single Sign-On**. ## Scope [#scope] Reads accept `--scope workspace` (default), `tenant`, or `org`. Writes are workspace-only: organization providers are synchronized from the dashboard SSO connection, and tenant-scoped writes are not exposed yet. | Value | Target | Needs | | --------------------- | ------------------------ | ---------------------------------------- | | `workspace` (default) | Active workspace | An active workspace context | | `tenant` | Active tenant | An active tenant context | | `org` | Caller's org, or `--org` | An org on the active context, or `--org` | A provider is visible to every workspace beneath the scope that owns it. That visible set is what an agent binding or a scope selection may name. Setting up SSO can leave you a provider you did not create: when the issuer is available, the connection also creates a matching org-scoped OIDC provider, and Act-As can reuse it. `dome workspaces verification-providers` is a workspace-only convenience subset (`list` / `create` / `delete`), documented on [`dome workspaces`](/cli/settings/workspace#verification-providers). Prefer the scope-aware group here for reads, updates, and HMAC secret generation. ## Act-As provider selection [#act-as-provider-selection] Creating a provider makes it available at its scope. The Act-As commands select which available provider agents use by default or must use. * **Default provider:** the nearest configured scope wins: workspace, then tenant, then organization. * **Required provider:** the broadest configured scope wins: organization, then tenant, then workspace. It forces Act-As and pins every non-bound agent beneath that scope to the selected provider. All three `update` commands use full-replace semantics. The resulting selection contains exactly the provider flags you pass; omitting a provider flag clears that field. ### Workspace Act-As [#workspace-act-as] ```bash dome workspaces actas get [workspace-id-or-slug] dome workspaces actas update [workspace-id-or-slug] ``` Get or update the Act-As policy and provider selection for a workspace. The workspace defaults to the active context. | Flag | Type | Description | | --------------------- | --------- | ----------------------------------------------------- | | `--required` | bool | Require Act-As on all requests | | `--allowed-methods` | string\[] | Allowed verification methods: `oidc`, `hmac`, or both | | `--default-provider` | string | Default provider UUID | | `--required-provider` | string | Required provider UUID | Workspace updates replace the complete policy. Omitted flags clear provider selections and allowed methods; omitting `--required` sets it to `false`. Pass the full intended state each time. Refer to [`dome workspaces`](/cli/settings/workspace#act-as) for the complete workspace command reference. ### Tenant Act-As [#tenant-act-as] ```bash dome tenant actas get dome tenant actas update \ --default-provider {{PROVIDER_ID}} \ --required-provider {{PROVIDER_ID}} ``` Get or update the provider selection for a tenant. The provider must be owned by that tenant or its organization. | Flag | Command | Type | Description | | --------------------- | --------------- | ------ | ---------------------------------------------------- | | `--tenant` | `get`, `update` | string | Tenant UUID. Defaults to the active context's tenant | | `--default-provider` | `update` | string | Default provider UUID | | `--required-provider` | `update` | string | Required provider UUID | Tenant scope does not set `--required` or `--allowed-methods`. A required provider itself forces Act-As for non-bound agents beneath the tenant. Refer to [`dome tenant`](/cli/settings/tenant) for the dedicated command-group reference. ### Organization Act-As [#organization-act-as] ```bash dome orgs actas get dome orgs actas update \ --default-provider {{PROVIDER_ID}} \ --required-provider {{PROVIDER_ID}} ``` Get or update the provider selection for an organization. The provider must be owned by that organization. | Flag | Command | Type | Description | | --------------------- | --------------- | ------ | ---------------------------------------------------------------- | | `--org` | `get`, `update` | string | Organization UUID. Defaults to the active context's organization | | `--default-provider` | `update` | string | Default provider UUID | | `--required-provider` | `update` | string | Required provider UUID | An organization-level required provider applies to every non-bound agent in the organization and overrides required selections at tenant or workspace scope. Refer to [`dome orgs`](/cli/settings/org) for the dedicated command-group reference. ## List providers [#list-providers] ```bash dome verification-providers list ``` List providers at a scope. Columns are `ID`, `NAME`, `METHOD`, `SCOPE`, and `CREATED`; pass `--json` for the raw response. | Flag | Type | Required | Description | | ----------------- | ------ | -------- | --------------------------------------------------------------------------------------------- | | `--scope` | string | No | `workspace` (default), `tenant`, or `org` | | `--org` | string | No | Org UUID for `--scope org`. Defaults to the active context's org | | `--include-chain` | bool | No | Workspace scope only: also list the tenant- and org-scoped providers visible to the workspace | ```bash title="Workspace providers plus the inherited chain" dome verification-providers list --scope workspace --include-chain ``` ```bash title="Tenant- or org-owned providers" dome verification-providers list --scope tenant dome verification-providers list --scope org ``` ## Get provider [#get-provider] ```bash dome verification-providers get ``` Get one provider at its owning scope. Output covers method, scope, org, tenant and workspace IDs, the OIDC discovery URL, and `HMAC Configured` as `true` or `false`. The HMAC secret is never returned. | Argument / Flag | Type | Required | Description | | --------------- | ------ | -------- | ----------------------------------------- | | `` | string | Yes | Provider UUID | | `--scope` | string | No | `workspace` (default), `tenant`, or `org` | | `--org` | string | No | Org UUID for `--scope org` | ## Create provider [#create-provider] ```bash dome verification-providers create ``` Create a provider in the active workspace. | Flag | Type | Required | Description | | ------------------- | ------ | ----------- | ---------------------------------------------------------------------------------------------------- | | `--name` | string | Yes | Provider name, unique within its scope | | `--method` | string | Yes | `oidc` or `hmac` | | `--oidc-url` | string | Conditional | OIDC issuer base URL, required for `--method oidc`. Dome appends `/.well-known/openid-configuration` | | `--hmac-secret` | string | Conditional | HMAC shared secret. Alternative to `--generate-secret` | | `--generate-secret` | bool | Conditional | Have the server mint the HMAC secret. Mutually exclusive with `--hmac-secret` | | `--scope` | string | No | Must be `workspace`; `tenant` and `org` are refused client-side | ```bash title="OIDC" dome verification-providers create \ --name google-workspace \ --method oidc \ --oidc-url https://accounts.google.com ``` ```bash title="HMAC with a secret you supply" dome verification-providers create \ --name internal-signer \ --method hmac \ --hmac-secret "$HMAC_SECRET" ``` ```bash title="HMAC with a server-minted secret" dome verification-providers create \ --name internal-signer \ --method hmac \ --generate-secret ``` `--generate-secret` prints the plaintext **once** and it is never retrievable again. With `--json`, the payload is `{provider, secret_ref, secret_plaintext}` — store `secret_plaintext` immediately. > **Warning**: `--scope tenant` fails with `tenant-scoped verification providers aren't available yet`. `--scope org` fails with guidance to **Settings → Single Sign-On**. ## Update provider [#update-provider] ```bash dome verification-providers update ``` Update a workspace-scoped provider. Only the flags you pass change, and the method is immutable. | Argument / Flag | Type | Required | Description | | --------------- | ------ | -------- | ------------------------------------------------------ | | `` | string | Yes | Provider UUID | | `--name` | string | No | New provider name | | `--oidc-url` | string | No | New OIDC issuer base URL, for OIDC providers | | `--hmac-secret` | string | No | New HMAC shared secret, for HMAC providers. Write-only | | `--scope` | string | No | Must be `workspace` | ## Delete provider [#delete-provider] ```bash dome verification-providers delete ``` Delete a workspace-scoped provider. | Argument / Flag | Type | Required | Description | | --------------- | ------ | -------- | ------------------- | | `` | string | Yes | Provider UUID | | `--scope` | string | No | Must be `workspace` | Agents and scope selections that named the provider lose that binding and fail closed at the gateway until another provider resolves. Refer to [Delegated agents](/build/agents/delegated) for how a binding resolves. # dome quickstart (/cli/developer/quickstart-cmd) `dome quickstart` scaffolds a project that is already wired to Dome — SDK integration, starter authorization rules, and configuration — so your first governed call works without assembling it by hand. The project targets whichever environment your active context selects; refer to [Environments](/manage/environments) for how to point it elsewhere. ## Scaffold a project [#scaffold-a-project] ```bash dome quickstart [name] ``` Creates a new project directory with Dome SDK integration, starter rules, and configuration. ```bash dome quickstart my-agent-project ``` | Flag | Type | Default | Description | | ------------------- | ------ | ------- | ---------------------------------- | | `--language` | string | `go` | Project language (supported: `go`) | | `--non-interactive` | bool | false | Skip confirmation prompts | ### Generated files [#generated-files] | File | Description | | -------------- | ------------------------------------- | | `main.go` | Entry point with Dome SDK integration | | `go.mod` | Go module definition | | `dome.yaml` | Dome configuration | | `.env.example` | Environment variable template | | `Dockerfile` | Container build definition | | `rules.cedar` | Starter authorization rules | # dome escalations (/cli/govern/escalations) Manage [escalation workflows](/govern/escalations) and resolve review judgments from the CLI. Each configuration change publishes a new active version and preserves history. > **Note**: All commands use the active workspace. `escalations.view` reads workflows and judgments. `escalations.manage` changes workflows. `escalations.resolve` resolves judgments. ## Manage workflows [#manage-workflows] | Command | Description | | -------------------------------------- | ------------------------------------------------------ | | `dome escalations list` | List active workflows in the workspace. | | `dome escalations get ` | Show a workflow's active configuration. | | `dome escalations create ` | Create a workflow and its first active version. | | `dome escalations update ` | Change metadata or publish a new active configuration. | | `dome escalations delete ` | Delete a workflow and its version history. | ### List workflows [#list-workflows] ```bash dome escalations list ``` | Flag | Type | Default | Description | | -------------- | ------ | ------- | ---------------------------------------- | | `--limit` | int | `10` | Maximum workflows to return, up to `50`. | | `--page-token` | string | — | Cursor from the previous response. | ### Create a workflow [#create-a-workflow] ```bash dome escalations create high-risk-review \ --description "Require approval for high-risk tool calls." \ --config-from approval-workflow.json ``` | Flag | Type | Required | Description | | --------------- | ----------- | -------- | ------------------------------------------------------------------------- | | `--description` | string | No | One-line description. | | `--config-from` | path or `-` | Yes | ProtoJSON `dome.escalations.v1.EscalationConfig` file, or standard input. | The configuration selects the trigger kind. You cannot change that kind later. ### Update a workflow [#update-a-workflow] ```bash dome escalations update high-risk-review \ --config-from revised-workflow.json ``` | Flag | Type | Description | | --------------- | ----------- | ------------------------------------------- | | `--name` | string | New workflow name. | | `--description` | string | New description. | | `--config-from` | path or `-` | Publish a new active configuration version. | Pass at least one flag. Updating configuration preserves the earlier version. ## Inspect versions [#inspect-versions] ```bash dome escalations versions high-risk-review dome escalations rollback high-risk-review --to-version 2 ``` | Command | Description | | --------------------------------------------------------- | ------------------------------------------------------------------- | | `dome escalations versions ` | List versions, newest first. Supports `--limit` and `--page-token`. | | `dome escalations rollback --to-version ` | Copy an earlier configuration into a new active version. | ## Resolve judgments [#resolve-judgments] ```bash dome escalations judgments list high-risk-review --status pending dome escalations judgments get high-risk-review dome escalations judgments resolve high-risk-review --verdict approve ``` | Command | Description | | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | | `dome escalations judgments list ` | List `pending` or `resolved` judgments. Supports `--status`, `--limit`, and `--page-token`. | | `dome escalations judgments get ` | Show one judgment's status and verdict. | | `dome escalations judgments resolve --verdict ` | Record the final verdict for a pending judgment. | Each verdict applies to one request. A resolved judgment cannot change. ## Next steps [#next-steps] * [Configure escalations](/govern/escalations) and attach a Cedar policy * [Use the MCP tools](/reference/mcp/escalations) from an MCP client * [Use the REST API](/api/tag/escalations/list-escalations) from an application # dome guards (/cli/govern/guards) `dome guards` manages guards — content-inspection definitions that redact, omit, or block governed traffic. Filters rewrite or withhold content in an ordered chain. Validators are pure predicates on tool connections. Text filters attach to model connections; JSON filters and validators attach to MCP server (tool) connections. | Command | | | ----------------------------------------------------- | --------------------------------------------------------------- | | [List filters](#list-filters) | `dome guards filters list` | | [Get filter](#get-filter) | `dome guards filters get ` | | [List filter versions](#list-filter-versions) | `dome guards filters versions ` | | [Create filter](#create-filter) | `dome guards filters create ` | | [Update filter](#update-filter) | `dome guards filters update ` | | [Rollback filter](#rollback-filter) | `dome guards filters rollback --to-version ` | | [Delete filter](#delete-filter) | `dome guards filters delete ` | | [List validators](#list-validators) | `dome guards validators list` | | [Get validator](#get-validator) | `dome guards validators get ` | | [List validator versions](#list-validator-versions) | `dome guards validators versions ` | | [Create validator](#create-validator) | `dome guards validators create ` | | [Update validator](#update-validator) | `dome guards validators update ` | | [Rollback validator](#rollback-validator) | `dome guards validators rollback --to-version ` | | [Delete validator](#delete-validator) | `dome guards validators delete ` | | [List model filters](#list-model-filters) | `dome models guards filters list ` | | [Set model filters](#set-model-filters) | `dome models guards filters set ` | | [List tool filters](#list-tool-filters) | `dome tools guards filters list ` | | [Set tool filters](#set-tool-filters) | `dome tools guards filters set ` | | [List assigned validators](#list-assigned-validators) | `dome tools guards validators list ` | | [Add validator](#add-validator) | `dome tools guards validators add ` | | [Remove validator](#remove-validator) | `dome tools guards validators remove ` | Editing a filter deploys a new active version. Assigned connections pick it up on the next gateway sync — history is preserved and can be rolled back to. ## Filter kinds [#filter-kinds] A filter's kind is structural and immutable at create time. | Kind | Assignable to | Component | Actions | | ------ | ----------------------------- | -------------------------------------------------------------------------- | ------------------------- | | `text` | model connections | Ordered text-content matchers (substring, SSN, credit card, phone, digits) | `redact`, `block` | | `json` | MCP server (tool) connections | Ordered JSON field-actions keyed by field name | `redact`, `omit`, `block` | Both kinds enforce **fail-closed**: a filter whose stored config fails to decode blocks that `(connection, direction)` until the config is fixed. The gateway never relays unfiltered traffic. ## Filters [#filters] ### List Filters [#list-filters] ```bash dome guards filters list ``` List the workspace's filters, showing each one's active version and a compact config summary (e.g. `redact[substring:"foo", ssn]; block[substring:"bar"]` or `omit[ssn, dob]; redact[email]`). ### Get Filter [#get-filter] ```bash dome guards filters get ``` Show a single filter's active version and config. | Arg | Type | Required | Description | | ------------ | ------ | -------- | -------------------------------------- | | `name-or-id` | string | Yes | filter name (workspace-scoped) or UUID | ### List Filter versions [#list-filter-versions] ```bash dome guards filters versions ``` List the filter's version history (newest first). Rollback-produced versions cite the source version id. ### Create Filter [#create-filter] ```bash dome guards filters create ``` Create a filter — its first active version. ```bash # Text Filter: redact SSNs and a substring, then block on another substring dome guards filters create pii-redact \ --description "Redact PII in model responses" \ --redact-ssn \ --redact-substring "internal-only" \ --block-substring "TOP-SECRET" # JSON Filter: omit and redact fields in tool arguments/results (via --config-from) dome guards filters create tool-scrub --config-from ./tool-scrub.json ``` | Flag | Type | Required | Default | Description | | -------------------- | ------------------- | ------------------------------- | ------- | ----------------------------------------------------------------------------------------------------- | | `--description` | string | No | — | One-line description | | `--redact-substring` | string (repeatable) | Text only | — | Redact matches of this substring | | `--block-substring` | string (repeatable) | Text only | — | Block the response on a substring match | | `--redact-ssn` | bool | Text only | `false` | Redact US SSN patterns | | `--block-ssn` | bool | Text only | `false` | Block the response on an SSN match | | `--config-from` | path or `-` | For JSON, or full-fidelity text | — | Read a protojson `dome.guards.v1.FilterConfig` from a file or stdin. Overrides the convenience flags. | The convenience flags build at most two components — a `redact` component and a `block` component, redact ordered first — and only produce text filters. Use `--config-from` to author a JSON filter or a multi-component text chain. #### JSON Filter config example [#json-filter-config-example] ```json title="tool-scrub.json" { "json": { "components": [ { "field_actions": [ { "matcher": { "key": "ssn" }, "action": "FILTER_ACTION_OMIT" }, { "matcher": { "key": "dob" }, "action": "FILTER_ACTION_OMIT" }, { "matcher": { "key": "email" }, "action": "FILTER_ACTION_REDACT" }, { "matcher": { "key": "card" }, "action": "FILTER_ACTION_BLOCK" } ] } ] } } ``` `BLOCK` withholds the whole message. `OMIT` removes the key and value. `REDACT` rewrites the value with a redaction sentinel. When multiple actions target the same key, `BLOCK` > `OMIT` > `REDACT`. ### Update Filter [#update-filter] ```bash dome guards filters update ``` Edit metadata in place, or deploy a new active version by passing any config flag. The old version is preserved in history and assigned connections follow the active version on the next gateway sync. | Flag | Type | Description | | --------------------------------------------------------------------------------------------- | ------ | -------------------------------------------- | | `--name` | string | New name for the logical filter | | `--description` | string | New description | | `--redact-substring` / `--block-substring` / `--redact-ssn` / `--block-ssn` / `--config-from` | — | Any config flag deploys a new active version | Pass at least one of name, description, or a config flag. ### Rollback Filter [#rollback-filter] ```bash dome guards filters rollback --to-version ``` Roll a filter back to an earlier version. The target version's config is copied forward into a new active version — history is never mutated. | Flag | Type | Required | Description | | -------------- | ----- | -------- | ------------------------------ | | `--to-version` | int32 | Yes | Version number to roll back to | ### Delete Filter [#delete-filter] ```bash dome guards filters delete ``` Hard-delete a filter and its connection assignments. Corrupt filters can still be addressed by UUID even when their config fails to render. ## Model Filter assignments [#model-filter-assignments] ### List model Filters [#list-model-filters] ```bash dome models guards filters list ``` List the text filters assigned to a model connection, in chain order, grouped by direction. | Arg | Type | Required | Description | | ------------ | ------ | -------- | --------------------- | | `connection` | string | Yes | model connection name | ### Set model Filters [#set-model-filters] ```bash dome models guards filters set ``` Replace the entire ordered filter chain for one direction on a model connection. Only `text`-kind filters may be assigned. ```bash # Order matters — filters run in the given order dome models guards filters set claude-prod \ --direction response \ --filters pii-redact,secrets-block # Clear a chain dome models guards filters set claude-prod --direction request --filters "" ``` | Flag | Type | Required | Description | | ------------- | -------------------- | -------- | ------------------------------------------------------------------------------ | | `--direction` | string | Yes | `response` (completions the agent receives) or `request` (the outbound prompt) | | `--filters` | comma-separated list | Yes | Ordered filter names or UUIDs; empty clears the chain | `request` runs before dispatch to the upstream provider — a match can redact the prompt or block the call. `response` runs on the streamed completion; multi-chunk patterns are inspected inside the [LLM outbound filter window](/govern/guards#configure-the-streaming-window). ## Tool Filter assignments [#tool-filter-assignments] ### List tool Filters [#list-tool-filters] ```bash dome tools guards filters list ``` List the JSON filters assigned to an MCP server (tool) connection, in chain order, grouped by direction. | Arg | Type | Required | Description | | ------------ | ------ | -------- | -------------------------- | | `connection` | string | Yes | MCP server connection name | ### Set tool Filters [#set-tool-filters] ```bash dome tools guards filters set ``` Replace the entire ordered filter chain for one direction on a tool connection. Only `json`-kind filters may be assigned. ```bash # Scrub PII from tool arguments before they leave, and again from results dome tools guards filters set github-mcp \ --direction request \ --filters tool-scrub dome tools guards filters set github-mcp \ --direction response \ --filters tool-scrub ``` | Flag | Type | Required | Description | | ------------- | -------------------- | -------- | -------------------------------------------------------------------------------------------- | | `--direction` | string | Yes | `response` (tool result returned to the agent) or `request` (tool arguments before dispatch) | | `--filters` | comma-separated list | Yes | Ordered filter names or UUIDs; empty clears the chain | `request` filters run over tool arguments **before** the call reaches the upstream MCP server — matched fields are redacted or omitted, or the whole call is blocked. `response` filters run over the tool result before the agent sees it. ## Validators [#validators] ### List Validators [#list-validators] ```bash dome guards validators list ``` List the workspace's validators, showing each one's active version and kind. ### Get Validator [#get-validator] ```bash dome guards validators get ``` Show a single validator's active version and config. | Arg | Type | Required | Description | | ------------ | ------ | -------- | ----------------------------------------- | | `name-or-id` | string | Yes | validator name (workspace-scoped) or UUID | ### List Validator versions [#list-validator-versions] ```bash dome guards validators versions ``` List the validator's version history (newest first). ### Create Validator [#create-validator] ```bash dome guards validators create ``` Create a validator — its first active version. Config is protojson `dome.guards.v1.ValidatorConfig` only. ```bash dome guards validators create require-user-id \ --description "Require user_id on tool calls" \ --config-from ./require-user-id.json ``` | Flag | Type | Required | Description | | --------------- | ----------- | -------- | -------------------------------------------- | | `--config-from` | path or `-` | Yes | Protojson ValidatorConfig. Use `-` for stdin | | `--description` | string | No | One-line description | Kind (`tool_request` or `tool_response`) is derived from the config arm and is immutable. ### Update Validator [#update-validator] ```bash dome guards validators update ``` Edit metadata in place, or pass `--config-from` to deploy a new active version. Kind cannot change. | Flag | Type | Required | Description | | --------------- | ----------- | -------- | --------------------------- | | `--name` | string | No | Rename the validator | | `--description` | string | No | New description | | `--config-from` | path or `-` | No | Deploy a new active version | Pass at least one flag. ### Rollback Validator [#rollback-validator] ```bash dome guards validators rollback --to-version ``` Roll a validator back to an earlier version. The target config is copied forward into a new active version. | Flag | Type | Required | Description | | -------------- | ------ | -------- | ------------------------------ | | `--to-version` | number | Yes | Version number to roll back to | ### Delete Validator [#delete-validator] ```bash dome guards validators delete ``` Hard-delete a validator and its connection assignments. ## Validator assignments [#validator-assignments] ### List assigned Validators [#list-assigned-validators] ```bash dome tools guards validators list ``` List validators assigned to a tool connection, grouped by direction. | Arg | Type | Required | Description | | ------------ | ------ | -------- | -------------------------- | | `connection` | string | Yes | MCP server connection name | ### Add Validator [#add-validator] ```bash dome tools guards validators add ``` Attach validators to one direction on a tool connection. Attach is atomic. Response validators are MCP-only. ```bash dome tools guards validators add github-mcp \ --direction request \ --validators require-user-id ``` | Flag | Type | Required | Description | | -------------- | -------------------- | -------- | ------------------------ | | `--direction` | string | Yes | `request` or `response` | | `--validators` | comma-separated list | Yes | validator names or UUIDs | ### Remove Validator [#remove-validator] ```bash dome tools guards validators remove ``` Detach validators from one direction on a tool connection. Detach is idempotent. | Flag | Type | Required | Description | | -------------- | -------------------- | -------- | ------------------------ | | `--direction` | string | Yes | `request` or `response` | | `--validators` | comma-separated list | Yes | validator names or UUIDs | # dome quotas (/cli/govern/quota) `dome quotas` is the single command group for every usage cap in the active workspace. Model, tool, and gateway quotas used to live on separate groups; they now share this surface. | Command | | | ----------------------------- | --------------------------------------------------- | | [List quotas](#list-quotas) | `dome quotas list` | | [Set quota](#set-quota) | `dome quotas set --subject --limit ` | | [Update quota](#update-quota) | `dome quotas update ` | | [Remove quota](#remove-quota) | `dome quotas rm ` | Each quota has a **subject** (what it covers) and a **dimension** (which traffic it meters). Dimension is usually implied by `--subject`: | Subject | Implied dimension | Typical units | | ------------------------------------ | ----------------------------------------------------- | --------------------------------------------- | | `workspace`, `agent` | `all` (model + tool), or `run` for managed-agent runs | `dome_usd`, `runs` | | `model`, `pool`, `gateway`, `act-as` | `llm` | `dome_usd`, `provider_usd`, `tokens`, `calls` | | `tool` | `tool` | `dome_usd`, `calls` | | `trigger` | `run` | `runs` | Pass `--dimension` only when a subject is valid on more than one dimension. Create is insert-only for each subject identity, dimension, and window pair. Subject and unit cannot change after create. ## List quotas [#list-quotas] ```bash dome quotas list dome quotas list --dimension llm dome quotas list --dimension run dome quotas list --gateway prod-tools ``` List quotas in the active workspace with subject, dimension, unit, limit, window, usage, and enforcement state. Alias: `ls`. | Flag | Type | Default | Description | | ------------- | ------ | ------- | ------------------------------------------------------- | | `--dimension` | string | — | Only list one dimension: `all`, `llm`, `tool`, or `run` | | `--gateway` | string | — | Only list caps on one gateway (name or id) | > **Note**: Requires `gateways.view`. ## Set quota [#set-quota] ```bash dome quotas set --subject --limit ``` Create a spend, token, or call cap. The gateway either spills routing for an exhausted model budget or rejects traffic when a total cap is reached. | Flag | Type | Required | Default | Description | | -------------- | ------ | ----------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--subject` | string | Yes | — | `workspace`, `agent`, `act-as`, `pool`, `model`, `gateway`, `tool`, `tool-connection`, or `trigger` | | `--dimension` | string | No | implied | `all`, `llm`, `tool`, or `run` — usually implied by `--subject` | | `--unit` | string | No | `dome_usd` | `dome_usd` (what you spend with Dome), `provider_usd` (an estimate of the upstream model bill), `tokens`, `calls`, or `runs` for a run quota. The two dollar units are different money. | | `--limit` | string | Yes | — | US dollars for a dollar unit (e.g. `500` or `12.50`); a whole count for `tokens` or `calls` | | `--window` | string | No | `monthly` | `daily`, `monthly`, or `per_run` (managed-agent agent quota only) | | `--name` | string | No | — | Human-readable label | | `--model` | string | Conditional | — | model connection name (`--subject model`) | | `--pool` | string | Conditional | — | Pool name (`--subject pool`, or to scope a model quota to one pool) | | `--agent` | string | Conditional | — | agent name or id (`--subject agent`) | | `--act-as` | string | Conditional | — | Verified end-user OIDC subject (`--subject act-as`) | | `--gateway` | string | Conditional | — | gateway name or id (`--subject gateway`) | | `--tool` | string | Conditional | — | One MCP tool as `/`, e.g. `github/create_issue` (`--subject tool`) | | `--connection` | string | Conditional | — | MCP server connection name (`--subject tool-connection`) | | `--trigger` | string | Conditional | — | Trigger name or ID (`--subject trigger`) | | `--per-caller` | bool | No | `false` | Apply the limit independently to each agent and verified end user (`--subject model` only) | | `--disabled` | bool | No | `false` | Create without enforcing until enabled | > **Note**: Requires `gateways.manage`. ```bash title="Workspace monthly cap (model + tool)" dome quotas set --subject workspace --limit 5 ``` ```bash title="Agent daily cap" dome quotas set --subject agent --agent bot --limit 1 --window daily ``` ```bash title="Model spend cap" dome quotas set --subject model --model gpt-4o --limit 500 --dimension llm ``` ```bash title="Pool spill-over budget for one model" # Caps claude-sonnet spend inside the production pool at $1000/month. # When exhausted, the pool spills to the next member. dome quotas set \ --subject model --model claude-sonnet --pool production \ --limit 1000 --window monthly ``` ```bash title="Gateway LLM cap" dome quotas set --subject gateway --gateway prod-tools --limit 500 --window monthly --name prod-monthly ``` ```bash title="Tool call cap" dome quotas set --subject tool --tool github/create_issue --unit calls --limit 100 ``` ```bash title="Monthly run limit for one trigger" dome quotas set --subject trigger --trigger nightly-triage --limit 30 --window monthly ``` ```bash title="Per-run token budget for a managed agent" dome quotas set --subject agent --agent nightly-triage --unit tokens --limit 2000000 --window per_run ``` Run quotas count managed-agent runs when they enter the queue. They apply to a workspace, agent, or trigger; a zero limit admits none. A per-run quota is an LLM quota on one managed agent, in `tokens` or `provider_usd`; the runner stops after it reaches the budget, with at most one model call of overage. The gateway picks up a new quota on its next configuration sync. ## Update quota [#update-quota] ```bash dome quotas update --limit 750 dome quotas update --enabled=false ``` Update a quota's name, limit, window, or enforcement state. Its subject and unit cannot change. `--window` has no default: an unset flag leaves the window unchanged. | Flag | Type | Description | | ----------- | ------ | --------------------------------------------------- | | `--name` | string | New label | | `--limit` | string | New limit, interpreted in the quota's existing unit | | `--window` | string | `daily` or `monthly` | | `--enabled` | bool | Enable or disable enforcement | Pass at least one flag. > **Note**: Requires `gateways.manage`. ## Remove quota [#remove-quota] ```bash dome quotas rm ``` Remove a quota by id (from `dome quotas list`). Aliases: `remove`, `delete`. > **Note**: Requires `gateways.manage`. # dome rules (/cli/govern/rules) `dome rules` manages the Cedar authorization rules the gateway evaluates on every tool and model call. Validate and simulate a bundle before deploying it, then roll back to an earlier bundle if it decides something you did not intend. Refer to [Rules](/govern/rules) for the policy model. | Command | | | --------------------------------- | --------------------------------- | | [Apply rules](#apply-rules) | `dome rules apply [files...]` | | [List rules](#list-rules) | `dome rules list` | | [Show rules](#show-rules) | `dome rules show` | | [Validate rules](#validate-rules) | `dome rules validate [files...]` | | [Rollback rules](#rollback-rules) | `dome rules rollback ` | | [Generate rules](#generate-rules) | `dome rules generate` | | [Simulate rules](#simulate-rules) | `dome rules simulate` | ## Apply rules [#apply-rules] ```bash dome rules apply [files...] ``` Deploy a rule bundle from one or more Cedar files. ```bash dome rules apply rules.cedar [flags] ``` | Flag | Type | Description | | --------- | ------ | ---------------------------------------------------- | | `--agent` | string | agent name or ID — deploy rules scoped to this agent | | `--name` | string | Friendly name for the rule bundle | After a successful deploy, `apply` prints advisory `warning:` lines to stderr for any `Dome::MCPTool` reference that does not match a tool in the target workspace's persisted MCP tool catalog (typo, rename, or a tool not yet observed). Warnings never block the deploy. ## List rules [#list-rules] ```bash dome rules list ``` List rule bundle history. | Flag | Type | Description | | --------- | ------ | -------------------------------------------------- | | `--agent` | string | agent name or ID — list rules scoped to this agent | | `--limit` | int | Maximum results (default: 20) | ## Show rules [#show-rules] ```bash dome rules show ``` Show effective rules across the full scope hierarchy. | Flag | Type | Description | | --------- | ------ | -------------------------------------------------- | | `--agent` | string | agent name or ID — show rules scoped to this agent | ## Validate rules [#validate-rules] ```bash dome rules validate [files...] ``` Validate Cedar rule files without deploying. Returns errors and prints catalog warnings (unknown tools or connections) to stderr. Pass `--agent` to run catalog checks against an agent's scope — without it, only syntax and semantic validation runs. ```bash dome rules validate rules.cedar [flags] ``` | Flag | Type | Description | | --------- | ------ | ---------------------------------------------------------- | | `--agent` | string | agent name or ID — validate rules against this agent scope | ## Rollback rules [#rollback-rules] ```bash dome rules rollback ``` Rollback to a previous rule bundle. The bundle UUID (from `dome rules list`) encodes the scope — no extra flags needed. ## Generate rules [#generate-rules] ```bash dome rules generate ``` Generate starter Cedar authorization rules. | Flag | Type | Description | | -------------- | ------ | ---------------------------------------- | | `--from-tools` | bool | Generate rules based on registered tools | | `--output` | string | Write rules to file (default: stdout) | ## Simulate rules [#simulate-rules] ```bash dome rules simulate ``` Simulate an authorization decision against active rules. | Flag | Type | Required | Description | | ------------------ | --------- | -------- | ---------------------------------------------------------------------------- | | `--agent` | string | Yes | agent ID or name | | `--action` | string | Yes | Action to evaluate (e.g., `mcp:call`) | | `--resource` | string | Yes | Resource identifier | | `--resource-type` | string | No | `mcp_tool`, `llm_model`, or `resource` (default: `mcp_tool`) | | `--eval-context` | key=value | No | Evaluation context key-value pairs (repeatable), surfaced as `context.` | | `--eval-arguments` | string | No | Per-call arguments as a JSON object, surfaced as `resource.arguments.` | | `--actas-sub` | string | No | Act-as subject identifier | | `--actas-email` | string | No | Act-as email | | `--actas-roles` | string | No | Act-as roles (comma-separated) | | `--actas-groups` | string | No | Act-as groups (comma-separated) | # dome billing (/cli/manage/billing) `dome billing` manages organization billing. All commands require `billing.manage` and accept `--org-id` to override the active context's organization. Card capture completes in the dashboard. | Command | | | --------------------------------------------------------- | -------------------------------------------------------------- | | [Show status](#show-status) | `dome billing status` | | [List plans](#list-plans) | `dome billing plans` | | [Change plan](#change-plan) | `dome billing change-plan ` | | [Cancel plan](#cancel-plan) | `dome billing cancel` | | [Resume plan](#resume-plan) | `dome billing resume` | | [Show seats](#show-seats) | `dome billing seats` | | [Set seats](#set-seats) | `dome billing seats set ` | | [Show usage](#show-usage) | `dome billing usage` | | [List invoices](#list-invoices) | `dome billing invoices` | | [Show contact](#show-contact) | `dome billing contact` | | [Set contact](#set-contact) | `dome billing contact set` | | [List payment methods](#list-payment-methods) | `dome billing payment-methods` | | [Add payment method](#add-payment-method) | `dome billing payment-methods add` | | [Set default payment method](#set-default-payment-method) | `dome billing payment-methods set-default ` | [`dome usage-caps`](/cli/operate/usage-caps) shows free-tier allowances for the active workspace. ## Plan [#plan] ### Show status [#show-status] ```bash dome billing status ``` Show the active plan and interval, subscription status, renewal dates, default payment method, any scheduled plan change, and any resources over the current tier's caps. ### List plans [#list-plans] ```bash dome billing plans ``` List the self-serve plans and their monthly and annual prices, plus enterprise plans that require contacting sales. Per-seat plans show a per-user price. Pass `--json` for full per-SKU limits and features. ### Change plan [#change-plan] ```bash dome billing change-plan --interval monthly --seats 5 --dry-run dome billing change-plan --interval annual --seats 10 ``` Change the organization's plan. | Flag | Type | Required | Description | | ------------ | --------------------- | -------- | ---------------------------------------------------------------------- | | `--interval` | `monthly` \| `annual` | No | Billing interval | | `--seats` | int32 | No | Purchased seats on a per-seat plan; `0` keeps the assigned-seat count | | `--dry-run` | bool | No | Preview the charge, credit, and scheduling without applying the change | An upgrade applies immediately and bills a full period up front; time already paid on the old plan returns as an account credit toward upcoming invoices rather than reducing today's charge. A downgrade is scheduled for the end of the current term and is not refunded, and it is blocked while resources exceed the target plan's caps. To move seats on the plan you already have, use [`seats set`](#set-seats) instead. ### Cancel plan [#cancel-plan] ```bash dome billing cancel ``` Schedule cancellation of the paid plan. The plan stays active until the end of the current billing period, then reverts to free. | Flag | Type | Required | Description | | ------- | ---- | -------- | ---------------------------- | | `--yes` | bool | No | Skip the confirmation prompt | ### Resume plan [#resume-plan] ```bash dome billing resume ``` Reverse a scheduled cancellation before the current term ends. The existing plan and billing cadence continue, and nothing is charged. ## Seats [#seats] ### Show seats [#show-seats] ```bash dome billing seats ``` Show purchased and used seats. Used counts the distinct role holders across all workspaces; purchased is what the organization pays for on a per-seat plan. ### Set seats [#set-seats] ```bash dome billing seats set 12 --dry-run dome billing seats set 12 ``` Set the absolute purchased-seat count on the current per-seat plan without changing its SKU or billing interval. | Flag | Type | Required | Description | | ----------- | ---- | -------- | ----------------------------------------------------------------------- | | `--dry-run` | bool | No | Preview the target, recurring total, and whether the change is deferred | An increase applies immediately and is billed now, prorated for the remainder of the current period. A reduction is scheduled for the period end and does not remove access early. The target cannot be lower than the number of assigned seats. Setting the count back to today's value cancels a pending reduction, and each new request replaces any earlier one. ## Usage and invoices [#usage-and-invoices] ### Show usage [#show-usage] ```bash dome billing usage ``` Show the usage-based charges accruing in the current billing period, broken down by meter and by tenant. Usage meters governed actions: every tool call and model call that clears authentication and quotas, whether allowed or denied. Tool calls are billed per call and model calls by tokens. The plan fee and seats are billed separately and are not included here. ### List invoices [#list-invoices] ```bash dome billing invoices ``` List invoice history with each invoice's date, amount, status, and hosted URL. | Flag | Type | Default | Description | | --------- | ----- | ------- | -------------------------- | | `--limit` | int32 | `20` | Maximum invoices to return | ## Billing contact [#billing-contact] ### Show contact [#show-contact] ```bash dome billing contact ``` Show the current billing contact and address. ### Set contact [#set-contact] ```bash dome billing contact set --email billing@example.com ``` Update the billing contact. Pass at least one flag; only the fields you pass change. | Flag | Type | Description | | --------------- | ------ | --------------------------------------------------- | | `--name` | string | Contact name | | `--email` | string | Contact email | | `--line1` | string | Address line 1 | | `--line2` | string | Address line 2 | | `--city` | string | City | | `--state` | string | State or province | | `--postal-code` | string | Postal or ZIP code | | `--country` | string | Country as an ISO 3166-1 alpha-2 code, such as `US` | ## Payment methods [#payment-methods] Aliases: `payment-method`, `pm`. ### List payment methods [#list-payment-methods] ```bash dome billing payment-methods ``` List saved cards with their brand, last four digits, expiration, and which is the default. ### Add payment method [#add-payment-method] ```bash dome billing payment-methods add ``` Start a Stripe SetupIntent and print its publishable key and client secret. Card entry completes in the browser, so the card number never reaches Dome. Finish in the dashboard under **Billing → Payment methods**. ### Set default payment method [#set-default-payment-method] ```bash dome billing payment-methods set-default ``` Make a saved payment method the default. IDs come from [`payment-methods`](#list-payment-methods). ## Next steps [#next-steps] * [Billing](/manage/billing) how-to * [Export data](/manage/export#stream-audit-evidence-to-a-siem) for plan-gated SIEM streaming # dome export (/cli/manage/export) Export Dome configuration from the active workspace, tenant, or organization. Use the reviewed file as input to [`dome import`](/cli/manage/import) in a compatible target scope. Refer to [Import and export configuration](/manage/import-export) for supported resource families, scope coverage, and portability permissions. ## Requirements [#requirements] Before you begin: * Authenticate the CLI and select the source scope. * Hold `export.manage` and the view permission for each resource family you export. ## List exportable resources [#list-exportable-resources] ```bash dome export --list ``` List the resource families and resource IDs available to export from the active scope. Families you cannot view are omitted and reported separately. ## Export configuration [#export-configuration] ```bash dome export --all [flags] ``` Export every resource in the active scope, or narrow the export with `--include` or `--resource`. | Flag | Type | Description | | --------------------- | --------- | ------------------------------------------------------------------------------------------------------------- | | `--all` | bool | Export every exportable resource in the active scope. | | `--include` | string\[] | Export one or more resource families. Repeat the flag or provide comma-separated values. | | `--resource` | string\[] | Export one or more resource IDs from `dome export --list`. Repeat the flag or provide comma-separated values. | | `--with-dependencies` | bool | Include resources the selected resources reference. | | `--output`, `-o` | string | Write the export to this file instead of standard output. | ```bash title="Export all configuration" dome export --all --output dome.tf ``` ```bash title="Export a family with its dependencies" dome export --include gateways --with-dependencies --output gateways.tf ``` Secrets and environment-specific values become variables in the export. Review the generated file before committing or sharing it. ## Import the export [#import-the-export] Plan every export before you apply it to another scope. See [`dome import`](/cli/manage/import) for variable values, plan results, job status, and one-time outputs. # dome import (/cli/manage/import) Plan and apply reviewed Dome configuration to the active target scope. Imports create or update matching resources and never destroy or replace existing configuration. Start with [`dome export`](/cli/manage/export) to create the configuration file. Refer to [Import and export configuration](/manage/import-export) for supported resource families, scope coverage, and portability permissions. ## Requirements [#requirements] Before you begin: * Select the target workspace, tenant, or organization. * Hold `import.manage` and the permissions needed to create or update each imported resource. * Review the export and collect every required variable value. ## Plan an import [#plan-an-import] ```bash dome import [more files...] --plan-only [flags] ``` Validate one or more `.tf` files and report the changes without changing the active scope. The command inspects the bundle and checks required permissions before it creates the plan job. ```bash dome import dome.tf --plan-only --var api_token="$API_TOKEN" ``` ## Import configuration [#import-configuration] ```bash dome import [more files...] [flags] ``` Import one or more export files into the active scope. Pass a directory to include its top-level `.tf` files. Dome prompts for missing variable values unless the command runs unattended. | Flag | Type | Description | | ------------- | --------- | -------------------------------------------------------------- | | `--var` | string\[] | Supply a variable as `name=value`. Repeat for multiple values. | | `--var-file` | string | Read variable values from a JSON or YAML file. | | `--plan-only` | bool | Plan and report without applying changes. | | `--yes`, `-y` | bool | Skip the confirmation prompt. | | `--detach` | bool | Return after Dome accepts the job instead of following it. | ```bash title="Import reviewed configuration" dome import dome.tf --var api_token="$API_TOKEN" --yes ``` For unattended runs, use `--var-file` or `DOME_IMPORT_VAR_` environment variables. Dome derives `workspace_id`, `tenant_id`, and `org_id` from the active context. Do not supply them yourself. ## Check an import job [#check-an-import-job] ```bash dome import status [--no-follow] ``` Show an import job. By default, the command follows it until it finishes. Use `--no-follow` to return the current state immediately. ## List import jobs [#list-import-jobs] ```bash dome import list [--limit ] ``` List import jobs targeting the active scope. `dome import ls` is an alias. ## Cancel an import [#cancel-an-import] ```bash dome import cancel ``` Request cancellation before the job starts applying. A job already applying completes and reports its result. ## Reveal one-time outputs [#reveal-one-time-outputs] ```bash dome import outputs ``` Reveal credentials created by a completed import, such as a new API key token. Dome shows those values exactly once and only to the person who created the job. Store them securely before continuing. ## Create an export [#create-an-export] Use [`dome export`](/cli/manage/export) to create a configuration file from another compatible scope. # dome audit (/cli/operate/audit) `dome audit` reads the evidence Dome records for every governed action. Query or tail events, follow one activity chain end to end, browse the event catalog, and export to a file or a SIEM destination. Refer to [Audit](/operate/audit) for what each event carries. | Command | | | ------------------------------- | ------------------------------------------------------------------- | | [Query events](#query-events) | `dome audit query` | | [Stream events](#stream-events) | `dome audit stream` | | [Get event](#get-event) | `dome audit get [event-id]` | | [Export events](#export-events) | `dome audit export` | | [Catalog](#catalog) | `dome audit catalog list` / `show` | | [SIEM](#siem) | `dome audit siem enable` / `disable` / `resume` / `status` / `list` | | [List chains](#list-chains) | `dome audit chains` | | [Show chain](#show-chain) | `dome audit chain [activity-id]` | > **Note**: All commands scope the read to the active context, so the server checks the workspace-level `audit.view` permission. Switch workspaces with `dome context use ` before running the command. Tenant- or org-scoped API keys with no workspace selected fall back to the tenant-level `audit.view`. ## Query events [#query-events] ```bash dome audit query ``` Query audit events with optional filters. | Flag | Type | Description | | ------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | `--types` | string\[] | filter by event types | | `--classes` | string\[] | `governing`, `state_change`, `security`, `audit_access` | | `--stages` | string\[] | `attempted`, `completed` | | `--results` | string\[] | `allowed`, `denied` | | `--deny-reasons` | string\[] | Shared denial reasons such as `permission_denied`, `guard_blocked`, or `plan_limit` | | `--has-error` | bool | filter by error presence. Unset means no filter; `--has-error=false` selects events without errors. | | `--act-as-sub` | string | Select governed calls made for one verified end-user subject | | `--agent-id` | string | filter by agent ID | | `--agent-ids` | string\[] | filter by agent IDs | | `--primary-resource-id` | string | filter by primary resource ID | | `--primary-resource-kind` | string | filter by primary resource kind | | `--trace-id` | string | filter by trace ID — events for one request | | `--activity-id` | string | filter by activity chain ID. Refer to [Activity chains](/reference/events/contracts#correlation) reference. | | `--operation-id` | string | filter by operation ID | | `--parent-event-id` | string | filter by parent event ID | | `--actor-kind` | string | filter by actor kind | | `--actor-id` | string | filter by actor ID | | `--producer-service` | string | filter by producer service | | `--producer-gateway-id` | string | filter by producer gateway ID | | `--request-surface` | string | filter by request surface | | `--caller-surface` | string | filter by caller application surface | | `--payload-filter` | string\[] | `event.type:field` or `event.type:field=value` (repeatable). Refer to [Payload filters](/reference/events/contracts#payload-filters) reference. | | `--since` | string | Start time (RFC3339) | | `--until` | string | End time (RFC3339) | | `--limit` | int32 | Maximum results (default: 50) | | `--page-token` | string | Cursor from a previous query | | `--compact` | bool | Bounded investigation rows; use `audit get` for full payload | ## Stream events [#stream-events] ```bash dome audit stream ``` Stream audit events in real-time via SSE. Accepts the same filters as [`query`](#query-events) except `--limit` and `--compact`. | Flag | Type | Description | | ------------------------- | --------- | ------------------------------------------------ | | `--types` | string\[] | filter by event types | | `--classes` | string\[] | filter by event classes | | `--stages` | string\[] | filter by operation stage | | `--results` | string\[] | filter by operation verdict | | `--deny-reasons` | string\[] | filter denied operations by shared denial reason | | `--has-error` | bool | filter by error presence | | `--agent-id` | string | filter by agent ID | | `--agent-ids` | string\[] | filter by agent IDs | | `--primary-resource-id` | string | filter by primary resource ID | | `--primary-resource-kind` | string | filter by primary resource kind | | `--trace-id` | string | filter by trace ID | | `--activity-id` | string | Follow one activity chain live | | `--operation-id` | string | filter by operation ID | | `--parent-event-id` | string | filter by parent event ID | | `--actor-kind` | string | filter by actor kind | | `--actor-id` | string | filter by actor ID | | `--producer-service` | string | filter by producer service | | `--producer-gateway-id` | string | filter by producer gateway ID | | `--request-surface` | string | filter by request surface | | `--caller-surface` | string | filter by caller application surface | | `--payload-filter` | string\[] | Payload filter (repeatable) | | `--since` | string | Start time (RFC3339) | | `--until` | string | End time (RFC3339) | | `--page-token` | string | Cursor from a previous stream | ## Get event [#get-event] ```bash dome audit get [event-id] ``` Get a single audit event by ID. Enum values — event class, result, actor kind, surface — render as short tokens (`governing`, `denied`, `gateway_mcp`) in both the table and `--format json` output, and the filter flags accept those same tokens. Refer to [Enum rendering](/reference/events/contracts#enum-rendering) reference. ## Export events [#export-events] ```bash dome audit export ``` Export audit events in JSON-lines, JSON, CSV, OCSF, or CEF format. The command pages to exhaustion up to `--limit`; it never formats only the first server page. It refuses an artifact when any page is incomplete, repeats a cursor, or would exceed the 10,000-event hard maximum. An unknown payload type is retained with an `@unresolved` marker and a compatibility warning instead of dropping the event. | Format | Output | | ----------------- | ------------------------------------------------------------------ | | `jsonl` (default) | One JSON object per line (NDJSON). | | `json` | Single pretty-printed JSON array. | | `csv` | Comma-separated rows. | | `ocsf` | OCSF v1.1.0 JSON array for Splunk, Sentinel, or Chronicle. | | `cef` | Common Event Format lines for ArcSight, QRadar, or generic syslog. | Accepts the same filters as [`query`](#query-events), plus: | Flag | Type | Description | | ---------- | ------ | -------------------------------------------------------- | | `--limit` | int32 | Maximum results (default: 1000) | | `--format` | string | `jsonl`, `json`, `csv`, `ocsf`, `cef` (default: `jsonl`) | ```bash # Export the last 24 hours as OCSF for a SIEM dome audit export \ --since 2026-05-26T00:00:00Z \ --format ocsf > audit.ocsf.json ``` ## Catalog [#catalog] ```bash dome audit catalog list ``` List every audit event type. Complete and unpaginated. Requires `audit.view`. ```bash dome audit catalog show [event-type] ``` Show field detail for one event type. | Arg | Type | Required | Description | | ------------ | ------ | -------- | --------------- | | `event-type` | string | Yes | Event type name | ## SIEM [#siem] Continuous audit → SIEM streaming for Datadog or Grafana Loki. Distinct from [`dome audit stream`](#stream-events) (live tail) and from batch [`export`](#export-events). Use [`dome integrations list`](/cli/operate/integrations) to find the slug or instance ID of a connected destination. | Command | Permission | | -------------------------------------- | -------------- | | `dome audit siem list` | `audit.view` | | `dome audit siem status [slug-or-id]` | `audit.view` | | `dome audit siem enable [slug-or-id]` | `audit.export` | | `dome audit siem disable [slug-or-id]` | `audit.export` | | `dome audit siem resume [slug-or-id]` | `audit.export` | ```bash dome audit siem list dome audit siem enable dome audit siem resume --skip-to-now --yes ``` Streaming is forward-only from enable time. `enable` creates a stream; if one exists, use `resume`. `disable` keeps the cursor. `--skip-to-now` abandons backlog permanently. `enabled` and delivery `state` are separate. A disabled stream retains its last health state, so `state=active` does not mean it is delivering unless `enabled=true`. The CLI combines both facts as `stopped`, `stopped (was erroring)`, or a corresponding paused label. A destination that has never been enabled is absent from `list`, and `status` returns not found. ## Hash chains [#hash-chains] ### List chains [#list-chains] ```bash dome audit chains ``` List activity chains in the active workspace. A chain is the set of audit events sharing one `activity_id` — a session, an LLM turn, a conversation thread, or a scripted run — computed at read time by grouping on `activity_id` within the workspace. A chain is listed when **any** of its events matches the filter. Per-chain counts always reflect the full chain. Drill into one chain's events with [`dome audit chain `](#show-chain). Refer to [Activity chains](/reference/events/contracts#correlation) reference for the model and trust labels. | Flag | Type | Description | | -------------------- | --------- | -------------------------------------------------------------------------------------------------- | | `--types` | string\[] | Chain contains an event of these types | | `--classes` | string\[] | Chain contains an event of these classes (`governing`, `state_change`, `security`, `audit_access`) | | `--stages` | string\[] | Chain contains an event at one of these stages | | `--results` | string\[] | Chain contains an event with one of these verdicts (`allowed`, `denied`) | | `--deny-reasons` | string\[] | Chain contains a refusal with one of these reasons | | `--has-error` | bool | Chain contains an event matching error presence | | `--agent-id` | string | Chain contains an event for this agent | | `--agent-ids` | string\[] | Chain contains an event for these agents | | `--actor-kind` | string | Chain contains an event with this actor kind | | `--actor-id` | string | Chain contains an event with this actor ID | | `--producer-service` | string | Chain contains an event from this producer service | | `--request-surface` | string | Chain contains an event from this request surface | | `--since` | string | Start time (RFC3339) | | `--until` | string | End time (RFC3339) | | `--limit` | int32 | Maximum chains (default: 50) | | `--page-token` | string | Cursor from a previous chains query | Per-event identity filters (`--trace-id`, `--operation-id`, `--parent-event-id`) and payload filters identify a single event, not a chain, and are not offered here. ```bash # Recent chains in the active workspace dome audit chains --limit 20 # Chains that contain a denied governing event in the last day dome audit chains \ --classes governing \ --results denied \ --since 2026-06-05T00:00:00Z ``` Each row reports the chain's `activity_id`, event count, last activity timestamp, outcome breakdown, trust label (`server-owned`, `caller-asserted`, or mixed — refer to [Activity trust](/reference/events/contracts#correlation) reference), and distinct event-type count. ### Show chain [#show-chain] ```bash dome audit chain [activity-id] ``` Show one activity chain's events in order. A drill-in into `audit query` filtered by `activity_id`. Accepts the same per-event filters as `audit query` to narrow the chain's events further. | Flag | Type | Description | | ------------------ | --------- | ----------------------------------------------------------------------------- | | `--types` | string\[] | filter by event types | | `--classes` | string\[] | filter by event classes | | `--stages` | string\[] | filter by operation stage | | `--results` | string\[] | filter by operation verdict | | `--deny-reasons` | string\[] | filter by denial reason | | `--has-error` | bool | filter by error presence | | `--agent-id` | string | filter by agent ID | | `--actor-kind` | string | filter by actor kind | | `--actor-id` | string | filter by actor ID | | `--payload-filter` | string\[] | Payload filter as `event.type:field` or `event.type:field=value` (repeatable) | | `--since` | string | Start time (RFC3339) | | `--until` | string | End time (RFC3339) | | `--limit` | int32 | Maximum events (default: 200) | | `--page-token` | string | Cursor from a previous query | ```bash # Every event in one chain dome audit chain case-12345 # Only the denied events in that chain dome audit chain case-12345 --results denied ``` ### Emit events [#emit-events] Set `--activity` (or `DOME_ACTIVITY_ID`) on the root command to assert a stable activity ID. Every Connect RPC the run makes carries `X-Dome-Activity-Id`, so the audit events all share one `activity_id` and form one chain. ```bash # One run, many commands, one chain. export DOME_ACTIVITY_ID="case-12345" dome agents register --name worker dome rules apply ./rules dome audit query --limit 5 # Inspect the chain you just emitted. dome audit chains --since 2026-06-05T00:00:00Z dome audit chain case-12345 ``` `--activity` overrides `DOME_ACTIVITY_ID`. The ID is opaque to Dome — pick whatever maps to your unit of work. The header is first-party only and is never forwarded to third-party LLM or MCP backends. The `--activity` emit flag (root command) and the `--activity-id` filter flag (audit reads) are distinct: one stamps events, the other selects them. # dome integrations (/cli/operate/integrations) `dome integrations` lists the catalog integrations configured in the active workspace. Their slugs or IDs identify destinations for commands such as [`dome audit siem enable`](/cli/operate/audit#siem). | Command | | | --------------------------------------- | ------------------------ | | [List integrations](#list-integrations) | `dome integrations list` | Alias: `dome integration`. ## List integrations [#list-integrations] ```bash dome integrations list ``` List each connected integration's slug, display name, ID, connection date, and most recently observed status. Requires `integrations.view`. `Connected` means Dome can reach the destination with its configured credentials. `Invalid credentials` means the destination rejected them; update the credential and reconnect. `Unreachable` means Dome could not reach the destination; check its URL, network policy, and service availability. Dome refreshes these checks in the background. A workspace can have at most one instance of each catalog integration, so commands that accept an integration reference can use its slug, such as `datadog`, instead of its UUID. Connecting an integration requires provider credentials and is available in the dashboard rather than the CLI. # dome usage-caps (/cli/operate/usage-caps) `dome usage-caps` shows how much of the free plan's monthly allowance the active workspace has left, and whether either cap has been reached. ```bash dome usage-caps ``` Show the organization-level allowances that govern the active workspace on the free plan: * monthly MCP tool calls * monthly model tokens The output shows each allowance, included amount, current usage, reset window, and whether the cap has been reached. The two allowances are independent: reaching one does not exhaust the other. This command is read-only. Paid plans meter usage instead, so the command returns no caps for a workspace under a paid organization. Use [`dome usage`](/cli/operate/usage) for recent model-token usage and [`dome billing usage`](/cli/manage/billing#show-usage) for the current billing period. # dome usage (/cli/operate/usage) `dome usage` prints LLM token consumption and a per-class cost estimate for the active workspace. Use it to spot-check spend, build budget alerts in scripts, or confirm token attribution matches what the dashboard and `dome_usage` MCP tool show. > **Note**: The estimated cost is a blended cross-model rate intended for trend-watching, not a billable figure. Refer to [Token Usage and Cost](/operate/observe#token-usage-and-cost) for the full token-class breakdown and pricing model. ## Usage [#usage] ```bash dome usage ``` Reads `GET /api/v1/metrics/summary` for the active workspace over the last 24 hours and renders the totals. | Flag | Type | Description | | -------- | ---- | ---------------------------- | | `--json` | bool | Output as JSON for scripting | **Permission:** workspace `audit.view` **Prerequisite:** an active workspace selected with `dome context use `. ```bash dome usage ``` Output (table): ``` LLM token usage (last 24h) Input tokens 412000 Cache read tokens 1820000 Cache write tokens 88000 Output tokens 64000 Reasoning tokens 12000 Total tokens 2396000 Token source provider-reported Estimated cost $3.4521 (per-model estimate of your provider bill, not a Dome charge) ``` Calls for which the provider reported no usage add no tokens to this view. Dome derives tokens from wire bytes separately for billing; run [`dome models rates`](/cli/connect/models#model-rates) for that conversion table. Output (`--json`): ```json { "llm_input_tokens": 412000, "llm_cache_read_tokens": 1820000, "llm_cache_write_tokens": 88000, "llm_output_tokens": 64000, "llm_reasoning_tokens": 12000, "llm_total_tokens": 2396000, "estimated_cost_usd": 3.4521 } ``` Pipe into `jq` to build budget guards: ```bash # Fail if estimated 24h spend crosses $10 cost=$(dome usage --json | jq '.estimated_cost_usd') awk "BEGIN { exit !($cost > 10) }" && echo "over budget" >&2 ``` For per-agent, per-key, per-identity, or per-model attribution, see the [REST query surface](/operate/observe#token-usage-and-cost) — the dashboard and the [`dome_usage`](/reference/mcp/audit#audit-usage) MCP tool consume the same endpoints. # dome webhooks (/cli/operate/webhooks) `dome webhooks` subscribes your HTTPS endpoints to Dome events, delivered as signed webhooks from the active workspace. Each subscription carries its endpoint and event selection, and deliveries are inspected, replayed, or cancelled separately. Refer to [Webhooks](/operate/webhooks) for the delivery contract. | Command | | | ----------------------------------------------------- | -------------------------------------------------------- | | [List subscriptions](#list-subscriptions) | `dome webhooks subscriptions list` | | [Get subscription](#get-subscription) | `dome webhooks subscriptions get ` | | [Create subscription](#create-subscription) | `dome webhooks subscriptions create …` | | [Update subscription](#update-subscription) | `dome webhooks subscriptions update ` | | [Disable subscription](#disable-subscription) | `dome webhooks subscriptions disable ` | | [Rotate signing secret](#rotate-signing-secret) | `dome webhooks subscriptions rotate-secret ` | | [Send test event](#send-test-event) | `dome webhooks subscriptions test ` | | [Delete subscription](#delete-subscription) | `dome webhooks subscriptions delete ` | | [List deliveries](#list-deliveries) | `dome webhooks deliveries list` | | [Get delivery](#get-delivery) | `dome webhooks deliveries get ` | | [Replay delivery](#replay-delivery) | `dome webhooks deliveries replay ` | | [Replay failed deliveries](#replay-failed-deliveries) | `dome webhooks deliveries replay-failed --since ` | | [Cancel delivery](#cancel-delivery) | `dome webhooks deliveries cancel ` | | [List providers](#list-providers) | `dome webhooks providers list` | | [Get provider](#get-provider) | `dome webhooks providers get ` | `dome webhooks` also answers to `dome events`. Group aliases: `subscriptions` = `sub`, `deliveries` = `del`, every `list` = `ls`, `delete` = `rm`. > **Note**: All commands scope to the active workspace (from `dome context`). ## Permissions [#permissions] | Permission | Commands | | ----------------- | ---------------------------------------------------------------------------------- | | `eventing.view` | All `list` and `get` commands | | `eventing.manage` | Subscription create, update, disable, rotate-secret, test, delete; delivery cancel | | `eventing.replay` | `deliveries replay`, `deliveries replay-failed` | Workspace `admin` and `operator` roles hold all three. `security`, `developer`, and `viewer` hold `eventing.view`. ## Subscriptions [#subscriptions] ### List subscriptions [#list-subscriptions] ```bash dome webhooks subscriptions list ``` List every subscription in the active workspace with its delivery endpoint, event types, and active state. ### Get subscription [#get-subscription] ```bash dome webhooks subscriptions get ``` Show a subscription's delivery endpoint, provider, event types, filters, and active state. Name matching is case-insensitive. ### Create subscription [#create-subscription] ```bash dome webhooks subscriptions create (--url | --provider ) --event-type ``` Create a subscription and its delivery destination atomically. A failed request leaves neither record behind. ``` Subscription "alerts" created (id: …) Signing secret (shown once, key key_…): whsec_… ``` The signing secret prints **once** — capture it before the terminal closes. It is only recoverable via `rotate-secret`. Providers that authenticate with a credential in the body (PagerDuty) send unsigned deliveries and return no secret. | Flag | Type | Description | | ------------------ | --------- | ------------------------------------------------------------------------------------------- | | `--url` | string | Custom HTTPS endpoint URL. Exactly one of `--url` or `--provider`. | | `--provider` | string | Provider key from `providers list`. | | `--setting` | string\[] | Provider setting `key=value` (repeatable). Non-secret. | | `--credential` | string\[] | Provider credential `key=value` (repeatable). Stored write-only. | | `--event-type` | string\[] | Event type to subscribe to (repeatable, required). | | `--filter` | string\[] | filter predicate (repeatable). Refer to [filter grammar](#filter-grammar). | | `--content-format` | string | Custom URL only: `object` (default) or `array` (one-element JSON array). | | `--header-literal` | string\[] | Custom header `Name=Value` (repeatable). Custom URL only. | | `--header-secret` | string\[] | Custom header `Name=Value` stored write-only, masked on read (repeatable). Custom URL only. | #### Filter grammar [#filter-grammar] | Form | Meaning | | ---------------- | ------------------------------------------------------------------------------------------------------------------------- | | `key=value` | Exact match. Repeat the same key for an OR set. | | `key~=glob` | Glob pattern. `*` any run, `?` one char, `\` escapes. Matches the full value, case-sensitive. | | `tool=conn/tool` | Sugar. Splits at the first `/` into `connection_name` + `tool_name` filters; each side globs when it contains `*` or `?`. | Filter keys: `agent_name`, `connection_name` (resolved from IDs at delivery time), `agent_id`, `tool_name`, plus each event type's own filterable payload fields — browse them with [`dome audit catalog`](/operate/audit#browse-the-event-catalog) or the dashboard **Event catalog** tab. An event delivers only if it satisfies every filter that applies to its type. ### Update subscription [#update-subscription] ```bash dome webhooks subscriptions update ``` Update a subscription or its delivery destination. Unpassed flags leave the field untouched. | Flag | Type | Description | | ------------------- | --------- | ----------------------------------------------------------------------------- | | `--name` | string | New display name. | | `--event-type` | string\[] | Replace the full event-type set (repeatable). | | `--filter` | string\[] | Replace the full filter set (repeatable). Excludes `--clear-filters`. | | `--clear-filters` | bool | Remove every filter. | | `--active` | bool | `--active=false` pauses fanout; `--active` resumes it. No backfill on resume. | | `--url` | string | Replace the destination URL. | | `--endpoint-active` | bool | Enable or disable the destination itself. | | `--content-format` | string | `object` or `array`. Custom URL only. | | `--header-literal` | string\[] | Upsert a literal header `Name=Value`. | | `--header-secret` | string\[] | `Name=Value` rotates the secret; bare `Name` keeps the stored value. | | `--remove-header` | string\[] | Remove a header by name. | | `--clear-headers` | bool | Remove all custom headers. | | `--setting` | string\[] | Replace the full provider settings set `key=value`. | | `--credential` | string\[] | Merge a write-only provider credential `key=value`. | ### Disable subscription [#disable-subscription] ```bash dome webhooks subscriptions disable ``` Stop new fanout. Delivery history and pending retries remain queryable. ### Rotate signing secret [#rotate-signing-secret] ```bash dome webhooks subscriptions rotate-secret ``` Rotate the destination's HMAC signing secret. Prints the new secret **once**: ``` New signing secret (shown once, key key_…): whsec_… ``` During the grace window the `webhook-signature` header carries a signature per active key, so a consumer verifying with either secret keeps working. ### Send test event [#send-test-event] ```bash dome webhooks subscriptions test ``` Send a fixed `eventing.test` event through the subscription's destination. Verifies signing, headers, and the destination's own routing end-to-end. Prints the queued delivery ID — inspect it with `deliveries get`. ### Delete subscription [#delete-subscription] ```bash dome webhooks subscriptions delete ``` Delete the subscription and cancel every pending delivery. Delivery history stays queryable. ## Deliveries [#deliveries] ### List deliveries [#list-deliveries] ```bash dome webhooks deliveries list ``` Inspect deliveries by status, event type, subscription, or time window. Prints last attempt, status, event type, delivery ID, attempt count, and last error per row. | Flag | Type | Description | | ------------------- | ------ | ------------------------------------------------------------------------------------------------------------------- | | `--subscription-id` | string | Narrow to one subscription ID. | | `--destination-id` | string | Narrow to one destination ID. | | `--event-type` | string | Narrow to one event type. | | `--status` | string | One of `created`, `enqueued`, `delivering`, `retry_scheduled`, `succeeded`, `failed`, `canceled`, `expired`, `dlq`. | | `--event-id` | string | Every delivery for one source event. | | `--start` | string | RFC3339 start time. | | `--end` | string | RFC3339 end time. | | `--limit` | int | Page size. | | `--page-token` | string | Cursor from a previous listing. | ### Get delivery [#get-delivery] ```bash dome webhooks deliveries get ``` Show a delivery with its status, timing, last HTTP status, and per-attempt history. | Flag | Type | Description | | -------- | ---- | ----------------------------------------------------------------------------------------------------------- | | `--body` | bool | Include the delivered webhook body while retained — up to 30 days, or 24 hours after a successful delivery. | ### Replay delivery [#replay-delivery] ```bash dome webhooks deliveries replay ``` Replay one delivery. Creates a **new** delivery from the retained body — fresh `webhook-id`, same `Dome-Event-Id` — and sends another request to the destination. Consumers that dedupe on `Dome-Event-Id` ignore the overlap. ### Replay failed deliveries [#replay-failed-deliveries] ```bash dome webhooks deliveries replay-failed --since ``` Bulk-replay terminally-failed deliveries in a time window — the outage-recovery counterpart to `replay`. Safe to re-run: a delivery with a live or succeeded replay is not matched again, and canceled deliveries are never recovered. | Flag | Type | Description | | ---------------- | --------- | --------------------------------------------------------------------------------------------- | | `--since` | string | Duration back from now (`24h`, `7d`) or RFC3339 timestamp. Required, within the last 30 days. | | `--until` | string | RFC3339 upper bound. Defaults to now. | | `--subscription` | string | Narrow to one subscription name or ID. | | `--status` | string\[] | Statuses to recover — subset of `failed`, `expired`, `dlq`. Default all three. | | `--max` | int | Deliveries per run, up to 500. Repeat the command to continue. | Prints `matched · replayed · skipped (body expired) · failed`. ### Cancel delivery [#cancel-delivery] ```bash dome webhooks deliveries cancel ``` Cancel a delivery's pending retries. No further request is sent to the destination. ## Providers [#providers] ### List providers [#list-providers] ```bash dome webhooks providers list ``` List every off-the-shelf provider with its setting and credential fields, recommended event bundle, and authentication style — Standard Webhooks signature or credential-in-body. ### Get provider [#get-provider] ```bash dome webhooks providers get ``` Show a provider's setup instructions, documentation link, and `--setting` / `--credential` fields. Run before `subscriptions create --provider`. # dome auth (/cli/session/auth) `dome auth` signs the CLI in to a Dome Platform host through browser-based SSO and reports who the current session belongs to. Logging in creates a [context](/cli/session/context); every other command runs against the active one. | Command | | | ----------------- | ------------------ | | [Login](#login) | `dome auth login` | | [Logout](#logout) | `dome auth logout` | | [Status](#status) | `dome auth status` | ## Login [#login] ```bash dome auth login ``` Authenticate with the Dome Platform. Opens your default browser for authentication. After login, an identity session is created and all available org/tenant contexts are synced. ```bash dome auth login ``` | Flag | Type | Description | | --------- | ------ | -------------------------------------- | | `--token` | string | API token for CI/headless environments | ## Logout [#logout] ```bash dome auth logout ``` Sign out and remove stored credentials. ## Status [#status] ```bash dome auth status ``` Show authentication status including active context, server, org, tenant, and role. # dome context (/cli/session/context) `dome context` manages the CLI's stored sessions. A context is one authenticated session scoped to a specific org, tenant, and workspace, and every other command runs against the active one. The CLI and Dome MCP server share `~/.config/dome/config.yaml`. A context switch through either surface is picked up by the other; MCP reloads disk changes before tool calls. | Command | | | --------------------------------------------- | ------------------------------------------- | | [List contexts](#list-contexts) | `dome context list` | | [Show current context](#show-current-context) | `dome context current` | | [Use context](#use-context) | `dome context use [name]` | | [Sync contexts](#sync-contexts) | `dome context sync` | | [Rename context](#rename-context) | `dome context rename ` | | [Delete context](#delete-context) | `dome context delete ` | | [Create alias](#create-alias) | `dome context alias ` | ## List contexts [#list-contexts] ```bash dome context list ``` List all contexts in org/tenant/workspace hierarchy. Aliases: `ls`. ## Show current context [#show-current-context] ```bash dome context current ``` Show the active context name. ```text prod/acme/backend ``` With `--format json`, the response includes the context name, level, server, and available organization, tenant, and workspace names. Use `dome gateways list` or `dome gateways get` for complete gateway URLs. ## Use context [#use-context] ```bash dome context use [name] ``` Switch the active context by name, alias, or shorthand. ```bash # By exact name dome context use "prod/acme/backend" # By alias dome context use backend # By shorthand (workspace name) dome context use backend # By shorthand (tenant/workspace) dome context use acme/backend # By shorthand (org/tenant/workspace) dome context use prod/acme/backend ``` If the shorthand is ambiguous, an error lists the matching contexts. | Flag | Type | Description | | --------------------- | ---- | ------------------------------ | | `--interactive`, `-i` | bool | Interactively select a context | ## Sync contexts [#sync-contexts] ```bash dome context sync ``` Refresh contexts from server memberships. Fetches all org/tenant memberships and creates or updates local contexts with scoped session tokens. The refreshed contexts are written to the shared config file and become available to the MCP server. | Flag | Type | Description | | ---------- | ------ | ---------------------------------------------------------- | | `--server` | string | Sync only this server (default: all authenticated servers) | ## Rename context [#rename-context] ```bash dome context rename ``` Rename a context. ## Delete context [#delete-context] ```bash dome context delete ``` Delete a context. ## Create alias [#create-alias] ```bash dome context alias ``` Set or remove an alias for a context. Pass two args (context-name and alias) to set an alias. With `--remove`, pass a single arg (the alias to remove). | Flag | Type | Description | | ---------- | ---- | -------------------------------------------------------- | | `--remove` | bool | Remove the alias (pass the alias as the single argument) | # dome sessions (/cli/session/sessions) `dome sessions` manages where you are signed in to Dome: Dashboard browsers, CLI installations, and hosted Dome MCP clients. It requires a context created by `dome auth login`; platform API keys have no sessions. ## List sessions [#list-sessions] ```bash dome sessions list ``` Lists sessions newest first and marks the session used by this CLI as current. ## Revoke a session [#revoke-a-session] ```bash dome sessions revoke ``` Revoking a session ends every credential it holds. Revoking the current CLI session signs this CLI out; run `dome auth login` to use it again. ## Revoke every other session [#revoke-every-other-session] ```bash dome sessions revoke --others ``` This leaves the current CLI session active and signs you out everywhere else. ## Next steps [#next-steps] * [Configure Dome via MCP](/manage/mcp#manage-your-sessions) * [Sessions](/reference/mcp/sessions) MCP reference # dome config (/cli/settings/config) `dome config` reads platform configuration values, such as how long audit events are retained and how stale a registry entry may be before Dome refuses it. These are server-side settings; the command is read-only, and CLI session settings live under [`dome context`](/cli/session/context) instead. ## Get [#get] ```bash dome config get [key] ``` Get a configuration value by key. ```bash dome config get audit.retention_days dome config get registry.staleness_window ``` # dome enrollment-token (/cli/settings/enrollment-token) `dome enrollment-token` is not a shipped CLI command. Create and revoke device enrollment tokens from the dashboard. Refer to [Enroll Devices](/build/agents/devices). # dome orgs (/cli/settings/org) `dome orgs` manages governance settings for one organization. The current command surface selects the default and required Act-As verification providers inherited by its tenants and workspaces. | Command | | | --------------------------------------------------- | ------------------------ | | [Get Act-As selection](#get-act-as-selection) | `dome orgs actas get` | | [Update Act-As selection](#update-act-as-selection) | `dome orgs actas update` | ## Get Act-As selection [#get-act-as-selection] ```bash dome orgs actas get ``` Show the organization's default and required provider IDs. | Flag | Type | Required | Description | | ------- | ------ | -------- | ---------------------------------------------------------------- | | `--org` | string | No | Organization UUID. Defaults to the active context's organization | ## Update Act-As selection [#update-act-as-selection] ```bash dome orgs actas update \ --default-provider {{PROVIDER_ID}} \ --required-provider {{PROVIDER_ID}} ``` Set the organization's default or required provider. The provider must be organization-scoped. | Flag | Type | Description | | --------------------- | ------ | ---------------------------------------------------------------- | | `--org` | string | Organization UUID. Defaults to the active context's organization | | `--default-provider` | string | Default verification provider UUID | | `--required-provider` | string | Required verification provider UUID | This is a full replace: omitted provider flags clear their fields. An organization-level required provider forces Act-As for every non-bound agent in the organization and overrides required selections at tenant and workspace scope. Refer to [Act-As provider selection](/cli/connect/verification-providers#act-as-provider-selection) for inheritance and precedence. # dome platform-keys (/cli/settings/platform-keys) `dome platform-keys` manages the API keys that give users and CI pipelines programmatic access, and the permissions each key carries. For the keys an agent authenticates with instead, use [`dome agents create-key`](/cli/build/agents#create-key). | Command | | | --------------------------- | ---------------------------------------- | | [List keys](#list-keys) | `dome platform-keys list` | | [Create key](#create-key) | `dome platform-keys create` | | [Revoke key](#revoke-key) | `dome platform-keys revoke [name-or-id]` | | [Permissions](#permissions) | `dome platform-keys permissions` | ## List keys [#list-keys] ```bash dome platform-keys list ``` List platform API keys for the current workspace. ## Create key [#create-key] ```bash dome platform-keys create ``` Create a new platform API key. | Flag | Type | Required | Description | | --------------- | --------- | ----------- | ---------------------------------------------------------------------------------------------------------------- | | `--name` | string | Yes | Key name | | `--permissions` | string\[] | Conditional | Permissions to grant. Required in non-interactive mode; in an interactive terminal a picker is shown if omitted. | | `--expires-at` | string | No | Expiration time (RFC3339) | The interactive picker fetches the grantable permissions for your role at the current scope. Use [`dome platform-keys permissions`](#permissions) to discover the same list non-interactively. ## Revoke key [#revoke-key] ```bash dome platform-keys revoke [name-or-id] ``` Revoke a platform API key by name or ID. ## Permissions [#permissions] ```bash dome platform-keys permissions ``` List the permissions you can grant to a new platform API key at the current context's scope. The output is exactly what `dome platform-keys create --permissions` will accept for your role; the server re-validates on submit. Use this for CI scripts that need to know valid `--permissions` values, or to confirm what `create` would offer in its interactive picker. The scope follows your active context: a workspace context returns workspace permissions, a tenant context adds tenant permissions, and an org context adds org permissions on top. ```bash dome platform-keys permissions ``` ```bash dome platform-keys permissions --format json ``` > **Note**: Workspace admins do not see tenant-only permissions such as `agents.delete` or `agentkeys.manage` in this list. Switch to a tenant or org context (or have a tenant admin run the command) to grant them. # dome roles (/cli/settings/roles) `dome roles` manages the custom roles that you assign through membership commands. Built-in roles are fixed; a custom role is a named set of permissions at an organization, tenant, or workspace scope. | Command | | | --------------------------------- | -------------------------- | | [List roles](#list-roles) | `dome roles list` | | [Inspect a role](#inspect-a-role) | `dome roles get ` | | [Create a role](#create-a-role) | `dome roles create ` | | [Update a role](#update-a-role) | `dome roles update ` | | [Delete a role](#delete-a-role) | `dome roles delete ` | All commands accept `--scope workspace|tenant|org` (default `workspace`) and `--scope-id`. Without `--scope-id`, Dome uses the matching scope in the active context. ## List roles [#list-roles] ```bash dome roles list dome roles list --scope tenant ``` Lists built-in and custom roles, their permissions, and custom-role holder counts. ## Inspect a role [#inspect-a-role] ```bash dome roles get audit-reader ``` Shows one custom role's description, permission IDs, and assigned members. ## Create a role [#create-a-role] ```bash dome roles create audit-reader \ --permissions audit.view,rules.view \ --description "Read audit evidence and deployed rules" ``` Creating custom roles is an Enterprise capability. You can grant only permissions you already hold. ## Update a role [#update-a-role] ```bash dome roles update audit-reader \ --new-name audit-observer \ --permissions audit.view,rules.view ``` `--permissions` replaces the complete permission set. Renaming a role updates the assignment for every holder. ## Delete a role [#delete-a-role] ```bash dome roles delete audit-reader --reassign-to viewer ``` When a role has holders, choose `--reassign-to ` or `--remove-members`. You can override the bulk choice with repeated `--reassign-member email=role` or `--remove-member email`. A removal that would orphan a workspace requires `--reassign-admin` or `--delete-orphaned-workspaces`. ## Next steps [#next-steps] * [Manage Access](/manage/access) * [Roles](/reference/mcp/roles) MCP reference # dome tenant (/cli/settings/tenant) `dome tenant` manages governance settings for one tenant. The current command surface selects the default and required Act-As verification providers inherited by its workspaces. To list, inspect, or create tenants, use [`dome tenants`](/cli/settings/tenants). | Command | | | --------------------------------------------------- | -------------------------- | | [Get Act-As selection](#get-act-as-selection) | `dome tenant actas get` | | [Update Act-As selection](#update-act-as-selection) | `dome tenant actas update` | ## Get Act-As selection [#get-act-as-selection] ```bash dome tenant actas get ``` Show the tenant's default and required provider IDs. | Flag | Type | Required | Description | | ---------- | ------ | -------- | ---------------------------------------------------- | | `--tenant` | string | No | Tenant UUID. Defaults to the active context's tenant | ## Update Act-As selection [#update-act-as-selection] ```bash dome tenant actas update \ --default-provider {{PROVIDER_ID}} \ --required-provider {{PROVIDER_ID}} ``` Set the tenant's default or required provider. The provider must be tenant- or organization-scoped. | Flag | Type | Description | | --------------------- | ------ | ---------------------------------------------------- | | `--tenant` | string | Tenant UUID. Defaults to the active context's tenant | | `--default-provider` | string | Default verification provider UUID | | `--required-provider` | string | Required verification provider UUID | This is a full replace: omitted provider flags clear their fields. A required provider forces Act-As and pins every non-bound agent beneath the tenant to that provider. Refer to [Act-As provider selection](/cli/connect/verification-providers#act-as-provider-selection) for inheritance and precedence. # dome tenants (/cli/settings/tenants) `dome tenants` lists, inspects, and creates the tenants under your active organization. For the Act-As provider selection a single tenant carries, use [`dome tenant`](/cli/settings/tenant). List, get, and create are gated on the org-level `tenants.manage` permission (held by org `admin` or `owner`); `get` additionally admits any caller whose active session is scoped to the requested tenant. | Command | | | ------------------------------- | ------------------------------ | | [List tenants](#list-tenants) | `dome tenants list` | | [Get tenant](#get-tenant) | `dome tenants get ` | | [Create tenant](#create-tenant) | `dome tenants create` | ## List tenants [#list-tenants] ```bash dome tenants list ``` List tenants under your active organization. | Flag | Type | Required | Description | | ---------- | ------ | -------- | ------------------------------------------------------ | | `--org-id` | string | No | Target org UUID. Defaults to the active context's org. | **Permission:** Org-level `tenants.manage` (held by org `owner` or `admin`). ```bash title="List tenants in the active org" dome tenants list ``` ```bash title="Target a specific org" dome tenants list --org-id 7d2c… ``` Output is a table of `ID`, `NAME`, `PLAN`, and `CREATED`. Pass `--format json` for the raw response. ## Get tenant [#get-tenant] ```bash dome tenants get ``` Get a single tenant by id. The caller is admitted if either (a) their active session is scoped to the requested tenant, or (b) they hold org `admin` or `owner` on the requested tenant's org. | Argument / Flag | Type | Required | Description | | --------------- | ------ | -------- | ------------------------------------------------------ | | `` | string | Yes | Tenant UUID | | `--org-id` | string | No | Target org UUID. Defaults to the active context's org. | **Permission:** Tenant-scoped session for the requested tenant **or** org-level `tenants.manage` on the requested tenant's org. ```bash title="Get a tenant in the active org" dome tenants get 5b1e… ``` ```bash title="Get a tenant from a specific org" dome tenants get 5b1e… --org-id 7d2c… ``` Output is a key/value table including ID, name, plan, org id, default gateway, join policy, and created timestamp. Pass `--format json` for the raw response. ## Create tenant [#create-tenant] ```bash dome tenants create ``` Create a new tenant under your active organization. The caller becomes the initial tenant admin. | Flag | Type | Required | Description | | --------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------- | | `--name` | string | Yes | Tenant display name | | `--plan` | string | No | Tenant plan: `essential` (default), `managed`, `enterprise`, `complete` | | `--join-policy` | string | No | How non-members join: `open`, `request`, or `invite_only`. Omit to take the server default (`invite_only`). | | `--org-id` | string | No | Target org UUID. Defaults to the active context's org. | **Permission:** Org-level `tenants.manage` on the org named in `--org-id` (held by org `owner` or `admin`). The permission check runs against the request's target org, not your active context — a caller authorized on org X cannot create a tenant in org Y by overriding `--org-id`. ```bash title="Create a tenant under the active org" dome tenants create --name acme-prod --plan managed ``` ```bash title="Create with an explicit join policy" dome tenants create --name acme-prod --plan managed --join-policy request ``` ```bash title="Target a specific org" dome tenants create --name acme-staging --org-id 7d2c… ``` The success line echoes the resolved join policy so you can verify what the server applied. Unknown values return `InvalidArgument`. See [Join policies](/manage/environments#join-policies) for what each value means. The `get` view surfaces the current Join Policy row. > **Note**: `dome tenants create` works directly after `dome auth login` — no prior `dome context use` is required. As long as `--org-id` (or the default active org) names an org you hold `tenants.manage` on, the request succeeds. > **Note**: Creating a new organization is operator-only. Contact Dome to provision a new org. # dome workspaces (/cli/settings/workspace) `dome workspaces` manages the workspaces in your active tenant and the settings each one carries: who belongs to it, whether agents must act for a verified end user, how long a cached policy decision stays valid, and which verification providers it recognizes. A workspace is the boundary every agent, tool, model, and rule lives inside. Refer to [Scopes](/concepts/platform/scopes) for how workspaces sit under tenants and organizations. | Command | | | --------------------------------------------- | ------------------------------------------------------------- | | [List workspaces](#list-workspaces) | `dome workspaces list` | | [Create workspace](#create-workspace) | `dome workspaces create` | | [Get workspace](#get-workspace) | `dome workspaces get ` | | [Delete workspace](#delete-workspace) | `dome workspaces delete ` | | [List members](#list-members) | `dome workspaces members list` | | [Set member](#set-member) | `dome workspaces members set` | | [Remove member](#remove-member) | `dome workspaces members remove` | | [Get act-as config](#get-act-as-config) | `dome workspaces actas get` | | [Update act-as config](#update-act-as-config) | `dome workspaces actas update` | | [Set freshness window](#set-freshness-window) | `dome workspaces set-freshness-window ` | | [List providers](#list-providers) | `dome workspaces verification-providers list` | | [Create provider](#create-provider) | `dome workspaces verification-providers create` | | [Delete provider](#delete-provider) | `dome workspaces verification-providers delete ` | ## Workspaces [#workspaces] ### List workspaces [#list-workspaces] ```bash dome workspaces list ``` List workspaces in the active tenant. Aliases: `ls`. ### Create workspace [#create-workspace] ```bash dome workspaces create ``` Create a new workspace. | Flag | Type | Required | Description | | --------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------- | | `--name` | string | Yes | Workspace display name | | `--join-policy` | string | No | How non-members join: `open`, `request`, or `invite_only`. Omit to take the server default (`invite_only`). | ```bash title="Create with an explicit join policy" dome workspaces create --name payments-team --join-policy request ``` The success line echoes the resolved policy so you can verify what the server applied. Unknown values return `InvalidArgument`. See [Join policies](/manage/environments#join-policies) for what each value means. ### Get workspace [#get-workspace] ```bash dome workspaces get ``` Get workspace details. The output includes the configured `Freshness Window` — how long the gateway may serve cached policy for the workspace before failing closed — and the current `Join Policy`. ### Delete workspace [#delete-workspace] ```bash dome workspaces delete ``` Delete a workspace permanently. ## Members [#members] ### List members [#list-members] ```bash dome workspaces members list [workspace-id-or-slug] ``` List workspace memberships. ### Set member [#set-member] ```bash dome workspaces members set [workspace-id-or-slug] ``` Set a user's role in a workspace. | Flag | Type | Required | Description | | -------- | ------ | -------- | ----------------------------------------------- | | `--user` | string | Yes | User email | | `--role` | string | Yes | Role: `admin`, `operator`, `security`, `viewer` | ### Remove member [#remove-member] ```bash dome workspaces members remove [workspace-id-or-slug] ``` Remove a user's workspace membership. If the user has active API keys, an interactive picker prompts you to select which to revoke; pass `--revoke-all-keys` or `--revoke-keys` to skip the prompt. | Flag | Type | Required | Description | | ------------------- | --------- | -------- | -------------------------------------------------------------------------------------------------------------- | | `--user` | string | Yes | User email | | `--revoke-keys` | string\[] | No | Comma-separated API key IDs to revoke (skips interactive prompt). Mutually exclusive with `--revoke-all-keys`. | | `--revoke-all-keys` | bool | No | Revoke all API keys created by the user (skips interactive prompt). Mutually exclusive with `--revoke-keys`. | ## Act-as [#act-as] ### Get act-as config [#get-act-as-config] ```bash dome workspaces actas get [workspace-id-or-slug] ``` Get the act-as enforcement policy. ### Update act-as config [#update-act-as-config] ```bash dome workspaces actas update [workspace-id-or-slug] ``` Update the act-as enforcement policy. | Flag | Type | Description | | --------------------- | --------- | ---------------------------------------------------------------------- | | `--required` | bool | Require act-as header on all requests | | `--allowed-methods` | string\[] | Allowed verification methods (e.g., `oidc`, `hmac`) | | `--default-provider` | string | Default provider ID; nearest configured scope wins | | `--required-provider` | string | Required provider ID; broadest configured scope wins and forces Act-As | This command uses full-replace semantics. Omitted flags clear their fields. Default provider precedence is workspace, tenant, then organization. Required provider precedence is organization, tenant, then workspace. Required providers override explicit non-bound agent configuration; bound agents remain exempt. Tenant and organization scopes can also select default and required providers, but they do not set `--required` or `--allowed-methods`. Refer to [Act-As provider selection](/cli/connect/verification-providers#act-as-provider-selection) for all three scope commands and their precedence. ## Freshness window [#freshness-window] Each workspace has a configurable freshness window that bounds how long the gateway may serve cached authorization policy for that workspace before failing closed. Default is 90 seconds; allowed range is 30–86400 seconds. Enforcement is per-workspace — one workspace failing closed does not affect others. ### Set freshness window [#set-freshness-window] ```bash dome workspaces set-freshness-window [workspace-id-or-slug] ``` Set the freshness window (in seconds) for a workspace. | Argument | Type | Required | Description | | ------------------------ | ------ | -------- | --------------------------------------------------- | | `` | uint | Yes | Freshness window in seconds (30–86400) | | `[workspace-id-or-slug]` | string | No | Target workspace (defaults to the active workspace) | > **Warning**: Once the window elapses, the gateway denies governed requests until policy is fresh. The affected `tool.call` or `model.call` completes with `result=denied` and `denial.reason=stale_policy`; there is no separate staleness-denied event. ## Verification providers [#verification-providers] ### List providers [#list-providers] ```bash dome workspaces verification-providers list [workspace-id-or-slug] ``` List verification providers. Use the scope-aware command to inspect inherited providers: ```bash dome verification-providers list --scope workspace --include-chain dome verification-providers list --scope tenant dome verification-providers list --scope org ``` Plain workspace listing returns workspace-owned providers only. `--include-chain` also returns visible tenant- and organization-scoped providers. ### Create provider [#create-provider] ```bash dome workspaces verification-providers create [workspace-id-or-slug] ``` Create a verification provider. | Flag | Type | Required | Description | | ---------------------- | ------ | ----------- | ----------------------------------------------- | | `--name` | string | Yes | Provider name | | `--method` | string | Yes | Verification method: `oidc` or `hmac` | | `--oidc-discovery-url` | string | Conditional | OIDC issuer discovery URL (required for `oidc`) | | `--hmac-secret` | string | Conditional | HMAC shared secret (required for `hmac`) | ### Delete provider [#delete-provider] ```bash dome workspaces verification-providers delete [workspace-id-or-slug] ``` Delete a verification provider. Deleting a referenced provider removes its binding. Affected agents fail closed until another provider resolves. The CLI creates, updates, and deletes workspace-scoped providers only. Manage organization providers from **Settings → Single Sign-On**. Tenant-scoped provider writes are not exposed yet. These three are a convenience subset. Refer to [`dome verification-providers`](/cli/connect/verification-providers) for the scope-aware group, which also covers `get`, `update`, and server-minted HMAC secrets. # dome mcp (/cli/standalone/mcp) `dome mcp` serves the Dome Platform as MCP tools, so an AI assistant can run the same operations this CLI exposes. It authenticates as the active CLI context, which means the assistant is limited to what that session may already do. ## Serve [#serve] ```bash dome mcp serve ``` Start an MCP server on stdio. Exposes Dome Platform operations as tools for MCP clients. Authentication is read from the active CLI context. ### Setup [#setup] ```bash dome auth login dome mcp serve ``` Client registration is on the [MCP Server Reference](/reference/mcp#connect-a-client): Claude Code, Claude Desktop, Cursor, Codex, and any stdio MCP client. See the [MCP Server Reference](/reference/mcp) for the complete tool list organized by group. # dome version (/cli/standalone/version) `dome version` reports which build of the CLI you are running and can check whether a newer one is available. Include this output when reporting a problem. ## Version [#version] ```bash dome version ``` Show the dome CLI version, commit, build time, Go version, and OS/architecture. ```bash dome version ``` | Flag | Type | Description | | --------- | ---- | ------------------------- | | `--check` | bool | Check for a newer version | # Delegated agents (/build/agents/delegated)

{delegatedAgent}

## Overview [#overview] Your application sends the identity on each request as `X-Dome-Act-As`. Dome verifies it, then rules and audit can read `principal.act_as`. The agent still authenticates as itself. Act-As never replaces agent authentication. Delegated identity is optional configuration for an external or managed agent. Interactive agents receive a signed-in person's identity through [interactive access](/build/gateways/interactive-mcp-access) instead. This application-carried identity is separate from two other sign-in paths: * **Enterprise SSO** creates a platform session for Dome Dashboard and CLI administration. * **Interactive OAuth** lets a human MCP client ride one designated agent through one gateway. Interactive OAuth supplies the human identity from its own short-lived access token. Do not add `X-Dome-Act-As` to that client flow. For a request to authorize as a person, three things have to be true: 1. **Dome knows how to verify the person.** You point Dome at an IdP (OIDC) or a shared HMAC secret, either as a workspace verification provider or inline on the agent. You can also set a workspace floor that requires every agent to present verified Act-As and limits which methods are allowed. Both live on [Callers](/connect/callers). 2. **The agent is configured to act for people.** On the agent record you set the Act-As method, whether a person is required, which provider to use, and optional allow-lists. Do that when you [register](/build/agents/external#register-agent) or [update](/build/agents/external#change-end-user-identity) the agent. 3. **Your application sends who the person is.** Each request includes `X-Dome-Act-As`. Without it, rules have no end user to evaluate. Refer to [Pass identity for delegated agents](/develop#pass-identity-for-delegated-agents). Malformed or rejected headers never become Cedar claims. Method `none` explicitly accepts an unverified assertion and records that method. The agent credential still identifies the workload, and an end user cannot expand access beyond a higher-scope `forbid`. The typical workflow is: 1. [Create a verification provider](/connect/callers#create-a-verification-provider) on Callers, or inline OIDC/HMAC on the agent. 2. Configure Act-As on the agent when you [register](/build/agents/external#register-agent) or [update](/build/agents/external#change-end-user-identity) it. 3. Optionally [require verified identity](/connect/callers#require-verified-identity) for every agent in the workspace. 4. Write [claim-aware rules](#claim-aware-rules) that read `principal.act_as`. Claim names are on the [Rules](/reference/controls/rules#principal-attributes) reference. ### Verification methods [#verification-methods] Each agent chooses how Dome verifies the Act-As envelope. Your application must send a matching `X-Dome-Act-As` value on MCP, OpenAI, and Anthropic requests. | Method | How Dome verifies | What your application sends in `X-Dome-Act-As` | | --------- | ------------------------------------------------------------------------------- | -------------------------------------------------------------- | | `oidc` | Verify an end-user JWT through the provider's OpenID Connect discovery metadata | Raw end-user JWT | | `hmac` | Verify a signed identity header with a shared secret | Signed, timestamped act-as envelope | | `none` | Decode an unsigned assertion without cryptographic verification | Canonical JSON encoded with standard base64 (development only) | | `bound` | Server-bound enrollment identity with no client-supplied Act-As | No header. The platform supplies the enrolled user | | `session` | Verify the human through interactive OAuth | No header. The interactive access token supplies the identity | Prefer OIDC, bound, or session identity for production traffic. Agents can use a provider from the visible scope chain or inline OIDC/HMAC material. ### Identity claims [#identity-claims] Verified identity is exposed to Cedar as `principal.act_as`: | Claim | Description | | -------- | ---------------------------------- | | `sub` | Stable end-user subject identifier | | `email` | End-user email | | `roles` | End-user roles | | `groups` | End-user groups | | `claims` | Additional customer-defined claims | Attribute types for policy are also on the [Rules](/reference/controls/rules#principal-attributes) reference. ### Workspace floor [#workspace-floor] The workspace can require Act-As on every request and restrict which verification methods are allowed. That floor applies to every agent in the workspace. Agent settings can be stricter than the floor, but cannot weaken it. Set it on [Callers](/connect/callers#require-verified-identity). Providers can also be inherited: a workspace sees its own providers plus those from its tenant and organization, and Dome resolves one effective provider per agent. Refer to [Provider hierarchy](/connect/callers#provider-hierarchy). ### Where verified identity is consumed [#where-verified-identity-is-consumed] Verified identity can also: * Scope [Quotas](/govern/quotas) to an Act-As subject * Forward to upstream tools when a connection uses an Act-As egress header. Refer to [Tools](/connect/tools#change-egress-headers) and [Tools](/reference/resources/tools#egress-headers) reference * Drive per-user credentials on the [Tools](/reference/resources/tools#upstream-authentication) reference and [Models](/reference/resources/models#credentials) reference * Drive pool `match_when` conditions on `principal.act_as.*`. Refer to [Pools](/reference/resources/model-pools#pool-resolution) reference > **Warning**: Act-As egress does not rank verification methods again. It forwards the accepted assertion when the connection requests it. Set the required strength with workspace allowed methods or a required provider. A connection configured to forward Act-As still fails closed when the request has no accepted identity. The gateway never forwards the agent's own bearer token to the upstream service. ## Requirements [#requirements] Before you begin, authenticate to Dome and select a workspace. ### Permissions [#permissions] Per-agent Act-As configuration uses agent register permissions. Verification providers and the workspace floor use `config.manage` at their owning scope; those permissions are on [Callers](/connect/callers#permissions). | Default roles | Permission | Grants | | -------------------------------- | ------------------------- | --------------------------------------------------------------- | | `admin`, `operator`, `developer` | `agents.register` | Configure Act-As on an agent | | `admin`, `operator`, `security` | `rules.deploy` | Required with `agents.register` when setting Act-As allow-lists | | `admin`, `operator` | Workspace `config.manage` | Manage workspace providers and workspace Act-As enforcement | ## Configure verification [#configure-verification] Verification setup belongs to the caller, not the agent, so it lives on [Callers](/connect/callers): * [Create a verification provider](/connect/callers#create-a-verification-provider) — OIDC or HMAC, workspace-scoped and shareable across agents * [List](/connect/callers#list-verification-providers) and [delete](/connect/callers#delete-a-verification-provider) providers, including inherited tenant and organization providers * [require verified identity](/connect/callers#require-verified-identity) and restrict allowed methods for the whole workspace * [Select default and required providers](/connect/callers#select-default-and-required-providers) at workspace, tenant, or organization scope An agent can skip the shared provider entirely and carry inline OIDC or HMAC material instead. Set that with `--actas-oidc-url` or `--actas-hmac-secret` when you [register](/build/agents/external#register-agent) or [update](/build/agents/external#change-end-user-identity) the agent. ## Inspect observed callers [#inspect-observed-callers] Once delegated traffic flows, the [Callers](/connect/callers#inspect-callers) registry projects the accepted Act-As identities from audit evidence. Use it to find who appeared behind which agents, which verification methods were observed, and what activity is attributed to each person. ## Claim-aware Rules [#claim-aware-rules] Rules can require Act-As and test verified claims. When the workspace permits requests without Act-As, a rule that reads claims should test `principal has act_as` first. ```cedar title="end-user-access.cedar" permit( principal, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"customer-records" ) when { principal has act_as && principal.act_as.roles.contains("support") }; forbid( principal, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"production-deploy" ) unless { principal has act_as && principal.act_as.roles.contains("admin") }; ``` Refer to [Authorize Access](/govern/rules) for the rule lifecycle, [Rules](/reference/controls/rules#principal-attributes) reference for claim names, and the [authorization model](/concepts/architecture/authorization-model) concept for evaluation. ## Next steps [#next-steps] * [Callers](/connect/callers) to configure verification providers and inspect the people behind delegated traffic * [Configure Act-As on an agent](/build/agents/external#change-end-user-identity) for method, required flag, provider, and allow-lists * [Pass identity for delegated agents](/develop#pass-identity-for-delegated-agents) from your application * [Identity Patterns](/concepts/identity-patterns) concept for when to choose delegated vs standing identity * [Agent Identity](/concepts/agents/identity#act-as-identity) concept for tokens and act-as on the request path * [Simulate Rules](/govern/rules/simulate#simulate-with-agent-act-as) with representative Act-As claims before deploy # Enroll Devices (/build/agents/devices) **Device enrollment** binds approved hardware or workloads to a registered agent identity. Dome adds a device trust signal before a runtime requests governed resources. > **Note**: Device enrollment is available in limited preview. Contact your Dome representative to request access and confirm supported runtime environments. > **Warning**: The preview does not expose public CLI, MCP, or API enrollment operations. Do not automate enrollment against undocumented endpoints. ## Prepare the agent [#prepare-the-agent] Register the agent before requesting device enrollment. Record its agent ID, workspace, intended runtime, and deployment environment. Use a separate agent identity for each independently governed workload. Shared identities weaken device-level revocation and audit attribution. ## Request preview access [#request-preview-access] Send your Dome representative the following information: * Organization, tenant, and workspace names * agent name and agent ID * Runtime type and operating system * Deployment environment and region * Expected device count * Rotation and replacement requirements Preview access and supported attestation methods vary by deployment. Confirm support before changing production rollout plans. ## Complete enrollment [#complete-enrollment] Follow the enrollment instructions supplied with your preview access. Complete these tasks from the target runtime: 1. **Start enrollment**: Start the approved enrollment flow for the registered agent. 2. **Present device evidence**: Submit the attestation evidence required for your runtime type. 3. **Approve the binding**: Confirm the device, workspace, and agent identity before approval. 4. **Store runtime credentials**: Store issued material in the runtime's protected credential store. Never copy enrollment material between devices. Enroll replacement devices separately, then revoke the retired binding. ## Verify enrollment [#verify-enrollment] Confirm these properties before sending production traffic: * The device appears under the intended agent. * The workspace and environment match the deployment. * The binding reports an approved or active state. * A governed test request succeeds from the enrolled runtime. * The same request fails from an unenrolled runtime. Use [Develop](/develop) to configure runtime client authentication and gateway routing after enrollment. ## Replace or retire a device [#replace-or-retire-a-device] Enroll the replacement before removing the old binding. Validate the new runtime, then revoke the retired device. Treat a lost device as compromised. Revoke its device binding and rotate the agent's runtime credentials. ## Troubleshoot enrollment [#troubleshoot-enrollment] | Symptom | Check | | ------------------------------- | ---------------------------------------------------------- | | Enrollment is unavailable | Confirm preview access for the organization and workspace | | Evidence is rejected | Confirm the runtime and attestation method are supported | | Device binds to the wrong agent | Cancel enrollment and restart with the intended agent ID | | Runtime remains unauthorized | Confirm agent state, gateway grant, and client credentials | | Replacement cannot enroll | Confirm device limits and retire stale preview bindings | For agent state and key rotation, follow [Agents](/build/agents). For endpoint reachability, follow [Gateways](/build/gateways). # External agents (/build/agents/external)

{agent}

Refer to [Agents](/concepts/agents) concept for how agent identity works. ## Overview [#overview] An external agent runs in your own runtime. Registering it creates a durable identity for the application or process, but does not grant access. An API key lets the runtime authenticate as that identity. Allowed resources, gateway membership, and [Rules](/govern/rules) determine what requests Dome permits. Because credentials and access are separate, you can rotate a key without changing permissions or change permissions without issuing a new key. Configure [delegated identity](#delegated-identity) only when access must depend on the person the agent acts for. When one agent spawns others, set a [parent](#hierarchy) at registration time. For an external agent, the typical workflow is: 1. [Register the agent](#register-agent) to create the identity. 2. [Get the agent](#get-agent) to confirm the record and note the workspace gateway endpoint. 3. Allow the [resources](#allowed-resources) it needs. 4. [Create an API key](#create-key) for the runtime. 5. Point the client at Dome. Refer to [Develop](/develop#authenticate). ### Allowed resources [#allowed-resources] An agent reaches only the resources you allow it: model pools, individual models, MCP tools, and gateways. When an agent allows a gateway, Dome lets it use that endpoint. Allowing a resource is shorthand for creating a rule. Each entry generates a rule in the agent's rule bundle which the gateway enforces on the next request without a separate deploy. Because it creates rules, allowing a resource needs `rules.deploy` in addition to the permission to edit the agent, so someone with the developer role can register an agent and change its metadata but cannot change which resources it reaches. Each selection generates the actions it implies: | You allow | Actions Dome permits | | ------------------- | ---------------------------------------- | | model pool or model | `llm:invoke` | | tool | `mcp:call`, `mcp:discover` | | gateway | `llm:invoke`, `mcp:call`, `mcp:discover` | When the shorthand cannot express a condition, such as a time window, a PII field, or an act-as claim, create [Rules](/govern/rules) directly. A generated bundle adds to workspace defaults rather than replacing them. You can allow resources when you [register an agent](#register-agent) or [change them later](#change-allowed-resources). ### Delegated identity [#delegated-identity] An agent can act for a person rather than only for itself. When it presents an act-as claim, Dome verifies the claim before authorizing the request, and the audit trail records the end user alongside the agent. On the agent you choose the verification method (`oidc`, `hmac`, `bound`, or `none`), whether a claim is mandatory on every request, which provider to use, and optional allow-lists by group, email, or subject. An agent with no restrictions accepts any verified identity. Like allowed resources, these settings generate rules, so changing them needs `rules.deploy`. Workspace providers, the workspace floor, and claim-aware rules are on [Delegated agents](/build/agents/delegated). You can configure per-agent settings when you [register](#register-agent) or [update](#change-end-user-identity) the agent. ### Hierarchy [#hierarchy] An agent can have a parent. The parent and its descendants form a hierarchy, which helps when one agent spawns or manages others and you want to act on them together. A hierarchy grants no access on its own, and each agent reaches only what you allow it. A hierarchy can be at most 10 levels deep, and a parent and child must belong to the same tenant. You can set an agent's parent when you [register](#register-agent) it. An update cannot change it afterward. How lifecycle operations reach descendants is under [Manage lifecycle](#manage-lifecycle). ### Token lifetime [#token-lifetime] Each agent carries its own access-token lifetime. Set it on [register](#register-agent) or [update](#update-agent) with `--token-ttl` (CLI) or `token_ttl` (MCP and API), as a duration such as `15m`. The default is `10m` and the accepted range is `1m` to `24h`. Shorten the lifetime for ephemeral jobs. Lengthen it only when refresh overhead justifies the larger exposure window. Clearing the value returns the agent to the `10m` default. ## Requirements [#requirements] Before you begin: * Install and authenticate the Dome CLI, then select a workspace context * Create or select a [Gateway](/build/gateways), attach the required resources, and grant the agent access ### Permissions [#permissions] Agent registry, lifecycle, and key operations require platform permissions. Each operation states the permission it requires. For exhaustive flags, tool parameters, and endpoint contracts, refer to the [CLI](/cli/build/agents), [MCP](/reference/mcp/agents), and [API](/api/tag/agents/register-agent) references. | Default roles | Permission | Grants | | -------------------------------------------- | ------------------ | ---------------------------------------------------------------------- | | All workspace roles | `agents.view` | Get and list agents and keys | | `admin`, `operator`, `developer` | `agents.register` | Register and update agents | | `admin`, `operator`, `security`, `developer` | `agents.suspend` | Suspend and reactivate agents | | `admin`, `operator`, `developer` | `agents.revoke` | Revoke agents | | `admin`, `operator` | `agents.delete` | Delete agents | | `admin`, `operator`, `developer` | `agentkeys.manage` | Create, rotate, or revoke agent keys | | `admin`, `operator`, `security` | `rules.deploy` | Change allowed resources or end-user identity (with `agents.register`) | | All workspace roles | `rules.view` | View generated rule bundles | ## Register agent [#register-agent] Register an agent to create the record that credentials, allowed resources, and lifecycle operations attach to. You can set [allowed resources](#allowed-resources), [end-user identity](#delegated-identity), a [parent](#hierarchy), and a [token lifetime](#token-lifetime) in the same call. > **Note**: Requires `agents.register`, plus `rules.deploy` if you set allowed resources or end-user identity in the same call. **CLI** ```bash dome agents register \ --name "data-pipeline-agent" ``` Add `--parent-id` to place the agent in a hierarchy, `--metadata key=value` for your own labels, `--token-ttl 15m` to override the default token lifetime, and `--if-not-exists` to return the existing agent instead of failing when the name is taken. > **Note**: Reference: [`dome agents register`](/cli/build/agents#register-agent) **MCP** Tool: `dome_agents_register` ```json { "name": "data-pipeline-agent" } ``` > **Note**: Reference: [`dome_agents_register`](/reference/mcp/agents#agents-register) **API** ```http POST /v1/agents Content-Type: application/json { "name": "data-pipeline-agent", "workspace_id": "{{WORKSPACE_ID}}" } ``` > **Note**: Reference: [`RegisterAgent`](/api/tag/agents/register-agent) **Agent** ```text title="Register an agent" Register an agent named "data-pipeline-agent". ``` ```json Response { "id": "a1b2c3d4-...", "name": "data-pipeline-agent", "status": "provisioned" } ``` A new agent starts in `provisioned` and becomes `active` on its first gateway request. Refer to [Manage lifecycle](#manage-lifecycle) for the full state model. ### Register from a file [#register-from-a-file] Register an agent from a YAML or JSON file when a reviewable definition is clearer than a long flag list, such as in CI. The file shape mirrors `RegisterAgentRequest`, the same schema the SDKs and Terraform provider consume, so a misspelled field fails fast instead of dropping silently. The workspace always comes from the active context. A `workspace_id` in the file is ignored. ```yaml agent.yaml name: data-pipeline-agent allowed_pool_names: [openai-prod] allowed_tools: [github/list_repos] ``` ```bash dome agents register --file agent.yaml ``` > **Note**: Reference: [`dome agents register --file`](/cli/build/agents#register-from-a-file) ## Update agent [#update-agent] Update an agent to change its metadata or [token lifetime](#token-lifetime). Only the fields you send change, and list fields replace rather than merge. > **Note**: Requires `agents.register`. **CLI** ```bash dome agents update data-pipeline-agent \ --metadata environment=production \ --token-ttl 15m ``` Passing `--token-ttl ""` resets the agent to the `10m` default. > **Note**: Reference: [`dome agents update`](/cli/build/agents#update-agent) **MCP** Tool: `dome_agents_update` ```json { "agent_id": "data-pipeline-agent", "metadata": { "environment": "production" }, "token_ttl": "15m" } ``` > **Note**: Reference: [`dome_agents_update`](/reference/mcp/agents#agents-update) **API** ```http PATCH /v1/agents/{{AGENT_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "metadata": { "environment": "production" } } ``` > **Note**: Reference: [`UpdateAgent`](/api/tag/agents/update-agent) **Agent** ```text title="Update an agent" Update agent "data-pipeline-agent" to add metadata environment=production. ``` ### Change allowed resources [#change-allowed-resources] You can change which pools, models, tools, and gateways the agent may reach. Refer to [Allowed resources](#allowed-resources) for what these grants mean. When you allow models, a pool is usually the better choice than an individual model, because a pool can [fail over and load-balance](/connect/pools). > **Note**: Requires `agents.register` and `rules.deploy`, because every change regenerates the agent's rule bundle. **CLI** ```bash dome agents update data-pipeline-agent \ --pool "gpt-4-prod" \ --tool "github/list-issues" \ --tool "github/create-comment" \ --gateway "{{GATEWAY_ID}}" ``` Tool names take the form `/`. When a pool is not appropriate, `--model` allows a specific model connection. > **Note**: Reference: [`dome agents update`](/cli/build/agents#update-agent) **MCP** Tool: `dome_agents_update` ```json { "agent_id": "data-pipeline-agent", "allowed_pool_names": ["gpt-4-prod"], "allowed_tools": ["github/list-issues", "github/create-comment"] } ``` > **Note**: Reference: [`dome_agents_update`](/reference/mcp/agents#agents-update) **API** ```http PATCH /v1/agents/{{AGENT_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "allowed_pool_names": ["gpt-4-prod"], "allowed_direct_model_names": [], "allowed_tools": ["github/list-issues", "github/create-comment"] } ``` > **Note**: Reference: [`UpdateAgent`](/api/tag/agents/update-agent) **Agent** ```text title="Change allowed resources" Restrict agent "data-pipeline-agent" to pool "gpt-4-prod" and tools github/list-issues and github/create-comment. ``` When you change one of these fields, the value you send replaces the existing list rather than merging into it, so a partial list drops whatever it omits and an empty value clears the list. API clients may use the canonical ID forms `allowed_pool_ids`, `allowed_direct_model_ids`, and `allowed_tool_ids`; they have the same `rules.deploy` requirement as the name forms, including during registration. Supply names or IDs rather than conflicting versions of both. In the dashboard, the agent detail page hides the edit control on Delegation when the caller lacks `rules.deploy`, and the edit form shows a banner explaining the limit. The generated rules propagate through rule sync. Until an agent's generated rules match its saved access configuration, Dome withholds the affected gateway admission rather than applying a partial grant. ### Change end-user identity [#change-end-user-identity] You can also change how Dome verifies the end user an agent acts for, and which identities it may present. Refer to [Delegated identity](#delegated-identity) and [Delegated agents](/build/agents/delegated) for providers and the workspace floor. > **Note**: Requires `agents.register` and `rules.deploy`. | Setting | Flag | | ------------------------------- | --------------------------------------------------------------------------- | | Verification method | `--actas-method` (`none`, `oidc`, `hmac`, or `bound`) | | Mandatory claim | `--actas-required` | | Workspace provider | `--actas-provider` | | Inline OIDC or HMAC credentials | `--actas-oidc-url`, `--actas-hmac-secret` | | Acceptable identities | `--actas-allowed-group`, `--actas-allowed-email`, `--actas-allowed-subject` | **CLI** ```bash dome agents update support-bot \ --actas-method oidc \ --actas-required \ --actas-allowed-group "support-engineers" ``` > **Note**: Reference: [`dome agents update`](/cli/build/agents#update-agent) **MCP** Tool: `dome_agents_update` ```json { "agent_id": "support-bot", "actas_method": "oidc", "actas_required": true, "actas_allowed_groups": ["support-engineers"] } ``` > **Note**: Reference: [`dome_agents_update`](/reference/mcp/agents#agents-update) **API** ```http PATCH /v1/agents/{{AGENT_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "actas_method": "oidc", "actas_required": true, "actas_allowed_groups": ["support-engineers"] } ``` > **Note**: Reference: [`UpdateAgent`](/api/tag/agents/update-agent) **Agent** ```text title="Require verified end-user identity" Require OIDC-verified act-as identity on agent "support-bot" and allow only the support-engineers group. ``` Populating an acceptable-identity list denies any request whose verified claim is not on the list. Leaving all three empty accepts any verified identity, and workspace-level act-as enforcement still applies. ## Get agent [#get-agent] Retrieve an agent by name or UUID. Before you configure a runtime, you should retrieve an agent's information to confirm its status and the endpoint its traffic should reach. > **Note**: Requires `agents.view`. Agent credentials cannot list the workspace roster, even when the agent can read its own record by ID. Use a platform user or platform key with `agents.view` for this operation. **CLI** ```bash dome agents get data-pipeline-agent ``` > **Note**: Reference: [`dome agents get`](/cli/build/agents#get-agent) **MCP** Tool: `dome_agents_get` ```json { "agent_id": "{{AGENT_ID}}", "gateway_id": "{{GATEWAY_ID}}" } ``` > **Note**: Reference: [`dome_agents_get`](/reference/mcp/agents#agents-get) **API** ```http GET /v1/agents/{{AGENT_ID}}?workspace_id={{WORKSPACE_ID}}&gateway_id={{GATEWAY_ID}} ``` > **Note**: Reference: [`GetAgent`](/api/tag/agents/get-agent) **Agent** ```text title="Get an agent" Get "data-pipeline-agent" for Gateway "{{GATEWAY_ID}}" and confirm its status and connection endpoints. ``` When `gateway_id` is supplied, the response includes the agent record and that accessible gateway's complete protocol endpoints. Omit it for metadata only. ```json Response { "agent": { "id": "a1b2c3d4-…", "name": "data-pipeline-agent", "status": "active" }, "gateway_id": "{{GATEWAY_ID}}", "gateway_endpoints": { "gateway_id": "{{GATEWAY_ID}}", "gateway_url": "https://gateway.example.dome.dev/gateways/{{GATEWAY_ID}}", "mcp_url": "https://gateway.example.dome.dev/gateways/{{GATEWAY_ID}}/mcp", "openai_base_url": "https://gateway.example.dome.dev/gateways/{{GATEWAY_ID}}/v1", "anthropic_base_url": "https://gateway.example.dome.dev/gateways/{{GATEWAY_ID}}" } } ``` The dashboard shows the same pair on the agent detail page's Identity card, each with a copy button. ## List agents [#list-agents] Retrieve a list of agents in a workspace. You can narrow the results by filtering on status, such as to find every suspended agent. > **Note**: Requires `agents.view`. **CLI** ```bash dome agents list --status active ``` A list returns 100 agents unless `--limit` says otherwise. > **Note**: Reference: [`dome agents list`](/cli/build/agents#list-agents) **MCP** Tool: `dome_agents_list` ```json { "status": "active", "limit": 25 } ``` `offset` pages through results beyond the limit. > **Note**: Reference: [`dome_agents_list`](/reference/mcp/agents#agents-list) **API** ```http GET /v1/agents?workspace_id={{WORKSPACE_ID}}&status=active ``` > **Note**: Reference: [`ListAgents`](/api/tag/agents/list-agents) **Agent** ```text title="List agents" List the active agents in this workspace. ``` ## Manage lifecycle [#manage-lifecycle] An agent moves through four states. Provisioned and active agents can send traffic. Suspended and revoked agents are denied. | State | Traffic | How it leaves this state | | ------------- | ------- | ------------------------------------------------------------------------------ | | `provisioned` | Allowed | Becomes `active` automatically on the first gateway request | | `active` | Allowed | An operator [suspends](#suspend) or [revokes](#revoke) it | | `suspended` | Denied | An operator [reactivates](#reactivate) or [revokes](#revoke) it | | `revoked` | Denied | Terminal. You can [delete](#delete) the record, but you cannot undo revocation | When agents are in a [hierarchy](#hierarchy), lifecycle operations reach descendants differently: | Operation | Reach | | ---------- | ----------------------------------------------------------------------------------- | | Suspend | The agent alone, or the agent plus its active descendants when you pass `--cascade` | | Reactivate | The agent alone. Undoing a cascaded suspension takes one call per agent | | Revoke | The agent and every descendant, always, depth-first, any state | | Delete | The agent alone, or the agent plus its descendants when you request a cascade | Parent and child must already share a tenant. Hierarchy does not grant access. Full transition detail is on the [Agent Lifecycle](/concepts/agents/agent-lifecycle) concept. ### Suspend [#suspend] Suspend an agent to deny its requests until you reactivate it. Suspension is reversible. With cascade, it also suspends active descendants. > **Note**: Requires `agents.suspend`. **CLI** ```bash dome agents suspend data-pipeline-agent --reason "maintenance window" ``` > **Note**: Reference: [`dome agents suspend`](/cli/build/agents#suspend-agent) **MCP** Tool: `dome_agents_suspend` ```json { "agent_id": "data-pipeline-agent", "reason": "maintenance window", "cascade": false } ``` > **Note**: Reference: [`dome_agents_suspend`](/reference/mcp/agents#agents-suspend) **API** ```http POST /v1/agents/{{AGENT_ID}}/suspend Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "reason": "maintenance window" } ``` > **Note**: Reference: [`SuspendAgent`](/api/tag/agents/suspend-agent) **Agent** ```text title="Suspend an agent" Suspend agent "data-pipeline-agent" for a maintenance window. ``` ### Reactivate [#reactivate] Reactivate a suspended agent to restore its traffic. Reactivation applies only to an agent in the `suspended` state, and it covers one agent, so a cascaded suspension takes one reactivation per agent. > **Note**: Requires `agents.suspend`. **CLI** ```bash dome agents reactivate data-pipeline-agent ``` > **Note**: Reference: [`dome agents reactivate`](/cli/build/agents#reactivate-agent) **MCP** Tool: `dome_agents_reactivate` ```json { "agent_id": "data-pipeline-agent" } ``` > **Note**: Reference: [`dome_agents_reactivate`](/reference/mcp/agents#agents-reactivate) **API** ```http POST /v1/agents/{{AGENT_ID}}/reactivate Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}" } ``` > **Note**: Reference: [`ReactivateAgent`](/api/tag/agents/reactivate-agent) **Agent** ```text title="Reactivate an agent" Reactivate agent "data-pipeline-agent". ``` ### Revoke [#revoke] Revoke an agent to decommission it permanently. Its record and audit history remain readable. > **Note**: Requires `agents.revoke`. > **Warning**: Revocation cannot be reversed and always cascades to every descendant agent. **CLI** ```bash dome agents revoke data-pipeline-agent --reason "decommissioned" ``` > **Note**: Reference: [`dome agents revoke`](/cli/build/agents#revoke-agent) **MCP** Tool: `dome_agents_revoke` ```json { "agent_id": "data-pipeline-agent", "reason": "decommissioned" } ``` > **Note**: Reference: [`dome_agents_revoke`](/reference/mcp/agents#agents-revoke) **API** ```http POST /v1/agents/{{AGENT_ID}}/revoke Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "reason": "decommissioned" } ``` > **Note**: Reference: [`RevokeAgent`](/api/tag/agents/revoke-agent) ### Delete [#delete] Delete a revoked agent to remove it and all of its data. Deletion works only on a revoked agent and rejects an agent in any other state. > **Note**: Requires `agents.delete`. > **Warning**: Deletion removes the agent record and its data irreversibly, including its keys. Revoke instead when you need the record retained. **CLI** ```bash dome agents delete data-pipeline-agent --reason "offboarded" ``` Deletion covers one agent, and it fails when that agent still has descendants. Adding `--cascade` deletes the agent and its descendants in one call, deepest first, and every descendant must already be revoked. ```bash dome agents delete data-pipeline-agent --cascade ``` > **Note**: Reference: [`dome agents delete`](/cli/build/agents#delete-agent) **MCP** Tool: `dome_agents_delete` ```json { "agent_id": "data-pipeline-agent", "reason": "offboarded", "cascade": false } ``` > **Note**: Reference: [`dome_agents_delete`](/reference/mcp/agents#agents-delete) **API** ```http DELETE /v1/agents/{{AGENT_ID}}?workspace_id={{WORKSPACE_ID}}&reason=offboarded ``` > **Note**: Reference: [`DeleteAgent`](/api/tag/agents/delete-agent) ## Manage API keys [#manage-api-keys] An API key is the credential the agent runtime presents to Dome. An agent can hold several keys, so you can rotate a credential or keep one key per environment. Keys scope to the agent's tenant and workspace. > **Note**: Requires `agentkeys.manage` to create, rotate, or revoke a key, and `agents.view` to list them. > **Warning**: The token is returned once, when you create or rotate a key. Store it immediately, because it cannot be retrieved again. ### Create key [#create-key] Create a key to receive the one-time `token`, selected `gateway_id`, and complete `gateway_endpoints`. Supply a gateway when the agent can access more than one. **CLI** ```bash dome agents create-key data-pipeline-agent --name "default" --gateway "{{GATEWAY_ID}}" ``` > **Note**: Reference: [`dome agents create-key`](/cli/build/agents#create-key) **MCP** Tool: `dome_agents_create_key` ```json { "agent": "data-pipeline-agent", "name": "default", "gateway_id": "{{GATEWAY_ID}}" } ``` > **Note**: Reference: [`dome_agents_create_key`](/reference/mcp/agents#agents-create-key) **API** ```http POST /v1/agents/{{AGENT_ID}}/keys Content-Type: application/json { "name": "default", "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}" } ``` > **Note**: Reference: [`CreateAgentKey`](/api/tag/agents/create-agent-key) **Agent** ```text title="Create an API key" Create an API key named "default" for agent "data-pipeline-agent" using Gateway "{{GATEWAY_ID}}". ``` ```json Response { "token": "dome_…", "key": { "id": "k_…", "name": "default", "createdAt": "…" }, "gateway_id": "{{GATEWAY_ID}}", "gateway_endpoints": { "gateway_id": "{{GATEWAY_ID}}", "gateway_url": "https://gateway.example.dome.dev/gateways/{{GATEWAY_ID}}", "mcp_url": "https://gateway.example.dome.dev/gateways/{{GATEWAY_ID}}/mcp", "openai_base_url": "https://gateway.example.dome.dev/gateways/{{GATEWAY_ID}}/v1", "anthropic_base_url": "https://gateway.example.dome.dev/gateways/{{GATEWAY_ID}}" } } ``` A separate key for each runtime or environment lets you revoke one without disrupting the others. ### List keys [#list-keys] Retrieve an agent's active keys with their names and creation times. A list never returns tokens, because Dome returns a token only when you create or rotate a key. **CLI** ```bash dome agents list-keys data-pipeline-agent ``` > **Note**: Reference: [`dome agents list-keys`](/cli/build/agents#list-keys) **MCP** Tool: `dome_agents_list_keys` ```json { "agent": "data-pipeline-agent" } ``` > **Note**: Reference: [`dome_agents_list_keys`](/reference/mcp/agents#agents-list-keys) **API** ```http GET /v1/agents/{{AGENT_ID}}/keys?workspace_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`ListAgentKeys`](/api/tag/agents/list-agent-keys) **Agent** ```text title="List an agent's API keys" List the API keys for agent "data-pipeline-agent". ``` ### Rotate key [#rotate-key] Rotate a key to revoke the old secret and issue a new one under the same name. Dome returns the new token and the gateway endpoint. The old secret stops authenticating as soon as you rotate, so deploy the new token promptly. **CLI** ```bash dome agents rotate-key data-pipeline-agent production ``` > **Note**: Reference: [`dome agents rotate-key`](/cli/build/agents#rotate-key) **MCP** Tool: `dome_agents_rotate_key` ```json { "agent": "data-pipeline-agent", "key_name": "production" } ``` > **Note**: Reference: [`dome_agents_rotate_key`](/reference/mcp/agents#agents-rotate-key) **API** ```http POST /v1/agents/{{AGENT_ID}}/keys/production/rotate Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}" } ``` > **Note**: Reference: [`RotateAgentKey`](/api/tag/agents/rotate-agent-key) **Agent** ```text title="Rotate an agent key" Rotate the "production" API key for "data-pipeline-agent". ``` ### Revoke key [#revoke-key] Revoke a key to retire it without affecting the agent's other keys. A revoked key stops authenticating immediately, so confirm the runtime holds a working key before you revoke this one. **CLI** ```bash dome agents revoke-key data-pipeline-agent production ``` > **Note**: Reference: [`dome agents revoke-key`](/cli/build/agents#revoke-key) **MCP** Tool: `dome_agents_revoke_key` ```json { "agent": "data-pipeline-agent", "key_name": "production" } ``` > **Note**: Reference: [`dome_agents_revoke_key`](/reference/mcp/agents#agents-revoke-key) **API** ```http DELETE /v1/agents/{{AGENT_ID}}/keys/production?workspace_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`RevokeAgentKey`](/api/tag/agents/revoke-agent-key) **Agent** ```text title="Revoke an agent key" Revoke the "production" API key for agent "data-pipeline-agent". ``` ## Manage agent-scoped rules [#manage-agent-scoped-rules] Agent-scope rules apply to one agent, for conditions [allowed resources](#allowed-resources) cannot express. They evaluate in addition to organization, tenant, and workspace rules, and a deny at the workspace scope overrides an allow at the agent scope. Refer to [Authorize Access](/govern/rules) for creating rules, inherited scopes, and deployment. ### Assign rules [#assign-rules] Assign rule files to the agent scope, where the gateway evaluates them alongside the rules the agent inherits from higher scopes. > **Note**: Requires `rules.deploy`. **CLI** ```bash dome agents assign-policy data-pipeline-agent agent-policy.cedar ``` > **Note**: Reference: [`dome agents assign-policy`](/cli/build/agents#assign-policy) **MCP** Tool: `dome_agents_assign_policy` ```json { "agent_id": "data-pipeline-agent", "files": [ { "name": "agent-policy.cedar", "content": "permit(principal, action == Dome::Action::\"mcp:call\", resource == Dome::MCPTool::\"github/list-issues\");" } ] } ``` > **Note**: Reference: [`dome_agents_assign_policy`](/reference/mcp/rules#agents-assign-policy) **Agent** ```text title="Assign agent-scoped rules" Assign the rules in agent-policy.cedar to agent "data-pipeline-agent". ``` ### View rules [#view-rules] Retrieve the rules assigned at the agent scope. The result excludes the organization, tenant, and workspace rules the agent also inherits. > **Note**: Requires `rules.view`. **CLI** ```bash dome agents get-policies data-pipeline-agent ``` > **Note**: Reference: [`dome agents get-policies`](/cli/build/agents#get-policies) **MCP** Tool: `dome_agents_get_policies` ```json { "agent_id": "data-pipeline-agent" } ``` > **Note**: Reference: [`dome_agents_get_policies`](/reference/mcp/rules#agents-get-policies) **Agent** ```text title="View agent-scoped rules" Show the rules currently assigned to agent "data-pipeline-agent". ``` ## Next steps [#next-steps] * [Delegated agents](/build/agents/delegated) when access must depend on the person * [Tools](/connect/tools) and [Models](/connect/models) an agent can call * [Gateways](/build/gateways) for membership and grants * [Develop](/develop#authenticate) to authenticate and route runtime traffic * [Agent Lifecycle](/concepts/agents/agent-lifecycle) concept for states and cascades # Agents (/build/agents)

{agent}

Refer to [Agents](/concepts/agents) concept for how agent identity works. ## Overview [#overview] Dome separates an agent's identity from its credentials and access. Registering an agent creates a durable identity for the application or process, but does not grant access. An API key lets the runtime authenticate as that identity. Allowed resources, gateway membership, and [rules](/govern/rules) determine what requests Dome permits. Because credentials and access are separate, you can rotate a key without changing permissions or change permissions without issuing a new key. ## Agent types [#agent-types] Dome has three agent types: * An **external agent** runs in your own runtime. Register it on [External agents](/build/agents/external), then issue the credentials that let it call Dome. * A **managed agent** runs on Dome. Configure its prompt, model, gateway, and triggers on [Managed agents](/build/agents/managed). * An **interactive agent** is system-provisioned for signed-in human gateway traffic. Configure it through [Interactive access](/build/gateways/interactive-mcp-access). External and managed agents use the same agent identity, gateway grants, rules, lifecycle, and audit trail. Choose between them based on where the worker should run, not on the permissions it needs. * [External agent](/build/agents/external): Register and operate an agent that runs in your own runtime. * [Managed agent](/build/agents/managed): Configure an agent that Dome runs from a prompt, model, gateway, and triggers. For external and managed agents, configure [delegated identity](/build/agents/delegated) only when access must depend on the person the agent acts for. Interactive agents receive the signed-in person's identity through interactive access. When one agent spawns others, set a [parent](#hierarchy) at registration time. ## Allowed resources [#allowed-resources] An agent reaches only the resources you allow it: model pools, individual models, MCP tools, and gateways. When an agent allows a gateway, Dome lets it use that endpoint. Allowing a resource is shorthand for creating a rule. Each entry generates a rule in the agent's rule bundle, which the gateway enforces on the next request without a separate deploy. Because it creates rules, allowing a resource needs `rules.deploy` in addition to permission to edit the agent. This lets a developer register an agent and change its metadata without changing which resources it reaches. Each selection generates the actions it implies: | You allow | Actions Dome permits | | ------------------- | ---------------------------------------- | | model pool or model | `llm:invoke` | | tool | `mcp:call`, `mcp:discover` | | gateway | `llm:invoke`, `mcp:call`, `mcp:discover` | When the shorthand cannot express a condition, such as a time window, a PII field, or an act-as claim, create [rules](/govern/rules) directly. A generated bundle adds to workspace defaults rather than replacing them. You can set allowed resources while registering or updating an agent. ## Delegated identity [#delegated-identity] An agent can act for a person rather than only for itself. When it presents an act-as claim, Dome verifies the claim before authorizing the request, and the audit trail records the end user alongside the agent. On the agent you choose the verification method (`oidc`, `hmac`, `bound`, or `none`), whether a claim is mandatory on every request, which provider to use, and optional allow-lists by group, email, or subject. An agent with no restrictions accepts any verified identity. Like allowed resources, these settings generate rules, so changing them needs `rules.deploy`. Workspace providers, the workspace floor, and claim-aware rules are on [Delegated agents](/build/agents/delegated). You can configure per-agent settings while registering or updating an agent. ## Hierarchy [#hierarchy] An agent can have a parent. The parent and its descendants form a hierarchy, which helps when one agent spawns or manages others and you want to act on them together. A hierarchy grants no access on its own, and each agent reaches only what you allow it. A hierarchy can be at most 10 levels deep, and a parent and child must belong to the same tenant. You can set an agent's parent while registering it. An update cannot change it afterward. How lifecycle operations reach descendants is under [Agent lifecycle](/concepts/agents/agent-lifecycle). ## Token lifetime [#token-lifetime] Each agent carries its own access-token lifetime. Set it while registering or updating the agent with `--token-ttl` (CLI) or `token_ttl` (MCP and API), as a duration such as `15m`. The default is `10m`, and the accepted range is `1m` to `24h`. Shorten the lifetime for ephemeral jobs. Lengthen it only when refresh overhead justifies the larger exposure window. Clearing the value returns the agent to the `10m` default. ## Next steps [#next-steps] * [External agents](/build/agents/external) to register an agent you run. * [Managed agents](/build/agents/managed) to configure an agent Dome runs. * [Delegated agents](/build/agents/delegated) when access must depend on the person the agent acts for. * [Tools](/connect/tools) and [Models](/connect/models) an agent can call. * [gateways](/build/gateways) for membership and grants. * [Develop](/develop) to authenticate and route runtime traffic. * [Agent lifecycle](/concepts/agents/agent-lifecycle) concept for states and cascades. * [Agent concepts](/concepts/agents) for the identity and authorization model. # Managed agents (/build/agents/managed) Run managed agents in Dome without operating a worker. Configure their prompt, model, gateway, and triggers, then start runs manually, on a schedule, or through signed webhooks. ## Overview [#overview] A managed agent is one of Dome's three agent types. Dome runs its execution worker; an external agent runs in your own runtime, and an interactive agent represents signed-in human gateway traffic. A managed agent's configuration has four parts: | You configure | Dome uses it for | | --------------------------- | ----------------------------------------- | | System prompt | Persistent instructions for each run | | model or pool | The model the worker invokes | | gateway | The models and tools the worker can reach | | [Triggers](/build/triggers) | When Dome starts a run | The managed agent keeps its ordinary identity, gateway grant, rules, lifecycle, and audit behavior. Dome holds the runner credential; it is never returned to you. The typical workflow is: 1. [Register the agent](#register-agent) with its prompt, model, and gateway. 2. Choose how to start work: * [Run the agent directly](#run-managed-agent) for an ad hoc task, test, or debugging session. * Create a [schedule](/build/triggers#create-schedule) or [signed webhook](/build/triggers#create-signed-webhook) when work should start automatically. [Fire a trigger](/build/triggers#fire-a-trigger) on demand. 3. [Inspect runs](#inspect-managed-agent-run) and adjust the configuration when needed. 4. [Manage the lifecycle](#manage-lifecycle) when the worker must stop everywhere. ## Requirements [#requirements] Before you begin: * Ask an organization owner or administrator to [enable public preview](/manage/public-preview) for the organization. * Authenticate the Dome CLI and select a workspace. * Create a [gateway](/build/gateways) that admits the managed agent and contains its model and tools. * Select a model or pool available through that gateway. ### Permissions [#permissions] Managed agent and trigger operations require platform permissions. Each operation states its required permission inline. | Permission | Grants | | ---------------------- | ----------------------------------------------------------------- | | `managedagents.view` | List managed agents and inspect run history | | `managedagents.manage` | Create, update, delete, and configure managed agents and triggers | | `managedagents.invoke` | Start manual runs and fire triggers | | `agents.register` | Create the underlying agent and update its shared settings | | `agents.suspend` | Suspend or reactivate the underlying agent | | `agents.revoke` | Revoke the underlying agent | | `rules.deploy` | Change the managed agent's gateway grant | ## Register agent [#register-agent] Create a managed agent with a name, system prompt, model or pool, and gateway. Dome keeps the runner key and never exposes it. > **Note**: Requires `managedagents.manage`, `agents.register`, and `rules.deploy`. **CLI** ```bash dome managed-agents create \ --name nightly-triage \ --system-prompt "Triage issues filed since the last run." \ --model openai-prod \ --gateway production ``` Each managed agent runs through exactly one gateway. The gateway grant permits every tool the gateway exposes, so Dome rejects separate tool grants on the managed agent. > **Note**: Reference: [`dome managed-agents create`](/cli/build/managed-agents#create-managed-agent) **MCP** Tool: `dome_managed_agents_create` ```json { "name": "nightly-triage", "system_prompt": "Triage issues filed since the last run.", "model": "openai-prod", "gateway": "production" } ``` > **Note**: Reference: [`dome_managed_agents_create`](/reference/mcp/managed-agents) **API** ```http POST /v1/managed-agents Content-Type: application/json { "agent": { "workspace_id": "{{WORKSPACE_ID}}", "name": "nightly-triage", "allowed_gateway_ids": ["production"] }, "system_prompt": "Triage issues filed since the last run.", "default_model": "openai-prod" } ``` > **Note**: Reference: [`CreateManagedAgent`](/api/tag/managed-agents/create-managed-agent) **Agent** ```text title="Create a managed agent" Create a managed agent named "nightly-triage". Use the "openai-prod" model through the "production" gateway, with the system prompt: "Triage issues filed since the last run." ``` Use `dome managed-agents get nightly-triage` to inspect the system prompt, model, gateway, and attached triggers. Use `dome managed-agents update nightly-triage` with `--system-prompt`, `--model`, or `--gateway` to change the managed agent configuration. ### Create from a file [#create-from-a-file] Use a JSON or YAML definition when you want a reviewable managed agent configuration, such as in CI. The file has the same fields as the [Create managed agent API request](/api/tag/managed-agents/create-managed-agent). The `agent` object is the underlying agent registration; it contains the name and its one gateway grant. ```yaml managed-agent.yaml agent: name: nightly-triage allowed_gateway_ids: [production] system_prompt: Triage issues filed since the last run. default_model: openai-prod ``` ```bash dome managed-agents create --file managed-agent.yaml ``` > **Note**: Reference: [`dome managed-agents create --file`](/cli/build/managed-agents#create-managed-agent) ## Update managed agent [#update-managed-agent] Change the system prompt, model or pool, or gateway. Fields you omit keep their current values. **CLI** ```bash dome managed-agents update nightly-triage \ --system-prompt "Triage new issues and assign a priority." \ --model openai-prod \ --gateway production ``` > **Note**: Reference: [`dome managed-agents update`](/cli/build/managed-agents#update-managed-agent) **MCP** Tool: `dome_managed_agents_update` ```json { "agent_id": "{{AGENT_ID}}", "system_prompt": "Triage new issues and assign a priority.", "model": "openai-prod", "gateway": "production" } ``` > **Note**: Reference: [`dome_managed_agents_update`](/reference/mcp/managed-agents) **API** ```http PATCH /v1/managed-agents/{{AGENT_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "system_prompt": "Triage new issues and assign a priority.", "default_model": "openai-prod" } ``` Update the gateway with the regular [Update agent](/api/tag/agents/update-agent) operation. > **Note**: Reference: [`UpdateManagedAgent`](/api/tag/managed-agents/update-managed-agent) **Agent** ```text title="Update a managed agent" Update the "nightly-triage" managed agent with this system prompt: "Triage new issues and assign a priority." Use the "openai-prod" model through the "production" gateway. ``` Use [`dome agents update`](/build/agents/external#update-agent) for the managed agent's name, metadata, or delegated identity settings. Use [triggers](/build/triggers) to change when it runs. ## Rotate runner key [#rotate-runner-key] Rotate the credential Dome holds for a managed agent when you suspect compromise or follow a credential-rotation schedule. Dome stores the replacement before the prior key stops working; the key is never returned. Runs already in progress and later runs use the replacement. > **Note**: Requires `managedagents.manage`. **CLI** ```bash dome managed-agents rotate-runner-key nightly-triage ``` > **Note**: Reference: [`dome managed-agents rotate-runner-key`](/cli/build/managed-agents#rotate-runner-key) **MCP** Tool: `dome_managed_agents_rotate_runner_key` ```json { "agent_id": "{{AGENT_ID}}" } ``` > **Note**: Reference: [`dome_managed_agents_rotate_runner_key`](/reference/mcp/managed-agents#dome_managed_agents_rotate_runner_key) **API** ```http POST /v1/managed-agents/{{AGENT_ID}}/runner-key/rotate Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}" } ``` > **Note**: Reference: [`RotateManagedAgentRunnerKey`](/api/tag/managed-agents/rotate-managed-agent-runner-key) **Agent** ```text title="Rotate a managed agent runner key" Rotate the runner key for the "nightly-triage" managed agent. ``` Do not use `dome agents rotate-key` for a managed agent. Its runner key rotates only through the managed-agent operation. ### Control run behavior [#control-run-behavior] Manual runs are enabled by default. Turn them off when an agent should start only from its schedules and webhooks: ```bash dome managed-agents update nightly-triage --manual-runs=false ``` This refuses **Run now** and `dome managed-agents run`, but does not pause a schedule or webhook. To stop every new run, [suspend the underlying agent](#suspend). Bound each run with `--turn-timeout`, `--on-turn-timeout`, `--max-turns`, and `--max-run-duration`: ```bash dome managed-agents update nightly-triage \ --turn-timeout 5m \ --on-turn-timeout retry \ --max-turns 100 \ --max-run-duration 1h ``` The platform defaults are a 5-minute turn timeout, 50 turns, and a 1-hour run duration. Use a [per-run quota](/govern/quotas#limit-one-managed-agents-run) to limit token use or estimated provider spend. Run limits do not set a token or cost budget. On update, set a numeric limit to `0`, or use `--on-turn-timeout default`, to return that setting to the platform default. ## Get managed agent [#get-managed-agent] Inspect one managed agent's prompt, model, gateway, status, and attached triggers. **CLI** ```bash dome managed-agents get nightly-triage ``` > **Note**: Reference: [`dome managed-agents get`](/cli/build/managed-agents#get-managed-agent) **MCP** Tool: `dome_managed_agents_get` ```json { "agent_id": "{{AGENT_ID}}" } ``` > **Note**: Reference: [`dome_managed_agents_get`](/reference/mcp/managed-agents) **API** ```http GET /v1/managed-agents/{{AGENT_ID}}?workspaceId={{WORKSPACE_ID}} ``` > **Note**: Reference: [`GetManagedAgent`](/api/tag/managed-agents/get-managed-agent) **Agent** ```text title="Get a managed agent" Show the configuration and status for the "nightly-triage" managed agent. ``` ## List managed agents [#list-managed-agents] List managed agents in the active workspace to review their status, model, and gateway. **CLI** ```bash dome managed-agents list ``` > **Note**: Reference: [`dome managed-agents list`](/cli/build/managed-agents#list-managed-agents) **MCP** Tool: `dome_managed_agents_list` ```json {} ``` > **Note**: Reference: [`dome_managed_agents_list`](/reference/mcp/managed-agents) **API** ```http GET /v1/managed-agents?workspaceId={{WORKSPACE_ID}} ``` > **Note**: Reference: [`ListManagedAgents`](/api/tag/managed-agents/list-managed-agents) **Agent** ```text title="List managed agents" List the managed agents in this workspace. ``` ## Manage lifecycle [#manage-lifecycle] Managed agents use the standard agent lifecycle. ### Suspend [#suspend] Suspend a managed agent to stop all new runs for it. Requires `agents.suspend`. **CLI** ```bash dome agents suspend nightly-triage \ --reason "maintenance window" ``` > **Note**: Reference: [`dome agents suspend`](/cli/build/agents#suspend-agent) **MCP** Tool: `dome_agents_suspend` ```json { "agent_id": "nightly-triage", "reason": "maintenance window" } ``` > **Note**: Reference: [`dome_agents_suspend`](/reference/mcp/agents#agents-suspend) **API** ```http POST /v1/agents/{{AGENT_ID}}/suspend Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "reason": "maintenance window" } ``` > **Note**: Reference: [`SuspendAgent`](/api/tag/agents/suspend-agent) **Agent** ```text title="Suspend a managed agent" Suspend the "nightly-triage" managed agent for a maintenance window. ``` ### Reactivate [#reactivate] Reactivate a suspended managed agent to let new runs start again. Requires `agents.suspend`. **CLI** ```bash dome agents reactivate nightly-triage ``` > **Note**: Reference: [`dome agents reactivate`](/cli/build/agents#reactivate-agent) **MCP** Tool: `dome_agents_reactivate` ```json { "agent_id": "nightly-triage" } ``` > **Note**: Reference: [`dome_agents_reactivate`](/reference/mcp/agents#agents-reactivate) **API** ```http POST /v1/agents/{{AGENT_ID}}/reactivate Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}" } ``` > **Note**: Reference: [`ReactivateAgent`](/api/tag/agents/reactivate-agent) **Agent** ```text title="Reactivate a managed agent" Reactivate the "nightly-triage" managed agent. ``` ### Revoke [#revoke] Revoke a managed agent to permanently disable it while preserving its audit record. Requires `agents.revoke`. **CLI** ```bash dome agents revoke nightly-triage \ --reason "decommissioned" ``` > **Note**: Reference: [`dome agents revoke`](/cli/build/agents#revoke-agent) **MCP** Tool: `dome_agents_revoke` ```json { "agent_id": "nightly-triage", "reason": "decommissioned" } ``` > **Note**: Reference: [`dome_agents_revoke`](/reference/mcp/agents#agents-revoke) **API** ```http POST /v1/agents/{{AGENT_ID}}/revoke Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "reason": "decommissioned" } ``` > **Note**: Reference: [`RevokeAgent`](/api/tag/agents/revoke-agent) **Agent** ```text title="Revoke a managed agent" Revoke the "nightly-triage" managed agent because it is decommissioned. ``` ### Delete [#delete] Delete a managed agent and its underlying agent when you no longer need either record. **CLI** ```bash dome managed-agents delete nightly-triage ``` > **Note**: Reference: [`dome managed-agents delete`](/cli/build/managed-agents#delete-managed-agent) **MCP** Tool: `dome_managed_agents_delete` ```json { "agent_id": "{{AGENT_ID}}" } ``` > **Note**: Reference: [`dome_managed_agents_delete`](/reference/mcp/managed-agents) **API** ```http DELETE /v1/managed-agents/{{AGENT_ID}}?workspaceId={{WORKSPACE_ID}} ``` > **Note**: Reference: [`DeleteManagedAgent`](/api/tag/managed-agents/delete-managed-agent) **Agent** ```text title="Delete a managed agent" Delete the "nightly-triage" managed agent and its underlying agent. ``` ## Runs [#runs] Use runs to test a managed agent, monitor work that starts manually or from a trigger, and inspect its output. Each run uses the managed agent's configured prompt, model, and gateway. ### Run managed agent [#run-managed-agent] Start one run immediately when you want to test the prompt and access configuration before scheduling work. > **Note**: Requires `managedagents.invoke`. **CLI** ```bash dome managed-agents run nightly-triage \ --input "Review newly filed issues and return a prioritized summary." ``` > **Note**: Reference: [`dome managed-agents run`](/cli/build/managed-agents#run-managed-agent) **MCP** Tool: `dome_managed_agents_run` ```json { "agent": "nightly-triage", "input": "Review newly filed issues and return a prioritized summary." } ``` > **Note**: Reference: [`dome_managed_agents_run`](/reference/mcp/managed-agents) **API** ```http POST /v1/managed-agents/{{AGENT_ID}}/runs Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "input": "Review newly filed issues and return a prioritized summary." } ``` > **Note**: Reference: [`RunManagedAgent`](/api/tag/managed-agents/run-managed-agent) **Agent** ```text title="Run a managed agent" Start a run of the "nightly-triage" managed agent with this input: "Review newly filed issues and return a prioritized summary." ``` A run moves from `pending` to `running`, then ends as `succeeded`, `failed`, or `cancelled`. Dome can retry an infrastructure failure, but it does not retry a run that reached the model. ### Use run variables [#use-run-variables] In an agent's system prompt, a manual-run input, or a trigger's configured input, reference values that Dome fills when the run starts: | Variable | Value | | ------------------------------ | --------------------------------------------------- | | `{{dome.now}}` | Run start time in UTC | | `{{dome.today}}` | Run date in the trigger's time zone | | `{{dome.timezone}}` | Schedule trigger time zone, or `UTC` otherwise | | `{{dome.scheduled_for}}` | When the run was due or queued, in UTC | | `{{dome.last_successful_run}}` | Start of the agent's last successful run, or `none` | | `{{dome.run_id}}` | Current run ID | | `{{dome.agent.name}}` | Managed agent name | | `{{dome.trigger.name}}` | Trigger name, or `none` for a manual run | | `{{dome.source}}` | `schedule`, `webhook`, or `manual` | For example, `Review changes since {{dome.last_successful_run}}.` is filled in at the start of each run. Dome leaves an unknown `{{dome.*}}` reference unchanged. A webhook request body is passed to the run as sent, so run variables in the body are not substituted. ### List managed agent runs [#list-managed-agent-runs] List recent runs to see their status, source, and completion time. **CLI** ```bash dome managed-agents runs list nightly-triage --limit 50 ``` > **Note**: Reference: [`dome managed-agents runs list`](/cli/build/managed-agents#list-runs) **MCP** Tool: `dome_managed_agents_runs_list` ```json { "agent_id": "{{AGENT_ID}}", "limit": 50 } ``` > **Note**: Reference: [`dome_managed_agents_runs_list`](/reference/mcp/managed-agents) **API** ```http GET /v1/managed-agents/{{AGENT_ID}}/runs?workspaceId={{WORKSPACE_ID}}&limit=50 ``` > **Note**: Reference: [`ListManagedAgentRuns`](/api/tag/managed-agents/list-managed-agent-runs) **Agent** ```text title="List managed agent runs" List the 50 most recent runs for the "nightly-triage" managed agent. ``` ### Inspect a managed agent run [#inspect-a-managed-agent-run] Use the run ID returned by a manual run or shown in run history to inspect its timing, attempts, output, and error details. **CLI** ```bash dome managed-agents runs get {{RUN_ID}} ``` > **Note**: Reference: [`dome managed-agents runs get`](/cli/build/managed-agents#get-run) **MCP** Tool: `dome_managed_agents_runs_get` ```json { "run_id": "{{RUN_ID}}" } ``` > **Note**: Reference: [`dome_managed_agents_runs_get`](/reference/mcp/managed-agents) **API** ```http GET /v1/managed-agent-runs/{{RUN_ID}}?workspaceId={{WORKSPACE_ID}} ``` > **Note**: Reference: [`GetManagedAgentRun`](/api/tag/managed-agents/get-managed-agent-run) **Agent** ```text title="Inspect a managed agent run" Show the details for managed agent run "{{RUN_ID}}". ``` ## Next steps [#next-steps] * [Configure Agents](/build/agents) to manage identity, access, lifecycle, and delegated identity. * [Configure Gateways](/build/gateways) to control the model and tools each managed agent can reach. * [Configure triggers](/build/triggers) to start managed agents manually, on a schedule, or from signed webhooks. * [Inspect audit events](/operate/audit) to investigate managed agent activity. # Gateways (/build/gateways)

{gateway}

## Overview [#overview] A gateway carries two related controls: * **Resource membership** makes a tool, pool, or model addressable through the gateway's runtime endpoint. * **Agent access** admits the agent at the edge and generates rules that permit all current and future resource members. Other workspace and custom rules still apply. Those rules can deny a resource member after the agent passes gateway admission. The typical workflow is: 1. [Create a gateway](#create-gateway) or reuse the [Default gateway](#default-gateway). 2. [Add the resource as a member](#manage-resource-memberships). 3. [Grant the agent access](#manage-agent-access) to the gateway. 4. Point the client at the [gateway's endpoint](#build-the-runtime-endpoint). 5. [Verify reachability](#verify-reachability) with that agent's API key. ### Resource membership [#resource-membership] Membership determines which resources a gateway exposes: | Kind | What it exposes | | --------------- | ----------------------------------------------------------------- | | Individual tool | One selected tool from a connection | | tool source | Every tool on an MCP connection, including tools discovered later | | Pool | A pool behind its stable name | | Direct model | One model connection by name | A resource with no gateway membership stays valid. The resource shows as **Unreachable** because no runtime endpoint addresses it. Removing a membership leaves the underlying resource intact. Gateway membership is available in rules through `resource.gateways.contains("")`. Refer to the [Rules reference](/reference/controls/rules#resource-attributes). You can change what a gateway exposes when you [add or remove members](#manage-resource-memberships). ### Agent access [#agent-access] A **per-agent** grant adds the gateway to that agent's allowed resources (`agents.register` and `rules.deploy`). A **workspace-wide** grant covers every current and future agent in the workspace (`rules.deploy` and `gateways.manage`). `gateways.manage` alone cannot grant runtime access. Revoking a workspace-wide grant leaves per-agent grants in place. Without either grant, invocation fails at edge admission (the completed operation has `result=denied`, `denial.reason=permission_denied`, and the gateway-admission denial detail). Discovery such as `tools/list` and `GET /v1/models` is exempt from admission and stays membership- and Cedar-filtered. With a grant, other rules can still deny individual resource members. Generated permit rules are shown read-only in the dashboard. You can change who reaches a gateway when you [grant or revoke access](#manage-agent-access). ### Default gateway [#default-gateway] Every new workspace starts with an active **Default** gateway that has no resource memberships or agent grants. Migrated workspaces may already have resources attached, but callers still need an explicit per-agent or all-agents grant. The default marker only pre-selects a gateway in dashboard dialogs that create tools, pools, and models. The marker adds no resources, grants no access, and overrides no rules. Free and Pro workspaces support one gateway, and the auto-created Default counts toward that limit. Team, Enterprise, and self-managed workspaces support additional gateways. Exceeding the plan cap returns HTTP `429` / `RESOURCE_EXHAUSTED`. You can move the marker when you [set the Default gateway](#set-default-gateway). ### Runtime endpoints [#runtime-endpoints] Each gateway has its own path under the workspace gateway host. Callers select a gateway in the request URL. The base URL depends on the client protocol. A disabled gateway rejects requests but keeps its memberships and grants. Refer to [Build the runtime endpoint](#build-the-runtime-endpoint) for client-specific URL paths. ### Cost quotas [#cost-quotas] A gateway cost quota caps aggregate LLM spend for member pools and direct model connections. Exceeding the cap blocks further LLM calls through that gateway until the active window resets. Filter audit by `producer_gateway_id`. Metrics dashboards do not break down by gateway. You can cap spend when you [set a cost quota](#set-a-cost-quota). Window and scope semantics are on the [Quotas](/reference/controls/quotas) reference. ### Interactive access [#interactive-access] People can also reach a gateway by signing in with their own Dome account, instead of you minting them an agent key. Enabling it creates one managed agent that every allow-listed person shares and rides individually, each audited under their own identity. Enabling, eligibility, client setup, and token behavior are on [Interactive MCP access](/build/gateways/interactive-mcp-access). ## Requirements [#requirements] Before you begin: * Authenticate to Dome and select a workspace * Collect the resource and agent identifiers the operation needs * Have an active agent key with access to the selected gateway when you verify runtime reachability ### Permissions [#permissions] Gateway membership, grants, and related operations require platform permissions. Each operation states its required permission inline. | Default roles | Permission | Grants | | -------------------------------- | ----------------- | -------------------------------------------------- | | All workspace roles | `gateways.view` | List gateways and inspect membership | | `admin`, `operator` | `gateways.manage` | Create, update, and delete gateways and membership | | All workspace roles | `agents.view` | List agents when managing grants | | `admin`, `operator`, `developer` | `agents.register` | Per-agent gateway grants (with `rules.deploy`) | | `admin`, `operator`, `security` | `rules.deploy` | Required for gateway access-grant changes | ## Create Gateway [#create-gateway] Create a separate gateway when callers need a resource set or endpoint boundary that the Default gateway should not share. A new gateway starts active with empty membership and no grants. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways create prod-resources --description "Production tools and models" ``` > **Note**: Reference: [`dome gateways create`](/cli/build/gateway#create-gateway) **MCP** Tool: `dome_gateways_create` ```json { "name": "prod-resources", "description": "Production tools and models" } ``` > **Note**: Reference: [`dome_gateways_create`](/reference/mcp/gateway#dome_gateways_create) **API** ```http POST /dome.gateway.v1.GatewayService/CreateGateway Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "name": "prod-resources", "description": "Production tools and models" } ``` > **Note**: Reference: [`CreateGateway`](/api/tag/gateways/create-gateway) **Agent** ```text title="Create a Gateway" Create a Gateway named "prod-resources" for production tools and models. ``` > **Note**: Free and Pro workspaces support only one gateway. Reuse, rename, or delete the Default gateway before creating another one. After creation, [retrieve the gateway](#get-gateway) to confirm its ID, active state, empty membership, and grant settings. ## Update Gateway [#update-gateway] Update a gateway to change its name or description. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways update prod-resources --description "Production tools, pools, and models" ``` Omitted values remain unchanged. > **Note**: Reference: [`dome gateways update`](/cli/build/gateway#update-gateway) **MCP** Tool: `dome_gateways_update` ```json { "name": "prod-resources", "new_name": "production-resources", "description": "Production tools, pools, and models" } ``` Omitted values remain unchanged. > **Note**: Reference: [`dome_gateways_update`](/reference/mcp/gateway#dome_gateways_update) **API** An empty `name` keeps the current name. The API always writes `description`, so include the current description when it must remain unchanged. ```http POST /dome.gateway.v1.GatewayService/UpdateGateway Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}", "name": "production-resources", "description": "Production tools, pools, and models" } ``` > **Note**: Reference: [`UpdateGateway`](/api/tag/gateways/update-gateway) **Agent** ```text title="Update a Gateway" Rename "prod-resources" to "production-resources" and update its description to "Production tools, pools, and models". ``` After the update, [retrieve the gateway](#get-gateway) to confirm its name and description. ## Get Gateway [#get-gateway] Retrieve one gateway to inspect its state, default marker, workspace-wide grant, and resource memberships. > **Note**: Requires `gateways.view`. **CLI** ```bash dome gateways get prod-resources ``` > **Note**: Reference: [`dome gateways get`](/cli/build/gateway#get-gateway) **MCP** Tool: `dome_gateways_get` ```json { "name": "prod-resources" } ``` > **Note**: Reference: [`dome_gateways_get`](/reference/mcp/gateway#dome_gateways_get) **API** ```http POST /dome.gateway.v1.GatewayService/GetGateway Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}" } ``` > **Note**: Reference: [`GetGateway`](/api/tag/gateways/get-gateway) **Agent** ```text title="Get a Gateway" Get "prod-resources" and show its state, grants, and resource memberships. ``` ## List Gateways [#list-gateways] List gateways to retrieve their names, IDs, states, default markers, and canonical endpoint paths. > **Note**: Requires `gateways.view`. **CLI** ```bash dome gateways list ``` > **Note**: Reference: [`dome gateways list`](/cli/build/gateway#list-gateways) **MCP** Tool: `dome_gateways_list` ```json {} ``` > **Note**: Reference: [`dome_gateways_list`](/reference/mcp/gateway#dome_gateways_list) **API** ```http POST /dome.gateway.v1.GatewayService/ListGateways Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}" } ``` > **Note**: Reference: [`ListGateways`](/api/tag/gateways/list-gateways) **Agent** ```text title="List Gateways" List the Gateways in the active workspace with their IDs, states, and endpoint paths. ``` ## Set Default gateway [#set-default-gateway] Set a gateway as the workspace default to pre-select it in dashboard dialogs that create tools, pools, and models. Setting a new default clears the previous marker. A disabled default is not pre-selected. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways set-default prod-resources ``` > **Note**: Reference: [`dome gateways set-default`](/cli/build/gateway#set-default-gateway) **MCP** Tool: `dome_gateways_set_default` ```json { "name": "prod-resources" } ``` > **Note**: Reference: [`dome_gateways_set_default`](/reference/mcp/gateway#dome_gateways_set_default) **API** ```http POST /dome.gateway.v1.GatewayService/SetGatewayDefault Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}" } ``` > **Note**: Reference: [`SetGatewayDefault`](/api/tag/gateways/set-gateway-default) **Agent** ```text title="Set the default Gateway" Set "prod-resources" as the workspace's Default gateway. ``` After setting the default, [retrieve the gateway](#get-gateway) and confirm that it is marked as the workspace default. ## Manage lifecycle [#manage-lifecycle] Manage a gateway's availability without changing resource memberships or agent grants. Delete a gateway only when callers no longer need that endpoint. ### Enable Gateway [#enable-gateway] Enable a disabled gateway to restore its endpoint. Disabling a gateway preserves existing memberships and grants. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways enable prod-resources ``` > **Note**: Reference: [`dome gateways enable`](/cli/build/gateway#enable-gateway) **MCP** Tool: `dome_gateways_set_state` ```json { "name": "prod-resources", "state": "active" } ``` > **Note**: Reference: [`dome_gateways_set_state`](/reference/mcp/gateway#dome_gateways_set_state) **API** ```http POST /dome.gateway.v1.GatewayService/SetGatewayState Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}", "state": "active" } ``` > **Note**: Reference: [`SetGatewayState`](/api/tag/gateways/set-gateway-state) **Agent** ```text title="Enable a Gateway" Enable the "prod-resources" Gateway. ``` ### Disable Gateway [#disable-gateway] Disable a gateway to block its endpoint without removing memberships or grants. Requests stay rejected until you enable the gateway again. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways disable prod-resources ``` > **Note**: Reference: [`dome gateways disable`](/cli/build/gateway#disable-gateway) **MCP** Tool: `dome_gateways_set_state` ```json { "name": "prod-resources", "state": "disabled" } ``` > **Note**: Reference: [`dome_gateways_set_state`](/reference/mcp/gateway#dome_gateways_set_state) **API** ```http POST /dome.gateway.v1.GatewayService/SetGatewayState Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}", "state": "disabled" } ``` > **Note**: Reference: [`SetGatewayState`](/api/tag/gateways/set-gateway-state) **Agent** ```text title="Disable a Gateway" Disable "prod-resources" while preserving its memberships and grants. ``` After enabling or disabling a gateway, [retrieve the gateway](#get-gateway) to confirm the resulting state. ### Delete Gateway [#delete-gateway] Delete a gateway only after moving callers to another endpoint. Deletion removes the gateway and its resource memberships. The `/gateways/{{GATEWAY_ID}}/...` endpoint starts rejecting requests. Deletion does not remove the underlying tools, connections, pools, or models. > **Note**: Requires `gateways.manage`. > **Warning**: Deletion is permanent. Per-agent grants for the deleted ID no longer admit callers. Callers must use another gateway ID. **CLI** ```bash dome gateways delete prod-resources ``` > **Note**: Reference: [`dome gateways delete`](/cli/build/gateway#delete-gateway) **MCP** Tool: `dome_gateways_delete` ```json { "name": "prod-resources" } ``` > **Note**: Reference: [`dome_gateways_delete`](/reference/mcp/gateway#dome_gateways_delete) **API** ```http POST /dome.gateway.v1.GatewayService/DeleteGateway Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}" } ``` > **Note**: Reference: [`DeleteGateway`](/api/tag/gateways/delete-gateway) **Agent** ```text title="Delete a Gateway" Delete "prod-resources" without deleting its underlying resources. ``` After deletion, [list the gateways](#list-gateways) to confirm the deleted gateway no longer appears. ## Manage resource memberships [#manage-resource-memberships] Add or remove members so resources are addressable through a gateway. Membership kinds are in [Overview](#resource-membership). Membership changes do not modify or delete the underlying resources. ### Individual tools [#individual-tools] Add or remove one tool without exposing the rest of its connection. ##### Add individual tool [#add-individual-tool] Add one tool without exposing the other tools from its connection. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways tools add prod-resources {{TOOL_ID}} ``` > **Note**: Reference: [`dome gateways tools add`](/cli/build/gateway#add-tool) **MCP** Tool: `dome_gateways_tool_add` ```json { "gateway": "prod-resources", "connection": "notion", "tool": "create_page" } ``` > **Note**: Reference: [`dome_gateways_tool_add`](/reference/mcp/gateway#dome_gateways_tool_add) **API** ```http POST /dome.gateway.v1.GatewayService/AddGatewayTool Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}", "tool_id": "{{TOOL_ID}}" } ``` > **Note**: Reference: [`AddGatewayTool`](/api/tag/gateways/add-gateway-tool) **Agent** ```text title="Add an individual tool" Add the "create_page" tool from the "notion" connection to "prod-resources". ``` ##### Remove individual tool [#remove-individual-tool] Remove an individual membership to stop exposing the tool on its own. The tool stays addressable when a tool-source membership also covers that tool. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways tools remove prod-resources {{TOOL_ID}} ``` > **Note**: Reference: [`dome gateways tools remove`](/cli/build/gateway#remove-tool) **MCP** Tool: `dome_gateways_tool_remove` ```json { "gateway": "prod-resources", "connection": "notion", "tool": "create_page" } ``` > **Note**: Reference: [`dome_gateways_tool_remove`](/reference/mcp/gateway#dome_gateways_tool_remove) **API** ```http POST /dome.gateway.v1.GatewayService/RemoveGatewayTool Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}", "tool_id": "{{TOOL_ID}}" } ``` > **Note**: Reference: [`RemoveGatewayTool`](/api/tag/gateways/remove-gateway-tool) **Agent** ```text title="Remove an individual tool" Remove the "create_page" tool from "prod-resources" without deleting the tool. ``` ### Tool source [#tool-source] Add or remove an entire MCP connection. Newly discovered tools on that connection join the gateway automatically. ##### Add tool source [#add-tool-source] Add a tool source to include every tool currently on that connection. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways tool-sources add prod-resources notion ``` > **Note**: Reference: [`dome gateways tool-sources add`](/cli/build/gateway#add-tool-source) **MCP** Tool: `dome_gateways_tool_source_add` ```json { "gateway": "prod-resources", "connection": "notion" } ``` > **Note**: Reference: [`dome_gateways_tool_source_add`](/reference/mcp/gateway#dome_gateways_tool_source_add) **API** ```http POST /dome.gateway.v1.GatewayService/AddGatewayToolSource Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}", "connection_id": "{{CONNECTION_ID}}" } ``` > **Note**: Reference: [`AddGatewayToolSource`](/api/tag/gateways/add-gateway-tool-source) **Agent** ```text title="Add a tool source" Add the entire "notion" tool source to "prod-resources", including newly discovered tools. ``` ##### Remove tool source [#remove-tool-source] Remove a tool-source membership to stop automatically including tools from that connection. Individually added tools remain in the gateway. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways tool-sources remove prod-resources notion ``` > **Note**: Reference: [`dome gateways tool-sources remove`](/cli/build/gateway#remove-tool-source) **MCP** Tool: `dome_gateways_tool_source_remove` ```json { "gateway": "prod-resources", "connection": "notion" } ``` > **Note**: Reference: [`dome_gateways_tool_source_remove`](/reference/mcp/gateway#dome_gateways_tool_source_remove) **API** ```http POST /dome.gateway.v1.GatewayService/RemoveGatewayToolSource Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}", "connection_id": "{{CONNECTION_ID}}" } ``` > **Note**: Reference: [`RemoveGatewayToolSource`](/api/tag/gateways/remove-gateway-tool-source) **Agent** ```text title="Remove a tool source" Remove the "notion" tool source from "prod-resources" without deleting the connection. ``` ### Pool [#pool] Add or remove a pool so agents can call it by its stable name through the gateway. Changes to the pool's members do not require a membership update. ##### Add pool [#add-pool] Add a pool to expose its routed models through the gateway. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways model-pools add prod-resources production ``` > **Note**: Reference: [`dome gateways model-pools add`](/cli/build/gateway#add-model-pool) **MCP** Tool: `dome_gateways_model_pool_add` ```json { "gateway": "prod-resources", "pool": "production" } ``` > **Note**: Reference: [`dome_gateways_model_pool_add`](/reference/mcp/gateway#dome_gateways_model_pool_add) **API** ```http POST /dome.gateway.v1.GatewayService/AddGatewayLLMPool Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}", "llm_pool_id": "{{POOL_ID}}" } ``` > **Note**: Reference: [`AddGatewayLLMPool`](/api/tag/gateways/add-gateway-llm-pool) **Agent** ```text title="Add a model pool" Add the "production" model pool to "prod-resources". ``` ##### Remove pool [#remove-pool] Remove a pool to stop exposing that pool through the gateway. The pool and its members remain configured. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways model-pools remove prod-resources production ``` > **Note**: Reference: [`dome gateways model-pools remove`](/cli/build/gateway#remove-model-pool) **MCP** Tool: `dome_gateways_model_pool_remove` ```json { "gateway": "prod-resources", "pool": "production" } ``` > **Note**: Reference: [`dome_gateways_model_pool_remove`](/reference/mcp/gateway#dome_gateways_model_pool_remove) **API** ```http POST /dome.gateway.v1.GatewayService/RemoveGatewayLLMPool Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}", "llm_pool_id": "{{POOL_ID}}" } ``` > **Note**: Reference: [`RemoveGatewayLLMPool`](/api/tag/gateways/remove-gateway-llm-pool) **Agent** ```text title="Remove a model pool" Remove the "production" model pool from "prod-resources" without deleting the pool. ``` ### Direct model [#direct-model] Add or remove one model connection without routing through a pool. ##### Add direct model [#add-direct-model] Add a direct model connection to make that model name addressable through the gateway. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways models add prod-resources claude-prod ``` > **Note**: Reference: [`dome gateways models add`](/cli/build/gateway#add-model) **MCP** Tool: `dome_gateways_model_add` ```json { "gateway": "prod-resources", "model": "claude-prod" } ``` > **Note**: Reference: [`dome_gateways_model_add`](/reference/mcp/gateway#dome_gateways_model_add) **API** ```http POST /dome.gateway.v1.GatewayService/AddGatewayLLMModel Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}", "llm_model_connection_id": "{{MODEL_CONNECTION_ID}}" } ``` > **Note**: Reference: [`AddGatewayLLMModel`](/api/tag/gateways/add-gateway-llm-model) **Agent** ```text title="Add a direct model" Add "claude-prod" directly to "prod-resources". ``` ##### Remove direct model [#remove-direct-model] Remove a direct model connection to stop exposing it through the gateway without deleting the connection. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome gateways models remove prod-resources claude-prod ``` > **Note**: Reference: [`dome gateways models remove`](/cli/build/gateway#remove-model) **MCP** Tool: `dome_gateways_model_remove` ```json { "gateway": "prod-resources", "model": "claude-prod" } ``` > **Note**: Reference: [`dome_gateways_model_remove`](/reference/mcp/gateway#dome_gateways_model_remove) **API** ```http POST /dome.gateway.v1.GatewayService/RemoveGatewayLLMModel Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}", "llm_model_connection_id": "{{MODEL_CONNECTION_ID}}" } ``` > **Note**: Reference: [`RemoveGatewayLLMModel`](/api/tag/gateways/remove-gateway-llm-model) **Agent** ```text title="Remove a direct model" Remove "claude-prod" from "prod-resources" without deleting the model connection. ``` After any membership change, [retrieve the gateway](#get-gateway) to confirm its individual tool, tool source, model pool, and direct model memberships. ## Manage agent access [#manage-agent-access] Grant or revoke who is admitted at the gateway edge. Per-agent and workspace-wide grants are in [Overview](#agent-access). Other rules can still deny individual members after admission. ### List agent access [#list-agent-access] List agents and show whether each agent has a per-agent grant to the gateway. Revoked agents are excluded. Suspended agents remain listed so you can inspect their grants before reactivation. > **Note**: Requires `agents.view`. **CLI** ```bash dome gateways access list prod-resources ``` > **Note**: Reference: [`dome gateways access list`](/cli/build/gateway#list-access) **MCP** Tool: `dome_gateways_access_list` ```json { "gateway": "prod-resources" } ``` > **Note**: Reference: [`dome_gateways_access_list`](/reference/mcp/gateway#dome_gateways_access_list) **API** The API returns every agent in the workspace. Exclude revoked agents, then check whether each remaining agent's `allowed_gateway_ids` contains the target gateway ID. ```http GET /v1/agents?workspace_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`ListAgents`](/api/tag/agents/list-agents) **Agent** ```text title="List agent access" List agents and show whether each one has a per-agent grant to "prod-resources". ``` ### Grant one agent [#grant-one-agent] Grant one agent access while preserving its existing gateway grants. Dome generates and manages the permit rules. You cannot edit those rules directly. > **Note**: Requires `agents.register` and `rules.deploy`. **CLI** ```bash dome gateways access grant prod-resources data-pipeline-agent ``` > **Note**: Reference: [`dome gateways access grant`](/cli/build/gateway#grant-access) **MCP** Tool: `dome_gateways_agent_grant` ```json { "gateway": "prod-resources", "agent_id": "{{AGENT_ID}}" } ``` > **Note**: Reference: [`dome_gateways_agent_grant`](/reference/mcp/gateway#dome_gateways_agent_grant) **API** The `allowed_gateway_ids` field replaces the agent's full list. Include every existing gateway ID that the agent should keep, plus the new ID. ```http PATCH /v1/agents/{{AGENT_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "allowed_gateway_ids": [ "{{EXISTING_GATEWAY_ID}}", "{{GATEWAY_ID}}" ], "update_mask": "allowed_gateway_ids" } ``` > **Note**: Reference: [`UpdateAgent`](/api/tag/agents/update-agent) **Agent** ```text title="Grant one agent" Grant "data-pipeline-agent" access to "prod-resources" and preserve its existing Gateway grants. ``` ### Revoke one agent [#revoke-one-agent] Revoke one agent's access to the gateway while preserving its other gateway grants. Requests from that agent to the gateway endpoint fail at edge admission unless a workspace-wide grant also applies. > **Note**: Requires `agents.register` and `rules.deploy`. **CLI** ```bash dome gateways access revoke prod-resources data-pipeline-agent ``` > **Note**: Reference: [`dome gateways access revoke`](/cli/build/gateway#revoke-access) **MCP** Tool: `dome_gateways_agent_revoke` ```json { "gateway": "prod-resources", "agent_id": "{{AGENT_ID}}" } ``` > **Note**: Reference: [`dome_gateways_agent_revoke`](/reference/mcp/gateway#dome_gateways_agent_revoke) **API** The `allowed_gateway_ids` field replaces the agent's full list. Omit the revoked ID and preserve every other ID the agent should keep. ```http PATCH /v1/agents/{{AGENT_ID}} Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "allowed_gateway_ids": [ "{{OTHER_GATEWAY_ID}}" ], "update_mask": "allowed_gateway_ids" } ``` > **Note**: Reference: [`UpdateAgent`](/api/tag/agents/update-agent) **Agent** ```text title="Revoke one agent" Revoke "data-pipeline-agent" access to "prod-resources" and preserve its other Gateway grants. ``` ### Grant every workspace agent [#grant-every-workspace-agent] Grant every current and future workspace agent access when all agents need the same endpoint. Other rules can still deny individual resources after admission. > **Note**: Requires `gateways.manage` and `rules.deploy`. **CLI** ```bash dome gateways access grant-all prod-resources ``` > **Note**: Reference: [`dome gateways access grant-all`](/cli/build/gateway#grant-access-to-all-agents) **MCP** Tool: `dome_gateways_all_agents_grant` ```json { "gateway": "prod-resources" } ``` > **Note**: Reference: [`dome_gateways_all_agents_grant`](/reference/mcp/gateway#dome_gateways_all_agents_grant) **API** ```http POST /dome.gateway.v1.GatewayService/SetGatewayAllAgentsGrant Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}", "granted": true } ``` > **Note**: Reference: [`SetGatewayAllAgentsGrant`](/api/tag/gateways/set-gateway-all-agents-grant) **Agent** ```text title="Grant every workspace agent" Grant every current and future workspace agent access to "prod-resources". ``` ### Revoke every workspace agent [#revoke-every-workspace-agent] Revoke the workspace-wide grant to stop automatically admitting every agent. Existing per-agent grants remain in place. > **Note**: Requires `gateways.manage` and `rules.deploy`. **CLI** ```bash dome gateways access revoke-all prod-resources ``` > **Note**: Reference: [`dome gateways access revoke-all`](/cli/build/gateway#revoke-access-from-all-agents) **MCP** Tool: `dome_gateways_all_agents_revoke` ```json { "gateway": "prod-resources" } ``` > **Note**: Reference: [`dome_gateways_all_agents_revoke`](/reference/mcp/gateway#dome_gateways_all_agents_revoke) **API** ```http POST /dome.gateway.v1.GatewayService/SetGatewayAllAgentsGrant Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "gateway_id": "{{GATEWAY_ID}}", "granted": false } ``` > **Note**: Reference: [`SetGatewayAllAgentsGrant`](/api/tag/gateways/set-gateway-all-agents-grant) **Agent** ```text title="Revoke every workspace agent" Revoke the workspace-wide grant from "prod-resources" without changing per-agent grants. ``` After any access change, [list agent access](#list-agent-access) to confirm the resulting per-agent grants. For a workspace-wide grant, [retrieve the gateway](#get-gateway) and check its workspace-wide grant setting. ## Manage cost quotas [#manage-cost-quotas] Cap aggregate LLM spend for member pools and direct model connections on this gateway. Refer to [Overview](#cost-quotas). Window and scope semantics are on the [Quotas](/reference/controls/quotas) reference. ### List cost quotas [#list-cost-quotas] List gateway cost quotas in the workspace or filter the result to one gateway. > **Note**: Requires `gateways.view`. **CLI** ```bash dome quotas list --gateway prod-resources ``` > **Note**: Reference: [`dome quotas list`](/cli/govern/quota#list-quotas) **MCP** Tool: `dome_quotas_list` ```json { "gateway": "prod-resources" } ``` > **Note**: Reference: [`dome_quotas_list`](/reference/mcp/quotas#dome_quotas_list) **API** The API returns every LLM quota in the workspace. Filter the response to records with `subject_type` equal to `gateway` and the desired `subject_id`. ```http GET /v1/quotas?workspace_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`ListLLMQuotas`](/api/tag/quotas/list-llm-quotas) **Agent** ```text title="List cost quotas" List the cost quotas for the "prod-resources" Gateway. ``` ### Set a cost quota [#set-a-cost-quota] Set a daily or monthly USD spend cap for LLM calls through a gateway. Once spend exceeds the cap, LLM calls addressed to that gateway return HTTP `429`. > **Note**: Requires `gateways.manage`. **CLI** ```bash dome quotas set --subject gateway --gateway prod-resources --limit 500 --window monthly --name "prod-monthly" ``` > **Note**: Reference: [`dome quotas set`](/cli/govern/quota#set-quota) **MCP** Tool: `dome_quotas_set` ```json { "subject": "gateway", "gateway": "prod-resources", "limit_usd": 500, "window": "monthly", "name": "prod-monthly" } ``` > **Note**: Reference: [`dome_quotas_set`](/reference/mcp/quotas#dome_quotas_set) **API** The API expresses the limit in millionths of a US dollar. For example, `$500` is `500000000`. ```http POST /v1/quotas Content-Type: application/json { "workspace_id": "{{WORKSPACE_ID}}", "subject_type": "gateway", "subject_id": "{{GATEWAY_ID}}", "limit_micros": "500000000", "window": "monthly", "name": "prod-monthly", "enabled": true } ``` > **Note**: Reference: [`CreateLLMQuota`](/api/tag/quotas/create-llm-quota) **Agent** ```text title="Set a cost quota" Create a monthly $500 cost quota named "prod-monthly" for "prod-resources". ``` ### Remove a cost quota [#remove-a-cost-quota] Remove a gateway cost quota to stop enforcing that cap. > **Note**: Requires `gateways.manage`. > **Warning**: Removing a quota takes away an active spending control. Confirm the quota ID with the list operation first. **CLI** ```bash dome quotas rm {{QUOTA_ID}} ``` > **Note**: Reference: [`dome quotas rm`](/cli/govern/quota#remove-quota) **MCP** Tool: `dome_quotas_remove` ```json { "quota_id": "{{QUOTA_ID}}" } ``` > **Note**: Reference: [`dome_quotas_remove`](/reference/mcp/quotas#dome_quotas_remove) **API** Confirm that the quota has `subject_type: gateway` before deleting it. The generic API endpoint does not add the CLI and MCP subject-type guard. ```http DELETE /v1/quotas/{{QUOTA_ID}}?workspace_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`DeleteLLMQuota`](/api/tag/quotas/delete-llm-quota) **Agent** ```text title="Remove a cost quota" Confirm that "{{QUOTA_ID}}" is a Gateway quota, then remove it. ``` After any quota change, [list cost quotas](#list-cost-quotas) to confirm the active caps and reset windows. ## Build the runtime endpoint [#build-the-runtime-endpoint] Build the runtime endpoint from the workspace gateway host and the gateway ID. Retrieve the ID with [List gateways](#list-gateways). > **Note**: Requires `gateways.view` to retrieve the ID. Runtime calls require an active agent key and a grant to the gateway. Use the ID in the canonical prefix: ```text https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}} ``` Choose the base URL that matches the client. | Client | Base URL | Client appends | | --------------------- | ------------------------------------------------------ | ------------------------------------- | | Dome SDK | `https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}` | nothing, used as-is | | Anthropic SDK | `https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}` | `/v1/messages` (SDK-managed) | | OpenAI-compatible SDK | `https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/v1` | `/chat/completions`, `/embeddings`, … | | MCP client | `https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/mcp` | protocol frames | Do not add `/v1` to the Anthropic base URL because the Anthropic SDK appends `/v1/messages`. Bare `/mcp` and `/v1` requests return HTTP `400`. Every caller must select a gateway in the URL. The `/mcp` endpoint speaks Streamable HTTP only, not the legacy standalone SSE transport. Configure MCP clients for `http` (or `streamable-http`), not `sse`. Run `dome gateways get --json` to retrieve the complete `gateway_url`, `mcp_url`, `openai_base_url`, and `anthropic_base_url`. SDK agent-key creation and token exchange return the same authoritative endpoint set. Refer to [Python SDK Gateways](/sdks/python/reference#gateways). ## Verify reachability [#verify-reachability] Verify discovery before invoking a tool or model. Discovery returns only members of the selected gateway that the agent's grant and applicable rules permit. > **Note**: Requires an active agent key, access to the gateway, and rules that allow discovery. List MCP tools through the scoped endpoint: ```bash curl -X POST "https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/mcp" \ -H "Authorization: Bearer {{DOME_AGENT_KEY}}" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' ``` List model pools and direct model connections through the OpenAI-compatible endpoint: ```bash curl "https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/v1/models" \ -H "Authorization: Bearer {{DOME_AGENT_KEY}}" ``` Configure runtime credentials and SDK clients in [Develop](/develop). ## Check synchronization [#check-synchronization] After deploying rules or changing gateway membership, query the gateway's operational status with an agent credential from the workspace: ```bash curl "https://{{GATEWAY_HOST}}/admin/status" \ -H "Authorization: Bearer {{DOME_AGENT_KEY}}" ``` `rules_version` is the version of your workspace's latest policy snapshot that this gateway has applied. It stays empty until the gateway applies a snapshot. `sync_health` reports the most recent successful synchronization and consecutive failures; `connections` reports the connection health visible to your workspace. The response never exposes another workspace's configuration. ## Troubleshoot reachability [#troubleshoot-reachability] Use the observed response to locate the failed layer. | Symptom | Likely cause | Resolution | | ---------------------------------------------- | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | | HTTP `400` asks for a gateway | The client used bare `/mcp` or `/v1` | Add `/gateways/{{GATEWAY_ID}}` before the protocol path | | gateway is unavailable | The ID is unknown, disabled, or not yet synchronized | Verify the ID, enable the gateway, and wait for gateway synchronization to complete | | Invocation is denied before rules evaluate | The agent lacks access to the gateway | Add a per-agent or workspace-wide grant | | Discovery returns no resources | The agent lacks access, the gateway has no matching members, or rules deny discovery | Check agent access, membership, and rules | | tool is missing from `tools/list` | The tool lacks membership, is blocked, or rules deny discovery | Check individual and tool-source membership, tool status, and rules | | Pool or model is missing from `/v1/models` | The resource lacks membership or rules deny discovery | Check pool or direct-model membership and model rules | | Resource shows **Unreachable** | The resource belongs to no gateway | Add the resource or its containing tool source or pool | | LLM call returns HTTP `429` | A gateway or other LLM cost quota is exhausted | List active quotas and check their reset windows | | gateway creation is rejected at the plan limit | The workspace already has the maximum number of gateways | Reuse, rename, or delete the Default gateway, or change plans | | Anthropic request returns HTTP `404` | The client base URL includes an extra `/v1` | Use `https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}` | After changing memberships or grants, wait for gateway synchronization before testing again. If discovery succeeds but invocation fails, inspect the resource rules and the agent's lifecycle state. ## Next steps [#next-steps] * [Gateways](/concepts/gateways) concept for how membership and grants work * [Interactive MCP access](/build/gateways/interactive-mcp-access) to let people sign in with their own account instead of an agent key * [Register external agents](/build/agents/external) to create agent identities and keys * [Tools](/connect/tools) to configure tool connections and catalog state * [Pools](/connect/pools) to configure pools and routing # Interactive MCP access (/build/gateways/interactive-mcp-access) Interactive access lets people sign in with their own Dome account instead of holding an agent key. Each person authorizes once in a browser, then every call is audited under their own identity, not a shared credential. ## Overview [#overview] Interactive access is a setting on one [Gateway](/build/gateways). Enabling it creates one interactive agent, named `gateway-interactive-`, that every allow-listed person shares as the identity their MCP client rides. The interactive agent behaves like a regular agent everywhere else. Cedar rules still authorize its calls and quotas still cap its spend. Enabling interactive access grants it access to its own gateway automatically, so the only step left is a [rule](#authorize-the-interactive-agent) permitting what it may call. Each signed-in call also carries the person's verified identity into Cedar as `principal.act_as`, the same attribute rules read for [delegated agents](/build/agents/delegated). A rule can scope by `principal.act_as.email` when different people need different access, not just one blanket permit for the interactive agent. > **Note**: Interactive access is a separate identity path from [delegated agents](/build/agents/delegated#verification-methods) with `oidc` or `hmac`. Your application never sends `X-Dome-Act-As` for an interactive client; the OAuth token supplies the identity directly. ## Requirements [#requirements] Before you begin: * Authenticate to Dome and select a workspace * Create or select a [Gateway](/build/gateways) with the resources people should reach * Collect the email addresses or IdP subjects to allow-list * Every person you allow-list needs their own effective `agents.view` access to the workspace; an email on the list is not enough by itself ## Eligibility and consent [#eligibility-and-consent] A person can ride the interactive agent only when every check passes: 1. Interactive access is enabled. 2. The verified email or subject matches the allow-list. 3. The person has effective `agents.view` access to the workspace. 4. The agent is not device-bound, suspended, or revoked. 5. The agent is admitted to the addressed gateway. 6. The organization is writable. The consent page only shows eligible agents. Dome rechecks eligibility at consent, code redemption, and every token refresh. Approval is never remembered. The last agent may be preselected, but the person confirms each new authorization. ## Token and grant behavior [#token-and-grant-behavior] Interactive access tokens expire within 10 minutes and target one canonical gateway resource. They cannot call control-plane APIs or another gateway. The public MCP client uses authorization code flow with S256 PKCE. Refresh tokens rotate after one use. A replay revokes the entire grant family. Dome rechecks identity continuity, email, access, agent state, gateway admission, and organization state before renewal. Lost eligibility stops renewal; transient provider failures leave the current refresh token retryable. ## Enable interactive access [#enable-interactive-access] Enable interactive access when people should connect their own MCP clients without receiving an agent API key. > **Note**: Requires `gateways.manage` and `rules.deploy`. ```bash dome gateways interactive enable prod-resources \ --email alice@example.com \ --subject {{IDP_SUBJECT}} ``` `--email` and `--subject` are repeatable. Enabling replaces both allow-lists, and matching is exact and case-sensitive. At least one email or subject is required; groups cannot match an interactive login. Confirm the interactive agent's name, which the next section needs to authorize it: ```bash dome gateways get prod-resources --json ``` Read `interactive_access.managed_agent_name` (or `.managed_agent_id`) from the response. These wire-field names are retained for compatibility; they identify the interactive agent. ## Authorize the interactive agent [#authorize-the-interactive-agent] Gateway admission gets the interactive agent to the edge. It does not permit it to call anything. Deploy a rule scoped to its name, the same way you would for any agent: ```cedar title="interactive-access.cedar" permit( principal is Dome::Agent, action == Dome::Action::"mcp:discover", resource ); permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ); ``` ```bash dome rules apply interactive-access.cedar \ --agent gateway-interactive-{{GATEWAY_ID}} \ --name interactive-access ``` Scope the allowlist to individual tools or pools the same way you would for a registered agent. Refer to [Authorize Access](/govern/rules) for allow, deny, and per-person rules keyed on `principal.act_as.email`. ## Connect an MCP client [#connect-an-mcp-client] Copy the authoritative `mcp_url` from `dome gateways get prod-resources --json` or the gateway page. Add that remote URL to your client with no token or header. The first connection receives an OAuth challenge and opens a browser: sign in with your Dome account, select an eligible agent, review the client and exposed tools, then approve. Configure the client for Streamable HTTP, not SSE. The gateway does not support the legacy standalone SSE transport. **Cursor** Add the remote server URL to `.cursor/mcp.json` or **Settings → MCP**, with no `headers` block: ```json { "mcpServers": { "dome-gateway": { "url": "https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/mcp" } } } ``` Cursor opens the browser on the first tool call. **Claude Code** ```bash claude mcp add --transport http dome-gateway \ https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/mcp ``` No `--header` flag this time. Claude Code opens the browser on the first connection. **Codex** Add the server to `~/.codex/config.toml` with no `env_key`: ```toml [mcp_servers.dome-gateway] url = "https://{{GATEWAY_HOST}}/gateways/{{GATEWAY_ID}}/mcp" ``` Then trigger the browser sign-in explicitly: ```bash codex mcp login dome-gateway ``` This browser login is not a Dome Dashboard session. The OAuth callback binds the identity to this authorization transaction and returns the client to its registered redirect URI. ## List and revoke grants [#list-and-revoke-grants] List and revoke grants from **Settings → Interactive access** or the CLI: ```bash dome agents interactive-grants list dome agents interactive-grants list --all-users dome agents interactive-grants revoke {{GRANT_ID}} ``` People can list and revoke their own grants. Workspace-wide listing requires `agents.view`; revoking another person's grant requires `agentkeys.manage`. ## Disable interactive access [#disable-interactive-access] ```bash dome gateways interactive disable prod-resources ``` Disabling preserves the interactive agent and allow-lists. Existing access tokens expire within minutes and stop renewing. Re-enable with explicit email or subject flags to replace the saved allow-lists. ## Next steps [#next-steps] * [Gateways](/build/gateways) for membership, agent-key access, and runtime endpoints * [delegated agents](/build/agents/delegated) for `principal.act_as` and claim-aware rules * [Authorize Access](/govern/rules) to scope what the interactive agent, or one signed-in person, may call # Agent lifecycle (/concepts/agents/agent-lifecycle)

{agentLifecycle}

## High-level overview [#high-level-overview] The lifecycle is a directed graph with four states, two reversible transitions, and one terminal state. Provisioned and active agents can send traffic through the gateway. Suspended and revoked agents are rejected. Revocation is permanent. Suspension is reversible. Moving an agent through its lifecycle looks like this: 1. An operator registers an agent. 2. The agent stays provisioned until its first gateway request, then becomes active automatically. 3. During an incident the operator suspends the agent (optionally cascading to active children). 4. After the window, reactivate restores traffic for that agent alone. 5. If the agent is decommissioned, revoke permanently disables it and every descendant. Lifecycle state gates whether the agent identity can send traffic. That gate is independent of rotating keys or rewriting rules. Agent lifecycle states: provisioned, active, suspended, revoked ### States [#states] | State | Description | Can receive traffic? | | --------------- | --------------------------------------------------- | -------------------- | | **provisioned** | Created but never used. Waiting for first request. | Yes | | **active** | Operational. Making requests and receiving traffic. | Yes | | **suspended** | Temporarily disabled by an operator. | No | | **revoked** | Permanently decommissioned. Terminal. | No | ### Transitions [#transitions] #### Provisioned to Active [#provisioned-to-active] Happens **automatically** on first traffic. When a provisioned agent sends its first request through the gateway, the platform records the timestamp (`LastSeenAt`) and transitions the agent to active. No operator action required. #### Active to Suspended [#active-to-suspended] Triggered by an operator via `dome agents suspend`. Suspension is reversible. Use it for maintenance windows, incident response, or temporary access revocation. With `--cascade`, the platform also suspends all active child agents in the hierarchy. Without it, only the target agent is suspended. #### Suspended to Active [#suspended-to-active] Triggered by an operator via `dome agents reactivate`. The agent immediately resumes accepting traffic. #### Any State to Revoked [#any-state-to-revoked] Triggered by an operator via `dome agents revoke`. Revocation is **permanent** and **always cascades**. Every descendant in the hierarchy is revoked depth-first, regardless of their current state. There is no undo. ### Cascade semantics [#cascade-semantics] Agents form hierarchies through the `parent_id` field (max depth: 10). Cascade behavior differs between suspend and revoke: | Operation | Cascade behavior | Reversible? | | ----------- | --------------------------------------------------------- | ----------- | | **Suspend** | Optional (`--cascade`). Suspends active descendants only. | Yes | | **Revoke** | Always. Revokes all descendants depth-first, any state. | No | The parent must belong to the same tenant as the child. Cross-tenant hierarchies are not permitted. Hierarchy grants no access on its own. Each agent reaches only what you allow it. Refer to [Agents](/concepts/agents#lifecycle-and-hierarchy) concept and [External agents](/build/agents/external#hierarchy). ### Heartbeat and staleness [#heartbeat-and-staleness] The platform tracks `LastSeenAt` for every agent. It is updated on each request through the gateway. This timestamp serves two purposes: * **Automatic activation.** Transitions provisioned agents to active on first traffic. * **Staleness detection.** Operators can identify agents that have stopped communicating, though there is no automatic suspension on staleness. ## Next steps [#next-steps] With the agent lifecycle model in mind, continue with: * [Agents](/concepts/agents) concept for how agents are identified and authenticated * [Agent Identity](/concepts/agents/identity) concept for credentials and act-as claims * [Agents](/build/agents) to suspend, reactivate, revoke, and manage hierarchy * [Rules](/concepts/controls/rules) concept when authorization should also reference agent state # Agent identity (/concepts/agents/identity)

{agentIdentity}

## High-level overview [#high-level-overview] Dome authenticates agents in layers. An API key is the long-lived secret. The Identity service exchanges it for a short-lived session token. Every API call, MCP invocation, and gateway request carries that token. Services verify it locally. When the agent acts for a person, an act-as claim on `X-Dome-Act-As` can carry verified end-user identity beside the agent. Issuing credentials and authenticating looks like this: 1. An operator registers an agent and creates an API key. 2. The runtime calls `ExchangeToken` with that key, receives a JWT, and sends the JWT on each request. 3. Dome confirms the agent is active, reads claims from the token, and proceeds to gateway and rule checks. 4. If the call also carries a verified act-as header, rules can test `principal.act_as` and audit records the end user next to the agent. Every request authenticates the agent with a self-contained session token. End-user claims are optional verified context beside that agent. Identity flow: API Key → Token Exchange → Session Token → Authenticated Request The gateway uses separate credentials for outbound backend calls. Follow the complete request path in [Architecture](/concepts/architecture). > **Note**: The CLI handles token exchange automatically. Run `dome auth login` and the CLI manages key exchange, token refresh, and header injection. ### How authentication works [#how-authentication-works] 1. **API key issuance.** Register an external agent and [create an API key](/build/agents/external#create-key). The key is returned once. Store it immediately. 2. **Token exchange.** The agent sends the API key to the Identity service (`ExchangeToken` with `grant_type: api_key`). The service validates the key, confirms the agent is active, and returns a short-lived JWT. Each external agent carries its own lifetime, set with `--token-ttl` or `token_ttl` when you [register or update the agent](/build/agents/external#token-lifetime) (default `10m`, range `1m`–`24h`). 3. **Session token.** The JWT carries the agent's identity for all subsequent requests. There is no round-trip to the Identity service on every call. The token is self-contained and verified locally. 4. **Authenticated requests.** Every API call, MCP invocation, and gateway request carries the session token. Services extract identity without additional lookups. ### Session token [#session-token] The session token is a JWT (HMAC-SHA256) carrying: | Claim | Description | | -------------- | -------------------------------------------------- | | `sub` | agent UUID | | `jti` | Unique token ID | | `iss` | `dome` | | `aud` | `["dome"]` | | `iat` / `exp` | Issued-at and expiration timestamps | | `agent_id` | agent UUID | | `tenant_id` | Tenant UUID. Scopes all operations to this tenant. | | `workspace_id` | Workspace UUID (when workspace context is set) | | `api_key_id` | The specific API key that minted this token | The token is self-contained: any service can verify it locally using the signing key without calling the Identity service. Expiration is enforced on every request. ### Act-as identity [#act-as-identity] Act-as identity identifies the end user represented by a [delegated agent](/concepts/identity-patterns#delegated-identity). Attach that user's claims with the `X-Dome-Act-As` header. Configure providers and the workspace floor on [Delegated agents](/build/agents/delegated). #### What it carries [#what-it-carries] Verified claims land on `principal.act_as` (`sub`, `email`, `roles`, `groups`, and custom `claims`). Claim list for setup: [Delegated agents](/build/agents/delegated#identity-claims). Attribute types for policy: [Rules](/reference/controls/rules#principal-attributes). #### How it's verified [#how-its-verified] Act-as claims are untrusted by default. Verification (`oidc`, `hmac`, `bound`, or `none` for development only) ensures the agent is not fabricating user identities. Method catalog: [Delegated agents](/build/agents/delegated#verification-methods). Configure verification at the [workspace level](/build/agents/delegated#require-verified-identity) as a baseline, or per-agent for tighter control. Workspace enforcement is a floor. Agents can add stricter verification but cannot weaken it. #### Act-as in authorization rules [#act-as-in-authorization-rules] Once verified, act-as claims are available in Cedar rules: ```cedar title="rules.cedar" // Allow tool access only when the end-user has the analyst role permit( principal, action == Dome::Action::"mcp:call", resource ) when { principal.act_as.roles.contains("analyst") }; ``` Full `principal.act_as` attribute notes are on the [Rules](/reference/controls/rules) reference. ## Next steps [#next-steps] With that authentication and act-as model in mind, continue with: * [Agents](/concepts/agents) concept for how agents are identified and authenticated * [Identity Patterns](/concepts/identity-patterns) concept for standing vs delegated design * [External agents](/build/agents/external) to create keys and manage agents * [Delegated agents](/build/agents/delegated) for act-as providers, methods, claims, and enforcement * [Architecture](/concepts/architecture) concept for where identity sits on the request path # Agents (/concepts/agents)

{agent}

## High-level overview [#high-level-overview] An agent is a durable identity in a workspace. It is separate from credentials and from access. An API key or short-lived token lets a runtime authenticate as the agent. Allowed resources, gateway access grants, and rules decide what requests Dome permits. You can rotate a key without changing permissions, or change permissions without issuing a new key. Agents use one of two execution models: * **External agents** have a worker you run in your own runtime. * **Managed agents** have a worker Dome runs. Both use the same identity, gateway grants, rules, lifecycle, and audit model. Registering an agent and calling through Dome looks like this: 1. An operator registers `data-pipeline`, allows a gateway and the tools behind it, and creates an API key. 2. The runtime exchanges the key for a session token and calls through the gateway. 3. Dome authenticates the agent, checks the access grant and resource membership, evaluates rules (and guards and quotas on the content path), and records the outcome against that agent identity. 4. Suspending the agent later stops traffic for that identity without deleting the record. One agent identity covers authentication, authorization, and audit. Credentials and access stay separate. ### Identity is not permission [#identity-is-not-permission] An agent credential identifies the caller. It does not contain the agent's permissions and is not bound to a specific gateway. The same agent credentials can use multiple gateways when the agent has an access grant to each one. Three separate checks must allow a request: | Check | Asks | | ---------------- | --------------------------------------------------- | | **Access grant** | May this agent use the gateway? | | **Membership** | Is this resource in the gateway? | | **rule** | May this agent perform this action on the resource? | Allowed resources on the agent record are shorthand for creating rules in the agent's rule bundle. Changing them needs `rules.deploy` in addition to permission to edit the agent. When the shorthand cannot express a condition, author rules directly. Refer to [Rules](/concepts/controls/rules) concept and [External agents](/build/agents/external#allowed-resources). ### Credentials [#credentials] Agents authenticate with an API key or a short-lived agent token minted from a key. Keys are issued once and cannot be retrieved again. Rotate or revoke a key to cut off that credential. Session tokens carry the agent UUID, tenant and workspace context, and the API key id that minted them, and each agent sets its own token lifetime. Details are on the [Agent Identity](/concepts/agents/identity) concept. ### Delegated identity [#delegated-identity] An external or managed agent can act for a person rather than only for itself (**delegated identity**). When it presents an act-as claim, Dome verifies the claim before authorizing the request, and the audit trail records the end user alongside the agent. Interactive agents receive the signed-in person's identity through [interactive access](/build/gateways/interactive-mcp-access) instead. Workspace and per-agent settings control whether a claim is required and which verified identities the agent may present. Refer to [Delegated agents](/build/agents/delegated) and [Identity Patterns](/concepts/identity-patterns) concept. ### External agents [#external-agents] An external agent is an agent whose worker you run in your own runtime. It authenticates to Dome with an agent credential and makes governed calls through a gateway. Refer to [External agents](/build/agents/external) to register and configure one. ### Managed agents [#managed-agents] A managed agent is an agent whose execution worker Dome runs. You configure its system prompt, model, gateway, and trigger. The trigger starts runs manually, on a schedule, or from a signed webhook. Calls from the managed agent still use the agent's gateway grant and rules, so the same authorization and audit model applies. Refer to [Managed agents](/build/agents/managed) to configure one. ### Interactive access [#interactive-access] Interactive access provisions a system agent record for signed-in human MCP traffic on one gateway. It does not run a worker and is not an external or managed agent. Refer to [interactive access](/build/gateways/interactive-mcp-access) to configure it. ### Lifecycle and hierarchy [#lifecycle-and-hierarchy] Every agent has a lifecycle state: provisioned, active, suspended, or revoked. Provisioned and active agents can send traffic. Suspended and revoked agents are rejected. Revocation is permanent and always cascades to descendants. An agent can have a parent in the same tenant (max depth 10). Hierarchy grants no access on its own. Refer to [Agent Lifecycle](/concepts/agents/agent-lifecycle) concept. ## Next steps [#next-steps] With the agent identity model in mind, continue with: * [Architecture](/concepts/architecture#agents) concept for where agents sit among components and controls * [Agent Identity](/concepts/agents/identity) concept for API keys, tokens, and act-as claims * [Agent Lifecycle](/concepts/agents/agent-lifecycle) concept for states and transitions * [Identity Patterns](/concepts/identity-patterns) concept for standing vs delegated design * [Managed agents](/build/agents/managed) to configure agent execution on Dome * [Gateways](/concepts/gateways) concept for reachability after identity * [Rules](/concepts/controls/rules) concept for what an agent may do once it reaches a resource * [External agents](/build/agents/external) to register, issue keys, and manage agents # Authorization model (/concepts/architecture/authorization-model)

{authorizationModel}

## How a request is decided [#how-a-request-is-decided] Each request maps to one principal (`Dome::Agent`), one action (`Dome::Action`), and one resource (`Dome::MCPTool` or `Dome::LLMModel`). Conditions may also read request `context` and, when present, verified act-as claims on the principal. ```cedar title="examples.cedar" permit( principal == Dome::Agent::"data-pipeline", action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"database-query" ); forbid( principal, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"production-deploy" ) unless { principal has metadata && principal.metadata has deploy_target && principal.metadata.deploy_target == "production" }; ``` ### Evaluation semantics [#evaluation-semantics] 1. The evaluator checks every rule in the effective policy against the request. 2. If **any** `forbid` matches, the request is **denied**, regardless of any matching `permit`. 3. If **no** `forbid` matches and **at least one** `permit` matches, the request is **allowed**. 4. If **no rule matches at all**, the request is **denied** (default-deny / fail-closed). `forbid` always wins. A `forbid` at organization scope cannot be overridden by a `permit` at agent scope. Design rules accordingly: broad restrictions at higher scopes, specific allowances at lower scopes. ### Escalations [#escalations] An `escalate` policy can route a matching authorization decision through an [escalation](/concepts/controls/escalations). A pending judgment stops the request. After a reviewer resolves it, the caller retries the request and the workflow’s terminal allow or deny outcome applies. Use an escalation for an individual request that requires review. Use `permit` and `forbid` rules when the decision should remain entirely deterministic. Configure the workflow and reviewers on [escalations](/govern/escalations). ## Effective policy [#effective-policy] The effective policy is the merged set of all active rule bundles across the [scope hierarchy](/concepts/platform/scopes). Assembly works as follows: 1. Fetch the active bundle at each scope: organization, tenant, workspace, agent. 2. Merge Cedar files with scope-prefixed filenames (`org/rules.cedar`, `workspace/rules.cedar`) to prevent name collisions. 3. Compute a composite content hash from the merged file list. 4. Load the merged policy into the evaluator as a single PolicySet. The gateway polls for content-hash changes on a sync interval (default: 10 seconds). When a bundle is deployed or rolled back, the hash changes and the gateway picks up the new policy on the next sync. ### Per-workspace vs per-agent evaluation [#per-workspace-vs-per-agent-evaluation] | Deployment | Evaluator | Use case | | --------------------------- | ------------------------------------------------------------------------------ | -------------------------------- | | **Hosted gateway** | `WorkspaceRuleEvaluator` maintains separate policy sets per assigned workspace | Multi-tenant shared gateway | | **SDK / dedicated runtime** | `RuleEvaluator` uses a single workspace policy set | Dedicated per-service deployment | Both evaluators enforce the same Cedar semantics. The hosted gateway adds per-workspace freshness checks. If a workspace's policy has not synced within its configured freshness window, the affected `tool.call` or `model.call` completes with `result=denied` and `denial.reason=stale_policy`. ## Fail-closed behavior [#fail-closed-behavior] The authorization model is fail-closed at every level: * **No matching rule:** denied by default. * **Evaluator error:** denied. * **Stale policy:** denied (hosted gateway only, per-workspace freshness window). * **No policy loaded:** denied. Cedar itself has no permissive or audit-only mode. Use [simulation](/govern/rules/simulate) to test rule changes before deploying. ## Next steps [#next-steps] With that Cedar evaluation model in mind, continue with: * [rules](/concepts/controls/rules) concept for bundles, scopes, and effective rules * [rules](/reference/controls/rules) reference for entity, action, and attribute catalogs * [Authorize access](/govern/rules) to write, validate, simulate, and apply rules * [Permissions](/concepts/platform/permissions) concept for platform RBAC (separate from Cedar) * [Scopes](/concepts/platform/scopes) concept for the hierarchy that feeds effective policy # Data plane (/concepts/architecture/dataplane)

{dataPlane}

## High-level overview [#high-level-overview] The data plane is the process that enforces traffic to gateway surfaces. A gateway is the named access surface you configure (membership and grants). Two **ingresses** share one engine, credential store, and audit pipeline. Both require a gateway prefix on the wire: * [Tools gateway](/concepts/gateways/tools-gateway) concept — MCP and related tool traffic at `/gateways//mcp` * [LLM gateway](/concepts/gateways/llm-gateway) concept — OpenAI- and Anthropic-shaped model traffic at `/gateways//v1/...` A request through the data plane looks like this: 1. An agent sends a request to `/gateways//...` with a Dome credential. 2. The data plane resolves the gateway, authenticates the agent, and checks admission. 3. It evaluates rules (and quotas on metered calls) and applies request guards. 4. It calls the backend with Dome-injected credentials, applies response guards, and writes an audit event. The agent never receives the backend secrets. The data plane is fail-closed. Stale policy, missing rules, unknown gateways, and evaluation errors deny the request rather than forwarding ungoverned traffic. ### Why the data plane exists [#why-the-data-plane-exists] Without a shared enforcement runtime, each agent integration would need its own way to authn, authz, inject credentials, filter content, and audit. The data plane centralizes that: * **One hot path** for tools and models, so rules, escalations, guards, quotas, and audit mean the same thing on both protocols * **Server-side credentials** so agents authenticate to Dome, not to every upstream * **Fail closed** when policy or gateway config cannot be trusted * **Deploy the same engine** as hosted, dedicated, or in-process SDK without changing rules ### How a request moves [#how-a-request-moves] Each call walks the same stages on the hot path. Audit records the outcome at the end: Data plane pipeline: Agent → Ingress → Evaluate → Egress → Filter → Backend, with Audit below | Stage | What happens | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Ingress** | Resolve the gateway from the URL, validate the agent credential, check gateway admission, verify act-as when present, apply kill switches and rate limits | | **Evaluate** | Load the workspace's effective Cedar policy and decide allow or deny. Stale policy denies. [quotas](/concepts/controls/quotas) can stop metered calls here | | **Egress** | Resolve the backend or model, inject stored credentials, forward over the configured protocol | | **filter** | Apply [guards](/concepts/controls/guards) and related content controls before the agent sees the response | | **Audit** | Emit an event for allowed, denied, filtered, and errored outcomes into the shared trail | Protocol details for MCP live on the [Tools gateway](/concepts/gateways/tools-gateway) concept. Model ingress behavior lives on the [LLM gateway](/concepts/gateways/llm-gateway) concept. Connections and routing live on the [Models](/concepts/resources/models) concept and [Pools](/concepts/resources/model-pools) concept. How Cedar decides a call is on the [rules](/concepts/controls/rules) concept and [Authorization Model](/concepts/architecture/authorization-model) concept. ### Credentials stay server-side [#credentials-stay-server-side] Backends declare an auth method (`none`, `api-key`, `oauth`) and a credential type: * **Shared** uses one credential for the connection. Every allowed caller reuses it. * **Per-user** gives each verified end user their own credential. First use can prompt provisioning (magic link / OAuth consent) Dome stores runtime secrets and injects them on egress. Agents present Dome credentials only. Configure connections on [Tools](/connect/tools) and [Models](/connect/models). ### Policy sync and fail-closed [#policy-sync-and-fail-closed] The hosted data plane polls the control plane for gateway membership, grants, rules, and related config (about every 10 seconds by default). Each workspace has a **freshness window**. If policy has not synced inside that window, requests deny with staleness rather than using an untrusted cache. Widen the window when rule changes are rare and brief sync gaps are acceptable. Narrow it when policy changes must bite quickly. ### Deployment shapes [#deployment-shapes] The same engine runs wherever your infrastructure demands. Behavior matches. Only where the control plane and data plane run changes: | Control plane | Data plane | Best for | | ------------- | ------------------------------------------- | ---------------------------------------- | | Dome-hosted | SDK in your code | Minimal footprint, in-process evaluation | | Dome-hosted | Hosted data plane (Dome-managed) | Fastest setup, fully managed | | Dome-hosted | Sidecar or self-hosted data plane (you run) | Control over the data path | | Self-hosted | Self-hosted | Full isolation, air-gapped environments | All combinations run the same Cedar evaluation engine and produce the same audit events. ## Next steps [#next-steps] With the data-plane hot-path model in mind, continue with: * [Architecture](/concepts/architecture) concept for where the data plane sits on the request path * [gateways](/concepts/gateways) concept for the access surfaces the data plane serves * [Tools gateway](/concepts/gateways/tools-gateway) concept for MCP ingress * [LLM gateway](/concepts/gateways/llm-gateway) concept for model ingress * [rules](/concepts/controls/rules) concept for authorization after admission * [guards](/concepts/controls/guards) concept for content inspection on the path * [Audit events](/concepts/audit) concept for the evidence trail * [Develop](/develop#errors-and-denials) for denial and credential wire shapes # Architecture (/concepts/architecture) Dome governs how AI agents access tools and models. The following components decide what happens to each request. For a high-level platform overview, start with [What is Dome?](/what-is-dome). ## High-level overview [#high-level-overview] Dome architecture separates into three kinds of concept: the **components** you define, the **controls** you apply to them, and the **audit** that records what happened. The **control plane** is where you configure those components and controls and sync that configuration. The **[data plane](/concepts/architecture/dataplane)** is where requests are enforced on the hot path. **Components** are what you define in the control plane: * **Agents** identify the applications and automated processes making requests. * **Resources** are the tools, model connections, and model pools exposed through Dome. * **gateways** group resources behind named endpoints and control which agents can reach them. **Controls** are what you apply to components to govern traffic: * **rules** authorize what an agent may do after reaching a gateway. * **escalations** route selected authorization decisions to review before a request proceeds. * **guards** inspect request and response content before it reaches its destination. * **quotas** cap what an agent can spend on model calls over a window. **[Audit events](/concepts/audit)** record every request's outcome across control-plane changes and data-plane decisions, so you can review or investigate it later. Within a workspace, these concepts have the following relationships: An agent reaches tools, model pools, and model connections through a gateway while traffic controls govern requests An agent reaches a gateway through an access grant, then reaches the tools, model pools, and model connections behind it through membership. On every call that passes through the data plane, rules, escalations, guards, and quotas govern the traffic, and Audit logs the outcome. The access grant, membership, and rule are three separate checks, and all three must allow the request: | Check | Asks | | ---------------- | --------------------------------------------------- | | **Access grant** | May this agent use the gateway? | | **Membership** | Is this resource in the gateway? | | **rule** | May this agent perform this action on the resource? | ### Agents [#agents] An **agent** is an identity in Dome. It represents the application, assistant, or automated process making a request. That identity can back either execution model: * An **external agent** runs its worker in your own runtime and authenticates through an API key or short-lived agent token. * A **managed agent** uses the same agent identity, while Dome runs its worker from the configured prompt, model, gateway, and triggers. In both cases, the agent identity is separate from its permissions and is not bound to one gateway. Gateway grants and rules decide what it can reach. Refer to [Agents](/concepts/agents) for the identity model, [External agents](/build/agents/external) to run a worker yourself, or [Managed agents](/build/agents/managed) to have Dome run one. ### Resources [#resources] A **resource** is something an agent can call through Dome. Dome supports three resource types: 1. **Tools** are MCP servers, local processes over stdio, or catalog-backed tool integrations. 2. **Model connections** point to LLM providers such as Anthropic, OpenAI, Google, or a self-hosted runtime. 3. **Pools** group model connections and add routing, weighting, and failover. Refer to [Resources](/concepts/resources) concept for how backends are modeled, and [Tools](/concepts/resources/tools) concept, [Models](/concepts/resources/models) concept, and [Pools](/concepts/resources/model-pools) concept for each type. ### Gateways [#gateways] A **gateway** is a named logical access surface in Dome. Each gateway packages a selected set of resources behind an endpoint and defines which agents may use it. A gateway is not a separately deployed data-plane process. A gateway can contain many resources, and the same resource can belong to more than one gateway. A registered resource that belongs to no gateway is **Unreachable**. A gateway exposes both tools and models through different protocol endpoints: * Tools use `/gateways//mcp` * models and model pools use `/gateways//v1/...` For a model call, the request can target a direct model connection or a model pool. Configured routing can also select a matching or default pool. A direct model connection must be a member of the gateway. When a pool is selected, Dome chooses one of its model connections. Tools and models do not have to share a gateway. You can use different gateways for different jobs, as long as each gateway grants that agent access and rules permit each request. An **access grant** gives an agent permission to use a gateway. A gateway can also grant access to every agent in its workspace. ### Rules [#rules] An access grant and membership get the request to the resource. A **rule** then controls what the agent may do once it's there, deciding tool calls and model calls the same way. Cedar, the default rule engine, evaluates the agent, requested action, resource, and request context, and denies the request by default when no rule matches. Dome combines rules from organization, tenant, workspace, and agent scopes. Those rules can permit access to one tool while forbidding another, even when both belong to the same gateway. Dome fails closed if it can't verify current policy, rather than falling back to a stale or default configuration. ### Guards [#guards] **guards** inspect content in both directions. Request guards inspect prompts or tool arguments before Dome calls the resource. Response guards inspect model output or tool results before content returns to the agent. Guards use ordered, connection-specific filters. A filter can redact, omit, or block matching content. Dome fails closed when an assigned filter cannot be evaluated, rather than forwarding uninspected traffic. Refer to [guards](/concepts/controls/guards) concept for the model and [Configure guards](/govern/guards) for configuration. ### Quotas [#quotas] **quotas** cap spend on model calls. Each quota sets a budget over a window at a chosen scope: workspace, agent, gateway, pool, model, or verified end user. Dome checks applicable quotas before it authorizes the call. An exhausted total cap rejects the request. An exhausted per-model budget can spill to another member of the pool. Refer to [quotas](/concepts/controls/quotas) concept for the model and [Set usage limits](/govern/quotas) for configuration. ## How requests move through Dome [#how-requests-move-through-dome] Every request passes through Dome before it reaches a tool or model. Dome identifies the agent, enforces access and authorization, applies request guards, calls the resource with protected backend credentials, and applies response guards before returning content. 1. **Send the request**: The agent runtime sends an API key or agent token to a gateway endpoint. 2. **Authenticate and check access**: Dome validates the credential, identifies the agent, and checks the active gateway, access grant, and resource membership. 3. **Verify represented identity**: If the request carries an act-as claim for an end user, Dome verifies it before exposing it to rules or backends. 4. **Check quotas**: For a metered call, Dome checks applicable spend quotas. An exhausted limit stops the request here. 5. **Apply rules**: Dome evaluates the agent, action, resource, and request context. A denied request stops here. 6. **Apply request guards**: Dome inspects configured prompts or tool arguments before they reach the resource. A guard can transform or block the request. 7. **Call the resource**: For an allowed request, Dome retrieves the backend credentials and calls the tool or model provider. The agent never receives those credentials. 8. **Apply response guards and return**: Dome inspects configured model output or tool results before disclosure, then returns the governed response. 9. **Record the outcome**: Dome writes an audit event for the permitted, denied, failed, or filtered result. Tool discovery follows the same core model. Tools blocked by rules are omitted from the catalog. Other access or operational failures can return an empty catalog or deny the request. If a model produces a tool call, the model does not invoke the tool itself. The agent runtime receives the tool request and makes a second call through the gateway's MCP endpoint. The model call and tool call are separate requests governed with the same agent identity. ## Workspaces and isolation [#workspaces-and-isolation] An **organization** is a company's top-level account. It contains one or more **tenants**, hard isolation boundaries usually drawn around a business unit or product line, such as a `Commerce` tenant kept separate from a `Support` tenant. Each tenant holds **workspaces** that scope day-to-day work, such as separate production and staging workspaces for the same team. Agents, resources, gateways, rules, escalations, guards, quotas, and audit events all live inside a workspace. Dome enforces tenant and workspace boundaries on every configuration and runtime request, so nothing scoped to one workspace leaks into another. ## Next steps [#next-steps] With the component and request-path model in mind, continue with: * [Scopes](/concepts/platform/scopes) concept for organization, tenant, and workspace isolation * [Agents](/concepts/agents) concept, [Resources](/concepts/resources) concept, and [gateways](/concepts/gateways) concept for the components you define * [rules](/concepts/controls/rules) concept, [escalations](/concepts/controls/escalations) concept, [guards](/concepts/controls/guards) concept, and [quotas](/concepts/controls/quotas) concept for the controls on each request * [Audit events](/concepts/audit) concept for the evidence trail * [data plane](/concepts/architecture/dataplane) concept for fail-closed runtime placement # Audit events (/concepts/audit)

{auditEvent}

## High-level overview [#high-level-overview] Dome keeps one audit system for configuration and runtime. Both write the same envelope into one workspace-scoped trail, with one query surface. Governance records both kinds of activity. The table below names each source, where its traffic arrives, and which actions it records. | Source | What it is | What it audits | | ----------------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | | **Configuration** | API, CLI, MCP, SDK, and dashboard calls that create or change settings | agent lifecycle, rule deploys, grants, credentials, workspace settings, identity and security actions | | **Runtime** | The [data plane](/concepts/architecture/dataplane) path that authorizes tool and model traffic | Admission, rule decisions, quotas, guards, tool and LLM call lifecycles | Joining a configuration change to a runtime decision looks like this: 1. An operator deploys a rule bundle. That write is a configuration state change. 2. Minutes later an agent calls a tool that the new rule denies. That denial is a runtime governing decision. 3. Both land as typed events in the same trail, so an investigator can move from "who changed policy?" to "what did that policy do at runtime?" without switching systems. Query, stream, and export, including `dome audit export` and scheduled forwarders, read that shared trail. Those surfaces do not choose a source. Filters narrow within the unified corpus. A few rules hold across the whole trail: * Configuration and runtime producers write the same envelope into one record. * If Dome cannot prove a governed mutation was recorded, it denies the action. * Use `activity_id` to follow a story across requests or planes, and `trace_id` to join one request. * Who queried or exported the trail is itself recorded in the trail. * Gateway decisions often leave `request_surface` unset. Join through correlation when you need client origin. ### How surfaces consume the trail [#how-surfaces-consume-the-trail] Product surfaces do not invent separate evidence stores. They consume the same activity in different shapes: | Surface | Contract | Job | | ------------------------------------- | ---------------------------------------- | ------------------------------------------------------------ | | **Audit v1** | Full forensic envelope + typed `payload` | Durable evidence: query, stream, export, ingest | | **Webhooks** (`dome.webhook.v1`) | Slim public envelope + `data` | Real-time automation through signed HTTP delivery | | **OpenTelemetry / product telemetry** | Separate models | Observability and product analytics, not compliance evidence | [Audit events](/operate/audit) and [Stream Live Events](/operate/observe) both read **Audit v1**: the same workspace trail, same envelope, same type catalog, and same filter vocabulary. Audit queries and reconstructs. Streaming shows the present. [Subscribe to Events](/operate/webhooks) delivers a **public projection** of overlapping activity. Refer to [Webhooks](/concepts/audit/webhooks) concept for the delivery model. Webhook `event_type` values are the same names as Audit schema-v4 operations (`agent.suspend`, `tool.call`, `guard.filter.evaluate`). The wire shape, field names, PII rules, and catalog size still differ: a webhook body is a slim public envelope plus `data`, and not every audit type is delivered. There is no `access.denied` type; a refusal is the operation's own event with `result=denied`. ### What an event records [#what-an-event-records] Every event uses the same envelope. The envelope answers the forensic questions without opening the typed payload. * **Who:** `actor` and optional `identity_chain` (including verified act-as end users) * **Where:** `scope` (organization, tenant, workspace, agent) and `request_surface` when the call had a direct network origin * **What:** `event_type`, `primary_resource`, and related resources * **Outcome:** `stage` (`attempted` or `completed`), `result` (`allowed` or `denied`), the shared `denial` block, and an independent `error` * **When:** `occurred_at` at the producer, `accepted_at` when the audit pipeline accepted the event * **How to join:** `correlation` (`trace_id`, `activity_id`), plus `operation_id` / `parent_event_id` for multi-phase actions The payload holds event-specific detail such as the tool name or token usage. Refusal detail is in the envelope's shared `denial` block. Envelope fields stay filterable across classes, so operators do not learn a different schema per producer. Refer to [Event contracts](/reference/events/contracts#envelope) reference for field-level contracts, enum forms, and filter syntax. ### Event classes [#event-classes] Events group into four classes. Class is a lens for investigation, not a separate store. The table below lists each class and the kind of action it covers. | Class | Role | | -------------- | ---------------------------------------------------------------------------------------------- | | `governing` | Authorization and runtime decisions: allows, denies, filters, quotas | | `state_change` | Configuration mutations: agents, rules, resources, gateways, integrations | | `security` | Authentication front door: login, session, impersonation, token exchange, credential rejection | | `audit_access` | Reads of the trail itself: query, get, stream, and export | Reading audit is audited. `audit_access` events are first-class evidence. Evidence of who inspected or exported the trail is part of the same record. Not every identity lifecycle signal is an audit event. `identity.session.created`, `identity.session.switched`, and `identity.session.rotated` live in operational telemetry (slog / OTEL), not Audit v1. Session rotation is a background \~5-minute token refresh, not a governed decision. `identity.session.terminated` remains on the trail. ### Why some decisions carry a policy snapshot [#why-some-decisions-carry-a-policy-snapshot] A governing decision that applied a loaded rule bundle stamps the policy snapshot into the payload: which bundle versions contributed, which rule matched, and the content-hash of the effective policy at decision time. That lets an investigator answer "which policy denied this?" and detect drift against today's deployed rules. Events with no loaded bundle omit those fields. Refer to [Event contracts](/reference/events/contracts#decision-provenance) reference for the stamped fields and which event types carry them. ### Correlation across sources [#correlation-across-sources] Three identifiers nest so a single human activity can span many HTTP hops and both configuration and runtime. Narrower scopes sit inside wider ones. | Scope | Field | Typical use | | -------------------------------------- | -------------- | ------------------------------------------------- | | One operation | `operation_id` | Joins `stage=attempted` to `stage=completed` | | One HTTP request cascade | `trace_id` | Everything stamped for one inbound request | | One session, LLM turn, or scripted run | `activity_id` | End-to-end chain across configuration and runtime | `trace_id` answers what happened in one request. `activity_id` answers what happened in the whole activity. An operator run that deploys rules and then exercises the gateway can share one activity chain. Configuration state changes and runtime tool calls group together when they carry the same `activity_id`. Chains are computed at read time inside a workspace. There is no stored chain object, only events that share an id. Trust labels (`server_owned` vs `caller_asserted`) describe how that id was set. Those labels do not split the chain. ### Why attribution differs by source [#why-attribution-differs-by-source] Configuration events carry `request_surface`: surface, source IP, user agent, and HTTP method. A person or automation called Dome directly, so those fields support pivots by IP or client during an incident. Runtime authorization decisions often leave `request_surface` unset. The initiator of a rule evaluation is the gateway hop, not a dashboard click, and the hop's IP would not identify the originating client. Those events pivot by `actor`, `activity_id`, or `trace_id`, then join back to an originating configuration or application event when IP attribution is required. Join through correlation when client origin is required. Gateway events stamp the gateway that scoped the request. A filter on `producer_gateway_id` answers "what happened on this gateway?" rather than "who called the API?" ### Durability and completeness [#durability-and-completeness] Audit is evidence, not best-effort telemetry. When durability cannot be proven, governed mutations fail closed rather than silently dropping the record. Dome denies the action rather than silently losing evidence. State-changing configuration paths co-commit audit with the business mutation when the design requires it. If audit cannot be accepted, the mutation fails. Security-sensitive admits (login, token issuance, impersonation start) follow the same posture. Forced terminations write after the fact with retry. Refusing to kill a revoked session because the audit store is down would be the worse failure. Reads and exports expose completeness metadata so a page of events is never silently mistaken for the full matching set. Interactive views may warn and still show readable rows. Strict export paths refuse to claim success on a gapped corpus. Retention and sink details are operational concerns. Conceptually, S3 (or the configured archive) is the store of record. Query indexes and live streams are projections of that trail. ## Next steps [#next-steps] With the one-trail audit model in mind, continue with: * [Event catalog](/reference/events/catalog) reference for every event type, its class, and webhook delivery * [Event contracts](/reference/events/contracts) reference for the Audit v1 and webhook envelopes, enum forms, and filters * [Audit events](/operate/audit) to query, filter, and reconstruct activity chains * [Stream Live Events](/operate/observe) to stream live Audit v1 events * [Subscribe to Events](/operate/webhooks) to deliver signed webhook projections * [Export Data](/manage/export) to ship retained history downstream # Webhooks (/concepts/audit/webhooks)

{webhook}

## High-level overview [#high-level-overview] Dome does not ship a separate event bus for integrations. The same underlying activity that lands on Audit v1 can also fan out as a **public projection** under `dome.webhook.v1`. Public event types use the Audit schema-v4 names byte for byte (`agent.suspend`, `tool.call`, `guard.filter.evaluate`). The body is still a slim public envelope plus `data`, not the forensic audit envelope, and the delivered catalog is a subset of the audit catalog. The one exception is `eventing.test`, a synthetic ping with no audit twin. A refusal is not its own event type. Subscribe to the operation (`tool.call`, `agent.suspend`, …) and filter on envelope `result=denied` (and optionally `denial.reason`). Names such as `access.denied`, `mcp.tool_call.completed`, and `llm.output.filtered` are retired. A webhook delivery looks like this: 1. An operator suspends an agent. That write is a configuration state change on the audit trail (`agent.suspend`). 2. If a subscription matches `agent.suspend`, Dome also renders a public body and POSTs it to each matching destination. 3. Downstream chat, SIEM, or workflow tools react without reading the forensic envelope. ### Subscription and destination [#subscription-and-destination] A **subscription** matches event types and optional filters. A **destination** is where deliveries go (custom URL or provider). Creating a subscription can provision the destination in the same call. Multiple subscriptions can share one destination so several event selections hit the same sink without duplicating credentials. Secrets (signing keys, provider credentials, secret header values, capability URLs) are write-only. They are set at create time, rotatable later, and never readable back. Reads mask every secret. ### What every destination guarantees [#what-every-destination-guarantees] Three guarantees hold across custom URLs and providers. * **At-least-once delivery.** Duplicates are possible. Dedupe on the `Dome-Event-Id` header. That ID is stable across retries and replays. * **Public fields only.** Payloads carry each event's versioned public contract. They never include PII, credentials, or raw tool payloads. * **Durable failure handling.** Failed deliveries retry with backoff for up to 72 hours, keep attempt history, and stay replayable for 30 days. Custom HTTPS destinations follow the [Standard Webhooks](https://www.standardwebhooks.com/) signing model so any off-the-shelf verifier works. Providers that authenticate with a credential in the body (for example PagerDuty) receive no `webhook-signature` header. The credential is the authentication. ### Providers as rendered projections [#providers-as-rendered-projections] A destination can target an off-the-shelf provider by picking it and pasting credentials. Dome renders the wire format that provider expects (Datadog array wrap, GitHub `repository_dispatch`, Slack message, and so on). The rendered body is deterministic. Retries and replays reuse the same bytes. Discover required settings and credentials with `dome webhooks providers list` and `dome webhooks providers get `. Eleven providers authenticate via a paste-in capability URL. Dome stores the URL write-only and displays only its host. | Category | Examples | | -------------------------- | ------------------------------------------------------------------------------------- | | Observability and SIEM | Datadog, Splunk HEC, Elasticsearch, New Relic, Dynatrace, Google SecOps, Grafana Loki | | Automation and workflow | GitHub, Jira Automation, Zapier, Tines, n8n, ServiceNow, Azure Event Grid | | Incident response and chat | PagerDuty, Slack, Microsoft Teams, Discord, incident.io | ### Why retries and circuit breaking exist [#why-retries-and-circuit-breaking-exist] Transient failures should not drop a security or lifecycle signal. Dome retries on a backoff schedule (1m, 5m, 15m, 1h, 4h, then every 6h with jitter) for up to 72 hours. | Response | Handling | | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | | `2xx` | Delivered | | `408`, `409`, `425`, `429`, any `5xx`, network timeouts | Retried until the 72-hour window closes | | Any other `4xx`, any `3xx` (redirects are not followed), TLS failures | Terminal `failed`. The destination rejected the request, so retrying does not help | A delivery that exhausts the window lands in `expired`. Both `failed` and `expired` stay recoverable via replay while the body is retained. Each destination also has a circuit breaker. Twenty failures within 10 minutes pause deliveries to that destination for 5 minutes while other destinations keep flowing. Paused deliveries retry. They are not failed. That protects a healthy sink from a stuck peer without discarding the queue. ### Operating limits [#operating-limits] Dome-managed constraints for destinations and deliveries: * **Custom endpoints** are HTTPS-only. Private, loopback, link-local, cloud-metadata, IPv4-mapped, Teredo (`2001::/32`), and 6to4 (`2002::/16`) destinations are rejected. * **Custom headers**: up to 5 per destination; names up to 128 bytes, values up to 2048 bytes. `webhook-*` and `Dome-*` names are reserved. Secret header values are write-only and masked on every read. * **Body cap**: a rendered body over 128 KiB lands terminal (`body_too_large`) for that delivery. Sibling destinations still deliver. * **Delivery policy** is not configurable: 5 sends per second per destination, 5 in-flight, 10-second response timeout. * **Retention**: delivery bodies are retained 30 days, trimmed to 24 hours after a successful delivery. Attempt history stays queryable. * **Quotas**: subscriptions and destinations per workspace are plan-dependent. Over-quota creates fail with a resource-exhausted error. * **Deleting a subscription** stops routing and cancels pending deliveries immediately. History stays queryable. ### How this differs from Audit and Export [#how-this-differs-from-audit-and-export] | Path | Job | | ---------------------------------------------------------------- | ------------------------------------------------- | | [Audit events](/concepts/audit) / [Audit events](/operate/audit) | Durable forensic trail. Query and reconstruct. | | [Stream Live Events](/operate/observe) | Live Audit v1 stream inside Dome. | | **Webhooks** | Real-time signed delivery of a public projection. | | [Export Data](/manage/export) | Batch and scheduled ship of retained history. | Use webhooks when something must react now. Use audit or export when you need the full evidence record or a SIEM archive. ## Next steps [#next-steps] With the webhook delivery model in mind, continue with: * [Audit events](/concepts/audit) concept for the trail and how surfaces consume it * [Event contracts](/reference/events/contracts#webhooks) reference for the webhook envelope, headers, and bundles * [Event catalog](/reference/events/catalog) reference for which event types are delivered * [Subscribe to Events](/operate/webhooks) to create, verify, inspect, and replay * [Export Data](/manage/export) for batch delivery of retained history # Escalations (/concepts/controls/escalations)

{escalation}

## High-level overview [#high-level-overview] The escalation control adds a review step to selected authorization decisions. A Cedar `escalate` policy identifies the requests that need review, and the workflow ends with an allow or deny outcome. Escalation workflows are workspace-scoped and versioned. Use them when a static rule is not enough because a designated reviewer must approve or deny an individual request. An escalation handles a sensitive request as follows: 1. A Cedar `escalate` policy matches an agent, action, and resource. 2. The request does not proceed while its required judgment is pending. 3. A reviewer inspects the judgment context and records `approve` or `deny`. 4. The caller retries the request, and Dome applies the workflow’s terminal outcome. Each judgment applies to one triggering request. A later matching request creates its own review, even when it reaches the same escalation. ### When to use an escalation [#when-to-use-an-escalation] Use an escalation when an action needs case-by-case review, such as accessing sensitive employee records or running a high-impact tool. Keep deterministic rules for requests that should always allow or deny without review. Start with a narrow Cedar policy. Expand it only after reviewers confirm that the judgment volume and context are useful. ### What reviewers see [#what-reviewers-see] Reviewers see the triggering request's audit context and the rules that routed it to review. They do not see the raw request body in the judgment record. Resolved judgments and escalation outcomes remain in the audit trail. Export audit records when your SIEM or review process needs the same decision history. ## Next steps [#next-steps] With the escalations model in mind, continue with: * [escalations](/govern/escalations) to create workflows, attach Cedar policies, and resolve judgments * [rules](/concepts/controls/rules) concept for deterministic authorization * [Authorization model](/concepts/architecture/authorization-model) concept for Cedar evaluation * [Audit events](/concepts/audit) concept to investigate and export decision history # Guards (/concepts/controls/guards)

{guard}

## High-level overview [#high-level-overview] Guards attach to a specific model or tool **connection** and to one **direction** (`request` or `response`). They run on the content path after the call is authorized. When an assigned guard cannot be evaluated, the gateway blocks that connection and direction. It never relays the traffic without inspection. Two guard types are available: * **Filters** rewrite or withhold content. You assign them in an ordered chain on a connection and direction. * **Validators** are pure predicates on tool connections. They never mutate. Every assigned validator must pass. Assigning a filter and seeing it run looks like this: 1. An operator creates a text filter that redacts SSNs and assigns it to the response direction on a model connection. 2. On the next gateway config sync, that connection runs the filter over streamed completions. 3. Matching spans are redacted before the agent sees them. 4. If an assigned filter later cannot be decoded, the gateway blocks that direction until the operator rolls back or clears the chain. Guards inspect content at the connection and fail closed when inspection cannot run. ### Directions [#directions] Each guard assignment binds to one direction on a connection. | Direction | model connection | tool connection | | ---------- | ----------------------------------------------- | ------------------------------------------------ | | `request` | Prompt before dispatch to the model provider | tool arguments before dispatch to the MCP server | | `response` | Streamed completion before it reaches the agent | tool result before it reaches the agent | Request guards can transform content or block a call. Response guards run before any inspected content reaches the caller. ### Filters [#filters] A filter is workspace-scoped and versioned. Assigned connections pick up the active version on the next gateway sync. Previous versions remain available for rollback. Filter kind is immutable and decides which connections the filter can attach to. | Kind | Connection | Role | | ------ | ---------- | ----------------------------------------------------------------------------- | | `text` | model | Substring and pattern inspection on prompts or completions | | `json` | tool | Field-path and optional value-content inspection on tool arguments or results | Each `(connection, direction)` slot holds one ordered filter chain. Setting a chain replaces the complete list for that slot. Model connections accept only `text` filters. Tool connections accept only `json` filters. Narrow transforms ahead of broad blocking matchers keep audit attribution predictable when multiple matchers could fire. A matching `BLOCK` short-circuits the chain. Kinds, actions, path syntax, and content matchers are on the [Guards](/reference/controls/guards#filters) reference. JSON filters apply symmetrically to MCP tool calls. A request-direction filter inspects outbound `tools/call` arguments before the gateway forwards them. A response-direction filter inspects the tool result before it reaches the agent. Use filters when sensitivity is a property of the content (free-text arguments, documents, transcripts). Prefer path matchers when sensitivity is a property of the field name. On a JSON chain, `REDACT` and `OMIT` can co-occur — neither short-circuits the other. `BLOCK` wins the chain, but earlier actions remain in the audit payload. Acting filters emit the verdictless `guard.filter.evaluate` event with `direction`, `actions`, `blockedByFilterIds`, `redactedByFilterIds`, and `omittedByFilterIds`. A block makes the enclosing `tool.call` or `model.call` complete with `result=denied` and `denial.reason=guard_blocked`. Payload details are on the [Guards](/reference/controls/guards#guard-audit-events) reference. ### Validators [#validators] A validator is workspace-scoped and versioned. It checks structured conditions on a tool request or MCP tool response and blocks when any condition fails. Validators never redact or omit fields. | Kind | Edge | Role | | --------------- | -------- | --------------------------------------------------- | | `tool_request` | Request | Required paths and size limits on tool arguments | | `tool_response` | Response | Required paths and shape checks on MCP tool results | Validators attach as an unordered set on a tool connection and direction. Every assigned validator must pass. Response validators are MCP-only. Condition catalogs are on the [Guards](/reference/controls/guards#validators) reference. ### Streaming model responses [#streaming-model-responses] LLM chat responses arrive as fragmented SSE chunks. The gateway buffers each connection's response into a sliding window and runs response filters over the decoded text so multi-chunk patterns are visible. The effective window is `max(workspace floor, connection override, per-request override)`. A layer set to `0` drops out of the max. Window bounds and where each layer is set are on the [Guards](/reference/controls/guards#streaming-window) reference. How to set them is on [Guards](/govern/guards#configure-the-streaming-window). ## Next steps [#next-steps] With the guards content-inspection model in mind, continue with: * [Architecture](/concepts/architecture#guards) concept for where guards sit in the request path * [Rules](/concepts/controls/rules) concept for allow and deny before content inspection * [Guards](/reference/controls/guards) reference for filter and validator catalogs * [Configure Guards](/govern/guards) to create filters and validators, assign them, and tune streaming windows # Quotas (/concepts/controls/quotas)

{quota}

## High-level overview [#high-level-overview] A quota is a budget attached to one **subject** inside a workspace: the workspace itself, one agent, one verified end user, one gateway, one pool, one model, one tool, or one tool connection. The quota names a limit and a window (`daily` or `monthly`). Depending on its dimension, it can measure Dome USD, estimated provider USD, tokens, or calls. Dome adds matching governed usage to every applicable budget and checks those budgets before the next call proceeds. Setting a quota and exhausting it looks like this: 1. An operator sets a monthly workspace quota of $5,000. 2. Agents keep calling models through a gateway. 3. Each completed call adds priced spend to the workspace counter for the current UTC month. 4. While spend stays under $5,000, calls continue. The first call that would push the counter over the cap receives HTTP `429`. 5. The same call can also hit an agent quota, a gateway quota, and a model quota. Every matching budget must still have room. Pick who owns the budget and how often it resets. Dome refuses or reroutes when the money is spent. ### When a Quota change takes effect [#when-a-quota-change-takes-effect] The **limit** you set (subject, amount, window, enabled) is workspace config. Dome loads that config on a poll interval (default about 10 seconds), the same tick that picks up model, pool, and guard config. A new or updated quota may not shape enforcement until the next successful sync. After that sync, the new limit is live. If one workspace cannot be refreshed, its last applied configuration keeps serving while Dome retries; the failure does not block configuration updates for other workspaces. **Spend** moves when priced calls complete. Edit the quota form and the raw usage already recorded in the window does not disappear. Raise a limit and enforcement still accounts for that full usage. Disable a quota and that budget stops being checked. Other quotas that still apply keep their own counters. ### Every matching Quota must pass [#every-matching-quota-must-pass] Subjects carve different slices of the same traffic. A single model call can touch several quotas at once: the workspace total, the calling agent, a verified Act-As user, the gateway in the URL, the pool that routed the call, and the model that served it. Dome allows the call only when every applicable enabled quota still has remaining budget. An agent quota with room left cannot override an exhausted workspace quota. Subject types and what each rejects are on the [Quotas](/reference/controls/quotas#subjects) reference. ### Windows reset spend, not the Quota [#windows-reset-spend-not-the-quota] A window is the calendar period the counter covers. `daily` resets at UTC midnight. `monthly` resets at the start of each UTC calendar month. The default on create is `monthly`. You can keep both a daily and a monthly quota on the same subject. They are separate budgets. When the window rolls over, spend for that window starts at zero again. The quota itself stays until you update or remove it. Details are on the [Quotas](/reference/controls/quotas#windows) reference. ### Organization and tenant allowances [#organization-and-tenant-allowances] An organization or tenant can also have a usage allowance: a daily or monthly cap on all governed traffic, LLM traffic, or tool traffic at that scope. Unlike a workspace quota, it does not name a resource subject. It is a shared ceiling for the organization or tenant context. Use a workspace quota to constrain a particular workspace, agent, route, model, or tool. Use an allowance when the limit must apply across the organization or tenant. The [Quotas](/govern/quotas#set-an-organization-or-tenant-usage-allowance) how-to shows how to create one. ### Exhaustion: reject or spill inside a pool [#exhaustion-reject-or-spill-inside-a-pool] Most quotas reject affected calls with HTTP `429` when the budget is gone. Model quotas inside a pool can behave differently. The resolver skips the exhausted member. If another eligible pool member remains, the caller never sees the exhaustion. If every member is unavailable or exhausted, the gateway returns HTTP `429` with `subject_type: all_members`. Direct calls to an exhausted model (no pool spillover path) return HTTP `429` with `subject_type: model`. Quota enforcement is a barrier applied before the pool's routing strategy runs, so spillover composes with `priority_weighted`, `round_robin`, and `least_loaded` alike. Refer to [Pools](/concepts/resources/model-pools) concept and [model Quotas](/reference/controls/quotas#model-quotas) reference. ### What counts toward a Gateway Quota [#what-counts-toward-a-gateway-quota] A gateway quota follows the gateway in the request path, not a fixed membership snapshot. Usage accrues when a call is routed through that gateway, whichever pool or model member serves it. Membership can change during the window. Spend still lands on the same gateway quota. Passthrough LLM calls are still checked against quotas, but they do not add priced spend. The opaque body carries no token usage to meter. ### A Quota is also a billing promise [#a-quota-is-also-a-billing-promise] Distributed enforcement can serve a straddling call or a small amount of traffic beyond a cap before every gateway sees the updated total. For units Dome bills — Dome USD, tokens, and calls — Dome records the excess when usage is folded and excludes it from billing. Overlapping quotas do not create duplicate credits for the same usage. The usage shown for those units is the billable amount and never exceeds the configured limit. Raising, deleting, or recreating a quota later does not make previously written-off usage billable. Enforcement remains conservative: it continues to use full usage, including the excess that Dome wrote off. `provider_usd` is different. It estimates the organization's upstream provider bill, which Dome does not invoice. Dome therefore reports that estimate without clamping or writing it off; the quota controls future routing or rejection but cannot change a provider charge already incurred. ### What you see in audit [#what-you-see-in-audit] Completed model calls emit `model.call` with `stage=completed` and token counts. Exhaustion is the refused operation itself with `result=denied` and `denial.reason=quota_exceeded`. Create, update, and delete emit their own lifecycle events. Event names are on the [Quotas](/reference/controls/quotas#observability) reference. ## Next steps [#next-steps] With the quotas spend-cap model in mind, continue with: * [Architecture](/concepts/architecture#quotas) concept for where quotas sit in the request path * [Rules](/concepts/controls/rules) concept for allow and deny before spend metering * [Guards](/concepts/controls/guards) concept for content inspection after authorization * [Quotas](/reference/controls/quotas) reference for subjects, windows, and event names * [Set Usage Limits](/govern/quotas) to create, update, list, and remove quotas # Rules (/concepts/controls/rules)

{rule}

## High-level overview [#high-level-overview] Dome stores rules in **bundles** at organization, tenant, workspace, and agent scope. Before forwarding a request, Dome combines every active bundle that covers the authenticated agent and evaluates the request against that set. Dome allows the request only when at least one `permit` matches and no `forbid` matches, regardless of which scope each rule came from. Dome also denies any request it cannot evaluate because a rule errors or its rule data is missing or stale. Applying a rule and hitting it at runtime looks like this: 1. An operator applies a workspace bundle that permits `mcp:call` on `github/list_issues` for a named agent. 2. Minutes later that agent calls the tool through its gateway. 3. Dome loads the agent's effective rules, finds a matching `permit` and no matching `forbid`, and forwards the call. 4. A later org-scoped `forbid` on the same tool would deny the call even if the workspace `permit` still exists. ### What a Rule states [#what-a-rule-states] A rule states an effect (`permit` or `forbid`) and the requests that effect applies to. Inside the parentheses it names a principal, an action, and a resource. Optional `when` / `unless` conditions narrow the match further. ```cedar title="starter.cedar" permit( principal, action == Dome::Action::"mcp:discover", resource ); ``` That rule lets every agent in scope list available tools. It does not let them call a tool. Constraint forms, actions, and attributes are on the [Rules](/reference/controls/rules) reference. ### Bundles, not lone Rules [#bundles-not-lone-rules] Dome never stores or deploys a single rule on its own. You organize rules into one or more `.cedar` files and apply them together as a **rule bundle** at one scope. Each scope holds one active user-authored bundle. Applying a new bundle replaces the active one. An apply must include every file that should remain active. Earlier versions stay in history so you can roll back. Dome also writes its own **generated bundles** alongside yours at the same scope. Agent allowed resources, Act-As settings, blocked tools, and other managed configuration produce them. Change those rules through the feature that created them, not by applying or rolling back their bundle directly. ### Where Rules apply [#where-rules-apply] A rule's constraints decide which requests it matches. The scope of the bundle holding it decides which agents it can affect at all. | Scope | agents affected | | ------------ | ------------------------------------------ | | Organization | agents in every tenant in the organization | | Tenant | agents in every workspace in the tenant | | Workspace | Every agent in the workspace | | agent | One agent | Scope decides which rules take part in a decision, not which rule wins. Dome evaluates every covering bundle as one set. A narrower scope carries no extra weight. A `permit` from any scope can allow a request. A `forbid` from any scope denies it. An agent-scoped `permit` cannot reopen access that an organization-scoped `forbid` closes. ### Effective Rules [#effective-rules] The **effective rules** for an agent are the merged set of every active bundle that covers that agent, including generated bundles. The assembled set includes flat Cedar files for the evaluator, a content hash for change detection, and the list of contributing bundles. The gateway caches effective rules and polls for content-hash changes (default sync interval: 10 seconds). Rule changes propagate without restarting the gateway. There is a brief delay between apply and enforcement. Assembly steps, freshness windows, and fail-closed behavior when rules are missing or stale are on the [Authorization Model](/concepts/architecture/authorization-model#effective-policy) concept. ## Next steps [#next-steps] With that rules authorization model in mind, continue with: * [Authorize Access](/govern/rules) * [Authorization Model](/concepts/architecture/authorization-model) concept * [Rules](/reference/controls/rules) reference * [Gateways](/concepts/gateways) concept — reachability before rules run # Gateways (/concepts/gateways)

{gateway}

> **Note**: Every gateway has a complete `/gateways/` URL plus protocol-specific MCP, OpenAI, and Anthropic endpoints. ## High-level overview [#high-level-overview] A gateway is a workspace entity that packages membership and grants behind one URL for both protocols. The same gateway URL serves tool traffic at `/gateways//mcp` and model traffic at `/gateways//v1/...`. The [Tools gateway](/concepts/gateways/tools-gateway) and [LLM gateway](/concepts/gateways/llm-gateway) are ingresses on the [data plane](/concepts/architecture/dataplane) that require that gateway prefix — they are protocol paths, not kinds of gateway. Each gateway carries two relationships: * **Membership** lists which tools, tool sources, pools, and model connections belong to this gateway * **Access grant** lists which agents may call this gateway A resource in no gateway is valid but **Unreachable**. An agent without a grant is rejected at the edge before rules run. Membership and grants package *reachability*. [Rules](/concepts/controls/rules), [Guards](/concepts/controls/guards), and [Quotas](/concepts/controls/quotas) still decide what happens after admission. Standing up and calling through a gateway looks like this: 1. An operator creates a gateway (or uses the Default gateway), adds the tools and models that surface should expose, and grants an agent access. 2. The agent points its client at `/gateways/`. 3. Tool calls and model calls use the same gateway id with different path suffixes. 4. Dome admits the agent, checks membership, evaluates rules, then serves the call through the tools or LLM ingress. A gateway is the unit of curated reachability for both tools and models. ### Why Gateways exist [#why-gateways-exist] Without gateways, every callable resource in the workspace competes for the same front door, or operators encode reachability only in Cedar. Gateways give you a named bundle you can grant as one unit: * Attach related tools and models once, then grant the gateway to each agent that should see that bundle * Keep credentials and rules separate. Rotating a key does not change membership. Rewriting rules does not redefine which endpoint an agent calls. * Fail closed without a gateway prefix: every caller must choose a gateway (`/gateways//...`) ### When to use one Gateway vs many [#when-to-use-one-gateway-vs-many] **One gateway is enough** when a workspace has a single shared set of tools and models and every active agent should reach that set. New workspaces start with a **Default gateway** that is empty until you attach members and grants. Free and Pro plans allow one gateway per workspace. That Default gateway is usually the one you keep. **Create another gateway** when you need a second curated front in the same workspace, for example: * A coding agent may reach repo and CI tools. A support agent may reach ticket and CRM tools. Same workspace, different memberships and grants. * Production models stay on one gateway. Eval or shadow pools stay on another so agents cannot mix them by accident. * Human-operated MCP clients and automated agents should see different tool catalogs The same resource can belong to more than one gateway. An agent can hold grants to more than one gateway and pick the URL that matches the job. Prefer another gateway over duplicating connections when the split is “who may reach which set,” not “which upstream credential to store.” ### How a call is authorized [#how-a-call-is-authorized] Every `/gateways//...` request must pass three checks. The final decision is `addressable AND admitted AND Cedar-allowed`. 1. **Addressable:** The path names an active gateway in the caller's workspace. 2. **Admitted:** The agent has a grant to that gateway (discovery such as `tools/list` and `GET /v1/models` is exempt and stays membership- and Cedar-filtered). 3. **Cedar:** Workspace rules permit the action on the resource. Forbid wins. Admission never overrides a deny. So: gateway decides *whether this agent may use this front door and whether this resource is on it*. Rules decide *whether this action is allowed*. ### Default gateway [#default-gateway] Every workspace gets one auto-provisioned **Default gateway**. It is real, editable, and deletable. * **New workspaces** start with an empty Default gateway and no grants. Attach members and grants explicitly. * **Migrated workspaces** may already have resources attached, but agents still need explicit per-agent or all-agents grants. ## Next steps [#next-steps] With that gateway reachability model in mind, continue with: * [Gateways](/build/gateways) to create gateways, manage membership and grants, and build client URLs * [Architecture](/concepts/architecture#gateways) concept for where gateways sit among components * [data plane](/concepts/architecture/dataplane) concept for the runtime that serves gateway URLs * [Tools gateway](/concepts/gateways/tools-gateway) concept for the MCP ingress under a gateway * [LLM gateway](/concepts/gateways/llm-gateway) concept for the model ingress under a gateway * [Agents](/concepts/agents) concept for identity before reachability * [Rules](/concepts/controls/rules) concept for what an agent may do after admission # LLM gateway (/concepts/gateways/llm-gateway)

{llmGateway}

## High-level overview [#high-level-overview] Every model call targets a [Gateway](/concepts/gateways). Bare `/v1/...` fails closed with a `"select a gateway"` 400. The gateway, not the LLM ingress, is what you create and grant in Connect. A model call through the LLM gateway looks like this: 1. An operator adds a model connection (and often a pool), puts it on a gateway, and grants an agent access. 2. The agent points an OpenAI or Anthropic client at `https:///gateways//v1` with a Dome agent token. 3. Each call runs admission, pool resolution, rules, request guards, provider dispatch with injected credentials, response guards, and audit. The agent never sees the provider credential. The LLM gateway never exposes provider credentials to the agent. ### Endpoints [#endpoints] The LLM gateway exposes provider-native shapes so existing SDKs work without modification. Use the gateway's returned OpenAI or Anthropic base URL as-is. | Method | Path (relative to `/gateways/`) | Shape | | ------ | ----------------------------------- | ------------------------------- | | `POST` | `/v1/chat/completions` | OpenAI chat | | `POST` | `/v1/messages` | Anthropic messages | | `POST` | `/v1/embeddings` | OpenAI embeddings | | `POST` | `/v1/moderations` | OpenAI moderations | | `POST` | `/v1/responses` | OpenAI responses | | `POST` | `/v1/passthrough/:name` | Opaque per-provider passthrough | | `GET` | `/v1/models` | Cedar-filtered model listing | Streaming and non-streaming are both supported. SSE chunks are filtered in flight. For embeddings, `encoding_format` (`float` or `base64`) controls the response wire shape only. Refer to [Develop](/develop#route-traffic). Passthrough limits for `custom` connections are on the [Models](/reference/resources/models#custom-passthrough) reference. ### Pipeline [#pipeline] Model calls share these stages, with pool resolution and failover specific to this ingress: 1. **Ingress:** Resolve the gateway from the path, validate the bearer credential, extract agent identity, check kill switches, and translate the native request into Dome's canonical shape. 2. **Pool resolution:** Resolve the request's `model` value to a pool or direct connection. Order and `match_when` are on the [Pools](/reference/resources/model-pools#pool-resolution) reference. 3. **Authorize:** Evaluate Cedar against the upstream that will be dispatched. Stale policy fails closed. Refer to [Authorization](#authorization). 4. **Dispatch:** Call the provider through the connection's adapter. Dome injects credentials at request time. When the caller's wire shape matches the upstream's, the dispatcher forwards the original request body byte-for-byte, overlaying only the resolved model id and stripping the internal `_dome` envelope — caller-supplied params such as `cache_control`, `top_k`, and other provider-specific options reach the upstream unchanged. Cross-dialect calls (OpenAI client → Anthropic upstream, or vice versa) fall back to the canonical rebuild and lose provider-specific extensions in translation. Providers and credential pairings are on the [Models](/reference/resources/models) reference. 5. **Filter:** Apply [Guards](/concepts/controls/guards) over streamed and non-streamed content before the agent sees it. 6. **Failover:** On a transient upstream error, try further eligible pool members up to the failover limit. Each candidate is re-authorized first. Limits and streaming rules are on the [Pools](/reference/resources/model-pools#failover) reference. 7. **Audit:** Emit `model.call` events with token counts, matched rule, pool, and final upstream. Event types are on the [Event catalog](/reference/events/catalog) reference. Shared credential models and deployment topology live on the [Data plane](/concepts/architecture/dataplane) concept. Denial and credential wire shapes live on [Develop](/develop#errors-and-denials). ### Authorization [#authorization] LLM calls authorize against the same Cedar policy as tool calls, with resource type `Dome::LLMModel`. Policy evaluates the upstream that is **actually dispatched**: the primary member up front, and each failover candidate immediately before its own attempt. A `forbid` on a model or connection attribute holds for every upstream the call could reach, not just the primary. Use `resource.name` for the caller-facing alias, `resource.resolved_model` for the upstream that will run, and `resource.pool` when the request was routed through a pool. Injected attributes and evaluation notes are on the [Rules](/reference/controls/rules#llm-injected-attributes) reference. Pool grants and listing behavior for `GET /v1/models` follow the same rules. Refer to [Rules](/concepts/controls/rules) concept and [Authorize Access](/govern/rules). **Non-streaming.** A deny on the primary is terminal. A policy-refused failover candidate is skipped (the `model.call` completes with `result=denied`) rather than treated as a successful route-around. **Streaming.** Failover applies only before the first response byte reaches the caller. After that, a later upstream failure terminates the stream. Verified [act-as identity](/concepts/agents/identity#act-as-identity) concept is forwarded into evaluation on every LLM endpoint. Configure verification on [Delegated agents](/build/agents/delegated). Runtime errors and denial shapes are on [Develop](/develop#errors-and-denials). ## Next steps [#next-steps] With the LLM gateway model in mind, continue with: * [Gateways](/concepts/gateways) concept for membership, grants, and URL shape * [Tools gateway](/concepts/gateways/tools-gateway) concept for the sibling MCP ingress * [Data plane](/concepts/architecture/dataplane) concept for the shared enforcement pipeline * [Models](/concepts/resources/models) concept and [Pools](/concepts/resources/model-pools) concept for connections and routing * [Models](/reference/resources/models) reference and [Pools](/reference/resources/model-pools) reference for providers, credentials, and routing catalogs * [Rules](/reference/controls/rules#llm-injected-attributes) reference for LLM resource attributes * [Models](/connect/models) and [Pools](/connect/pools) to configure connections * [Develop](/develop) to point SDKs at a gateway and handle denials # Tools gateway (/concepts/gateways/tools-gateway)

{toolsGateway}

## High-level overview [#high-level-overview] Every tool call targets a [Gateway](/concepts/gateways). Bare `/mcp` fails closed with a `"select a gateway"` 400. A tool call through the tools gateway looks like this: 1. An operator adds an MCP server connection, puts it (or its tools) on a gateway, and grants an agent access. 2. The agent points an MCP client at `https:///gateways//mcp` with a Dome agent token. 3. Discovery (`tools/list`) returns membership- and Cedar-filtered tools. 4. Each `tools/call` runs admission, rules, request guards, egress with injected credentials, response guards, and audit. The tools gateway never exposes backend credentials to the agent. ### Endpoints [#endpoints] | Path (relative to `/gateways/`) | Role | | ----------------------------------- | ----------------------------------------------- | | `/mcp` | MCP Streamable HTTP session and JSON-RPC frames | Point MCP clients at the gateway's returned `mcp_url`. Do not omit the `/gateways/` segment. The tools gateway speaks MCP Streamable HTTP only. It does not support the legacy standalone SSE transport, so configure clients for `http` (or `streamable-http`), not `sse`. ### Pipeline [#pipeline] Tool calls share these stages: 1. **Ingress:** Resolve the gateway from the path, validate the bearer credential, extract agent identity, check gateway admission (discovery exempt), verify act-as when present, apply kill switches and rate limits. 2. **Evaluate:** Load the workspace Cedar policy and authorize the tool action. Stale policy fails closed. 3. **Egress:** Resolve the backend from the tool catalog, inject stored credentials, forward over MCP Streamable HTTP, stdio, or REST catalog. 4. **Filter:** Apply response guards and field-level redaction before the agent sees the result. 5. **Audit:** Emit `tool.call`, filtering, discovery, and denial events stamped with the gateway id. Details of credential models, denial wire shapes, and deployment topology live on the [Data plane](/concepts/architecture/dataplane) concept. ### Discovery vs invoke [#discovery-vs-invoke] `tools/list` stays membership- and Cedar-filtered and does not require a gateway access grant at the edge. `tools/call` requires addressability, admission, and Cedar. A tool that is not a member of the addressed gateway does not appear for that caller. ### Egress protocols [#egress-protocols] | Protocol | Use case | | ----------------------- | -------------------------------------------------------- | | **MCP Streamable HTTP** | Primary protocol for MCP-native backends. | | **Stdio** | Local backends spawned by the gateway runtime. | | **REST Catalog** | HTTP tool discovery and invocation for non-MCP backends. | ## Next steps [#next-steps] With the tools gateway model in mind, continue with: * [Gateways](/concepts/gateways) concept for membership, grants, and URL shape * [Data plane](/concepts/architecture/dataplane) concept for the shared pipeline, credentials, and readiness * [LLM gateway](/concepts/gateways/llm-gateway) concept for the sibling model ingress * [Tools](/concepts/resources/tools) concept for credentials, catalogs, and reachability * [Tools](/connect/tools) to register MCP and tool connections * [Gateways](/build/gateways) to attach tools to a gateway # Permissions (/concepts/platform/permissions)

{permissions}

## Two authorization layers [#two-authorization-layers] Dome separates who can administer the platform from what agents may do at runtime. The layers look different on purpose: | Layer | Principal | Governs | Decision point | | ----------------------- | ---------------------------------------------- | ----------------------------------------------------- | -------------------- | | **Platform RBAC** | User, service account, or scoped API key | CLI commands, API endpoints, and MCP management tools | Dome API / CLI / MCP | | **agent authorization** | Registered agent with optional act-as identity | tool calls and model invocations | gateway request | Granting a user `operator` does not authorize an agent to call a tool. A Cedar `permit` does not grant that user platform administration. Both layers fail closed and record audit events. Apply each layer independently. ## How roles cascade [#how-roles-cascade] RBAC roles are assigned at workspace, tenant, or organization scope. Higher-scope roles cascade their equivalent workspace permissions into every workspace below them. Refer to [Scopes](/concepts/platform/scopes) concept for the hierarchy. Workspace roles cover day-to-day work in one workspace (`admin`, `operator`, `security`, `developer`, `viewer`, plus reserved `impersonator`). Tenant roles add tenant-wide operations and can cascade a workspace role into every workspace in the tenant. Organization roles are the broadest standing grants and cascade into every tenant and workspace in the org. Use tenant or org roles when someone needs the same access everywhere below that scope. Use a workspace role when access should stay local. Exact permission IDs and role matrices are on the [Permissions](/reference/permissions) reference. Org `owner` and `admin` hold org-scoped `tenants.manage`, which also gates org-membership management (`ListOrgMembers`, `AssignOrgRole`, `RemoveOrgMember`), and org-scoped `audit.view`, which widens [audit reads across the organization](/operate/audit#query-events-across-an-organization). Only an owner may grant or remove the `owner` role. Removing the last owner returns `FailedPrecondition`. Organization billing and model-rate administration use separate permissions. `billing.manage` covers the organization's plan, seats, invoices, and payment methods. `modelrates.manage` covers the organization's upstream provider contract rates. Owners and admins hold both by default, but an org-scoped API key can be limited to one. ### Cross-domain workspace invitees [#cross-domain-workspace-invitees] When a user is invited to a workspace and their email domain does not match any of the org's verified domains, Dome auto-provisions tenant and org memberships with role `unprivileged` rather than `member`. That keeps cross-domain collaborators scoped to the workspaces they were explicitly invited to. * The invitee receives no org or tenant permissions, only the workspace role chosen by the inviter. * The invitee is excluded from auto-enrollment into open tenants on first login. * The invitee does not block the first-user-becomes-owner / first-user-becomes-admin auto-promotion logic. * If the org later verifies the invitee's domain, existing `unprivileged` memberships are promoted to `member` automatically. Previously assigned higher roles are preserved. * If the invitee's last workspace membership in a tenant is removed (or the workspace itself is deleted), the orphaned `unprivileged` tenant and org memberships are cleaned up automatically. Higher operator-granted roles survive workspace removal. If the org has no verified domains yet, all workspace invitees default to `member` so onboarding stays workable. ## Agent authorization is separate [#agent-authorization-is-separate] Agent requests are authorized with Cedar on each governed call. Platform RBAC never substitutes for a Cedar `permit`. Refer to [Authorization Model](/concepts/architecture/authorization-model) concept for entities, permit/forbid semantics, and effective policy. Write and deploy rules on [Authorize Access](/govern/rules). ## How RBAC maps to surface visibility [#how-rbac-maps-to-surface-visibility] RBAC roles filter what you see across surfaces. * **CLI** hides commands your role cannot use in the `--help` menu. Invoking one you lack permission for returns an authorization error. * **API** checks permissions before executing endpoints. Unauthorized calls return 403. * **MCP** filters tools by role. Tools outside your permission set are hidden entirely. After selecting a workspace context, only tools matching your role's permissions are available. See the [MCP Server Reference](/reference/mcp) for the tool list with permission requirements. ## Next steps [#next-steps] With that platform RBAC model in mind, continue with: * [Permissions](/reference/permissions) reference for role and permission catalogs * [Manage Access](/manage/access) to assign members and create platform keys * [Scopes](/concepts/platform/scopes) concept for the hierarchy * [Authorization Model](/concepts/architecture/authorization-model) concept for Cedar * [Authorize Access](/govern/rules) to write and deploy rules # Scope hierarchy (/concepts/platform/scopes)

{scope}

## The four levels [#the-four-levels] Every governed object sits in exactly one of these levels. They nest top-down from the company account to an individual agent: Scope hierarchy: Organization → Tenant → Workspace → Agent | Level | Purpose | Example | | ---------------- | -------------------------------------------------------- | --------------------- | | **Organization** | Administrative and ownership boundary containing tenants | `acme-corp` | | **Tenant** | Hard isolation boundary for data and resources | `commerce` | | **Workspace** | Operational scope for agents, rules, backends, and audit | `ml-platform-prod` | | **agent** | Individual AI agent identity in one workspace | `data-pipeline-agent` | Every rule bundle, agent record, backend, and audit event belongs to exactly one scope. There is no floating agent or rule bundle. A few rules hold everywhere in the tree: * Tenants are hard isolation boundaries. Agents and data in one tenant cannot reach another. * Workspaces separate day-to-day work inside a tenant (for example production vs staging). * A `forbid` at any scope overrides matching `permit`s below it. * Being a member of a workspace lets you administer it. It does not mean you own that workspace's resources. A typical scope hierarchy looks like this: 1. Acme Corp is the organization. 2. It holds a `Commerce` tenant and a `Support` tenant so those product lines never share agents, backends, or audit. 3. Inside `Commerce`, `ml-platform-prod` and `ml-platform-staging` are separate workspaces so a staging rule deploy cannot change production enforcement. 4. Each workspace holds its own agents. ### Organization [#organization] An **organization** is the company's top-level account. It covers billing, ownership, and the container for tenants. It answers who owns the Dome estate, not which agents may call which tools. Baselines that must apply everywhere in the company belong here or at tenant scope. Day-to-day agents, backends, and audit do not live at organization scope. If you try to run operations from the org layer, you lose the isolation and operational boundaries the levels below exist to provide. ### Tenant [#tenant] A **tenant** is a hard isolation boundary, usually drawn around a business unit or product line. For example, keep `commerce` separate from `cloud-services`. Agents in one tenant cannot access resources in another. Choose a tenant boundary when a leak across that line is unacceptable. If two units that must not share data sit in one tenant, application checks and database row-level security treat them as one world. Audit, agents, backends, and rule bundles mix. Splitting later means migrating identities and history, not flipping a flag. ### Workspace [#workspace] A **workspace** is the operational scope inside a tenant and the primary unit of day-to-day work. Agents, rules, escalations, backends, gateways, guards, quotas, and audit events live here. Use separate workspaces when blast radius should differ: production vs staging, or two teams that share a tenant but not backends and audit. If prod and staging share one workspace, they share rule deploys, reachable backends, and one audit trail. A staging experiment and a production deny investigation compete in the same record. Users can belong to multiple workspaces inside a tenant. Workspace membership controls who may administer that workspace. It does not move resource ownership across workspace lines. ### Agent [#agent] An **agent** is an individual AI identity inside exactly one workspace. Agent-scoped rule bundles tighten what that one agent may do. Agent scope is the wrong place for a company-wide security baseline. A `forbid` that exists only on today's agents does not apply to the agent you register tomorrow. Broad restrictions belong higher. Agent scope narrows further. ## Policy inheritance [#policy-inheritance] Deploy authorization bundles at any hierarchy level. At evaluation time, Dome pulls the active bundles that cover the request and merges them into one effective policy: Rule merge: org, tenant, workspace, and agent rules merge into an effective policy 1. Fetch the active bundle from each applicable scope. 2. Prefix Cedar filenames by scope to prevent collisions. 3. Merge the files and compute a composite content hash. 4. Load the effective policy into the evaluator. The gateway polls for content-hash changes. New policy normally reaches enforcement within one sync interval (default: 10 seconds) without restarting the gateway. The effective policy hash changes when any contributing bundle changes. The gateway detects and re-syncs automatically. ### Forbid wins [#forbid-wins] Cedar combines `permit` and `forbid` across every contributing scope: * A `forbid` at any scope overrides every matching `permit`. * Lower scopes can narrow access but cannot override a higher-scope `forbid`. * An org- or tenant-level `forbid` cannot be reopened by a workspace- or agent-level `permit`. * Agent-level rules can restrict access further but cannot expand access granted only by removing a higher-scope deny. Place broad security baselines high and specific allowances near the agent. If the baseline lives only at agent scope, every new agent starts without it until someone copies the forbid. If a wide `permit` lives at organization scope with no matching `forbid`, every workspace inherits that width. ## Isolation boundaries [#isolation-boundaries] Tenants separate data at the application and database layers. Row-level security rejects missing or incorrect tenant context by returning no rows silently, rather than raising an error, so a wrong or missing tenant scope fails closed as empty results. Cross-tenant access requires an explicit system bypass, used only when no tenant identity can be set on the connection (for example, the scheduled-job runner that processes jobs across all tenants). Workspaces separate teams, environments, agents, rules, backends, and audit inside a tenant. The same RLS model applies: wrong or missing workspace scope returns zero rows. Cross-workspace access uses the same explicit system bypass only when no workspace identity can be set on the connection. Assign users to multiple workspaces without weakening tenant isolation. RLS is the backstop. Even misconfigured application code cannot leak data across scopes when the database context is set correctly. ## Roles and scopes [#roles-and-scopes] Assign platform RBAC roles at organization, tenant, or workspace scope. Higher-scope roles cascade permissions into lower scopes. That layer decides which people and API clients may administer the platform. Agent authorization rules use the same hierarchy but govern runtime requests: what a registered agent may do to a tool or model. Confusing the two layers produces the wrong fix. Granting a user `operator` does not authorize an agent to call a tool. A Cedar `permit` does not grant that user platform administration. Refer to [Permissions](/concepts/platform/permissions) concept before assigning roles or writing Cedar. ## Next steps [#next-steps] With that scope hierarchy in mind, continue with: * [Permissions](/concepts/platform/permissions) concept for platform RBAC versus runtime agent authorization * [Import and export configuration](/manage/import-export) to move reviewed configuration between compatible scopes * [Architecture](/concepts/architecture) concept for where scopes sit among components, controls, and audit * [rules](/govern/rules) to author and deploy Cedar bundles at each scope * [Authorization Model](/concepts/architecture/authorization-model) concept for permit, forbid, and effective policy assembly # Resources (/concepts/resources)

{resource}

## High-level overview [#high-level-overview] A resource is a workspace record for something callable. Dome stores how to reach it, how to authenticate outbound, and how it participates in gateways and rules. The agent never holds the upstream credential. Membership on a [Gateway](/concepts/gateways) makes the resource addressable. [Rules](/concepts/controls/rules) decide whether a specific call is allowed. Dome supports three resource types: | Type | What it represents | Typical call path | | -------------------- | ------------------------------------------------------------ | -------------------------------------------------- | | **tool** | An MCP server (or related tool backend) | gateway `/gateways//mcp` | | **model connection** | One LLM provider endpoint and credential | gateway `/gateways//v1/...` by connection name | | **model pool** | A named group of model connections with routing and failover | gateway `/gateways//v1/...` by pool name | Attaching resources and calling them looks like this: 1. An operator adds a Notion MCP tool and an Anthropic model connection, puts both on a gateway, and grants an agent access. 2. The agent discovers tools over MCP and names a model or pool on chat requests. 3. Dome authenticates the agent, checks gateway membership and rules, injects credentials on egress, and audits the outcome against that resource. Resources are the callable side of Connect. Gateways package which ones an agent can reach. ### Reachability vs authorization [#reachability-vs-authorization] A resource can exist without being callable. Until it is a member of a gateway an agent may use, it stays **Unreachable**. Membership and access grants package reachability. Rules, guards, and quotas still decide what happens after the call is admitted. Refer to [Gateways](/concepts/gateways) concept. ### Tools vs models [#tools-vs-models] Tools act on the world through MCP (and related protocols). Models produce completions through the LLM ingress. Both are resources, but they use different gateway path suffixes, credential shapes, and guard kinds. Pools apply only to model traffic. ### Direct models vs pools [#direct-models-vs-pools] Agents can name a model connection directly or name a pool. Prefer a pool when the client should stay stable while you swap providers, weight traffic, or fail over. Prefer a direct connection when one endpoint should always serve that name. Details are on the [Models](/concepts/resources/models) concept and [Pools](/concepts/resources/model-pools) concept. ## Next steps [#next-steps] With that resources model in mind, continue with: * [Architecture](/concepts/architecture#resources) concept for where resources sit among components * [Tools](/concepts/resources/tools) concept for MCP connections, credentials, and catalogs * [Models](/concepts/resources/models) concept for provider connections and attributes * [Pools](/concepts/resources/model-pools) concept for routing, failover, and resolution * [Gateways](/concepts/gateways) concept for membership and reachability * [Tools](/connect/tools), [Models](/connect/models), and [Pools](/connect/pools) to configure them # Pools (/concepts/resources/model-pools)

{modelPool}

## High-level overview [#high-level-overview] A pool contains one or more model connections as **members**. When an agent puts the pool name in the request's `model` field, Dome orders eligible members by the routing strategy, sends the request to the primary, and may try further members on failure up to the failover limit. For an agent to use a pool: 1. Connect the models that can serve the traffic. 2. Create the pool and add members. 3. Configure routing and failover. 4. Attach the pool to a [Gateway](/concepts/gateways). 5. Allow that gateway on the agent. 6. Verify with the agent's key. Routing through a pool looks like this: 1. An operator creates `production` with priority-weighted routing, adds `claude-prod` at priority 0 and `gpt-backup` at priority 1, attaches the pool to `prod-llms`, and grants an agent access. 2. The agent calls with `model: "production"`. 3. Dome resolves the pool, authorizes the primary, and dispatches. 4. On a transient provider failure, Dome may authorize and try the backup. 5. Audit records which member served the call. A pool is the stable name clients and rules use. Members and strategy stay editable underneath. ### Members [#members] Each member is one model connection. With priority-weighted routing, priority places the member in a failover tier and weight shares traffic inside the tier. Round-robin, least-loaded, and most-quota-remaining ignore priority and weight. A model can belong to more than one pool. Removing a member leaves the connection available elsewhere. > **Warning**: The management interfaces store an `enabled` value, but the current gateway routes to members regardless of that value. To stop sending traffic to a member, remove it from the pool. ### Routing strategies [#routing-strategies] The strategy chooses the primary and orders failover candidates: `priority_weighted`, `round_robin`, `least_loaded`, or `most_quota_remaining`. Strategy scope (`workspace` or `caller`) controls whether stateful strategies share rotation or inflight state. For `most_quota_remaining`, scope only affects the tiebreak — primary order follows remaining cost-quota headroom. Catalog is on the [Pools](/reference/resources/model-pools#routing-strategies) reference. ### Failover [#failover] Failover limits how many additional members Dome may try after the primary fails. Dome authorizes the primary first, then re-authorizes each candidate before trying it. Streaming can fail over only before the first response byte reaches the caller. Limits and behavior are on the [Pools](/reference/resources/model-pools#failover) reference. ### Pool resolution [#pool-resolution] When a request reaches a gateway, Dome resolves the `model` value in a fixed order: exact pool name, exact connection name, upstream model id match, first matching `match_when` pool, then the workspace default pool. Exact names beat conditional routes. The `match_when` dialect is on the [Pools](/reference/resources/model-pools#pool-resolution) reference. Routing does not replace authorization. Rules still evaluate the pool and selected model. ### Response caching [#response-caching] Pool records store cache TTL and scope fields intended for identical-request reuse. > **Warning**: The gateway does not read these settings during model dispatch. Setting `cache_ttl_secs` or `cache_scope` does not cache responses. ## Next steps [#next-steps] With that model-pool routing model in mind, continue with: * [Resources](/concepts/resources) concept for how pools sit among resource types * [Models](/concepts/resources/models) concept for the connections pools select * [LLM gateway](/concepts/gateways/llm-gateway) concept for dispatch and failover on the wire * [Quotas](/concepts/controls/quotas) concept for spend caps and pool spillover * [Pools](/reference/resources/model-pools) reference for strategies, failover, and `match_when` * [Pools](/connect/pools) to create pools, manage members, and attach gateways # Models (/concepts/resources/models)

{modelConnection}

## High-level overview [#high-level-overview] A model connection represents one upstream model. The connection stores provider, model identifier, credentials, trusted attributes, and an optional filter window. An agent selects it by putting the connection name in the request's `model` field, or by naming a pool that includes it. For an agent to use a model: 1. Choose a provider and model identifier. 2. Add the model with its upstream credentials. 3. Attach it directly to a gateway, or add it to a [pool](/concepts/resources/model-pools) attached to one. 4. Allow that gateway on the agent. 5. Verify the route with the agent's key. Adding a model and calling it looks like this: 1. An operator adds `claude-prod` for Anthropic with a shared API key, attaches it to `prod-llms`, and grants an agent access. 2. The agent calls `/gateways//v1/chat/completions` with `model: "claude-prod"`. 3. Dome admits the gateway, resolves the connection, evaluates rules, injects the Anthropic key, filters the stream, and audits the call. The agent never sees the provider key. A model connection is one provider endpoint. Prefer a [pool](/concepts/resources/model-pools) when the client name should stay stable across failover or traffic shifts. ### Providers [#providers] The provider determines how Dome translates requests and where it places the upstream credential. You cannot change the provider after create. Native providers, hosted OpenAI-compatible providers, and bring-your-own endpoints (`openai_compatible`, `custom`) are listed on the [Models](/reference/resources/models#providers) reference. ### Credentials [#credentials] Agent API keys authenticate inbound requests to Dome. Model credentials authenticate Dome's outbound requests to the provider. Authentication method and credential type must form a valid pair. Per-user credentials select the provider credential from the verified act-as identity and may return a `provision_url` when the user has not connected yet. Pairings and workload-identity notes are on the [Models](/reference/resources/models#credentials) reference. ### Attributes [#attributes] Attributes are trusted metadata on the connection for [Rules](/concepts/controls/rules) concept to evaluate, such as `region=eu` or `data_class=restricted`. They do not change how Dome calls the provider. Derived fields such as `resolved_model` and `pool` are set server-side and cannot be spoofed through attributes. Refer to [LLM gateway](/concepts/gateways/llm-gateway#authorization) concept. ### Filter window [#filter-window] A model can raise how much streamed output Dome buffers before applying outbound guards. The effective window is the max of workspace floor, connection override, and per-request override. A model can increase coverage but cannot reduce the workspace minimum. Bounds are on the [Models](/reference/resources/models#filter-window) reference and [Guards](/reference/controls/guards#streaming-window) reference. ### Model rates and estimated provider cost [#model-rates-and-estimated-provider-cost] Dome estimates the upstream provider cost of model traffic from token counts and a time-windowed rate book. The default book combines Dome's baseline rates with current published provider data. An organization can layer its own negotiated provider rates over that book. These figures estimate what the provider charges the organization; they are separate from what Dome bills for governed usage. Each rate has an effective window. Historical usage is priced using the rate in effect during that usage, so a rate change today does not rewrite an earlier period. If a provider reports no token counts, Dome estimates tokens from observed request and response bytes before applying the rate, making that cost estimate less precise. Use [`dome models rates`](/cli/connect/models#model-rates) to inspect the default book and conversion assumptions. `dome models rates --effective` resolves the organization's own rates over the default book. ### When configuration changes take effect [#when-configuration-changes-take-effect] Model connections, pool membership, and the rate card used for live quota enforcement reach hosted gateways through periodic configuration sync. A change normally appears on the next successful poll. If one workspace cannot be refreshed, gateways keep that workspace's last applied configuration and retry without blocking updates for other workspaces. A newly assigned workspace waits for its first successful configuration rather than being admitted with a partial configuration. ### Direct attach vs pool [#direct-attach-vs-pool] Attach a model directly when that name should always route to one connection. Add it to a pool when you need weighted distribution, failover, or a stable alias while you change members. A model can belong to more than one pool and more than one gateway. ## Next steps [#next-steps] With the model connection model in mind, continue with: * [Resources](/concepts/resources) concept for how models sit among resource types * [Pools](/concepts/resources/model-pools) concept for routing and failover * [LLM gateway](/concepts/gateways/llm-gateway) concept for the model ingress under a gateway * [Gateways](/concepts/gateways) concept for membership and reachability * [Guards](/concepts/controls/guards) concept for text filters on prompts and completions * [Models](/reference/resources/models) reference for providers, credentials, and filter windows * [Models](/connect/models) to add models, rotate credentials, and attach gateways # Tools (/concepts/resources/tools)

{tool}

## High-level overview [#high-level-overview] When you add a tool, Dome stores its endpoint, protocol, credentials, and egress headers. After it connects, every operation the server exposes appears in that tool's **discovered catalog**. You can block or deprecate one operation without removing the whole tool. For an agent to use a tool: 1. Add the tool for the upstream MCP server. 2. Configure upstream authentication when the server requires it. 3. Attach the tool to a [Gateway](/concepts/gateways). 4. Allow that gateway on the agent. 5. Confirm discovery with the agent's key. Adding a tool and calling it looks like this: 1. An operator adds a Streamable HTTP tool for Notion, sets shared API-key auth, attaches it to `prod-tools`, and grants an agent access. 2. The agent lists tools at `/gateways//mcp`. 3. Each `tools/call` runs admission, rules, request guards, egress with injected credentials, response guards, and audit. The agent never sees the Notion credential. A tool is a callable MCP connection. Gateway membership makes it reachable. Rules still decide each call. ### Upstream authentication [#upstream-authentication] Agent API keys authenticate inbound requests to Dome. They never pass through as upstream credentials. Dome stores upstream secrets and injects them only on the outbound call. Two settings control which credential the gateway sends: the **authentication method** (how the upstream verifies the request) and the **credential type** (whose credential is sent: shared or per-user). The pairings are fixed. Catalog of methods, types, and defaults is on the [Tools](/reference/resources/tools#upstream-authentication) reference. With per-user credentials, each request must carry a verified act-as identity. When the end user has no credential yet, Dome returns `401` with a short-lived `provision_url`. Refer to [Errors and denials](/develop#errors-and-denials). ### Egress headers [#egress-headers] Egress headers are values the gateway adds on the outbound request. A header can be a literal, a stored secret, or the act-as identity the workspace admitted. Only Streamable HTTP tools can carry them. An act-as header is the forwarding opt-in (`--header-actas` on the connection). Strength is the workspace Act-As floor — `none` is valid when that floor allows it — and egress does not re-rank the method. The call fails closed when there is no raw assertion to forward, including device-bound and interactive session identity. An act-as header is incompatible with OAuth auth on the same tool. Details are on the [Tools](/reference/resources/tools#egress-headers) reference. ### Discovered tools [#discovered-tools] After the gateway connects, every operation the server exposes appears in the tool's catalog. Status (`active`, `deprecated`, `blocked`) lets you change one operation without removing the tool. Blocking denies the operation even when a rule would permit it. Status behavior is on the [Tools](/reference/resources/tools#discovered-tools) reference. ### Protocols [#protocols] Dome supports Streamable HTTP for remote MCP servers and stdio for local processes. OAuth and egress headers require Streamable HTTP. Protocol notes are on the [Tools](/reference/resources/tools#protocols) reference and the [Tools gateway](/concepts/gateways/tools-gateway#egress-protocols) concept. ## Next steps [#next-steps] With the tool connection model in mind, continue with: * [Resources](/concepts/resources) concept for how tools sit among resource types * [Tools gateway](/concepts/gateways/tools-gateway) concept for the MCP ingress under a gateway * [Gateways](/concepts/gateways) concept for membership and reachability * [Guards](/concepts/controls/guards) concept for JSON filters on tool arguments and results * [Tools](/reference/resources/tools) reference for auth, headers, catalog status, and protocols * [Tools](/connect/tools) to add tools, manage catalogs, and attach gateways # Dome templates (/develop/templates) Dome templates are immutable, versioned agent applications. A template defines an agent topology, including its gateways, tools, models, rules, guards, and quotas, so you can evaluate a complete governed application instead of assembling its parts from scratch. ## Find a template [#find-a-template] Start in the [Templates Library](https://docs.domesystems.ai/templates), which contains official Dome templates and community-published templates. Each template page explains what it provides, shows its agent topology, and gives you the exact immutable release to use. For example, [AI Documentation agent](https://docs.domesystems.ai/templates/dome-systems/ai-agent-for-documentation) is a chat agent with a read-only documentation gateway, a model pool, rules, and a daily spend limit. Use its **Topology** view to inspect those boundaries before you deploy it. ### Try a template in Studio [#try-a-template-in-studio] Studio is the recommended way to first evaluate any template. It deploys the selected immutable release into your Dome workspace, or creates a new workspace when you do not have one. It then opens the template's included experience without requiring your local machine to run an agent. For an example, [read the AI Documentation agent Studio instructions](https://docs.domesystems.ai/templates/dome-systems/ai-agent-for-documentation#usage), then [try it in Studio](https://studio.domesystems.ai/patterns/chat?templates=dome-systems%2Fai-agent-for-documentation\&managed=true\&version=0.1.2). ## What you can do [#what-you-can-do] Templates support both consuming a reviewed release and publishing one for others to use: * [Deploy agent with template](/develop/templates/run) — sign in, inspect and pull an immutable release, generate Terraform, then provision it with the Templates CLI. * [Publish template](/develop/templates/publish) — author a template release, manage namespace publishers, and deprecate a bad version. ## Install and prerequisites [#install-and-prerequisites] Use `npx @domesystems/templates` with Node.js 20 or later. `auth`, `view`, `pull`, and `generate` do not require the Dome CLI. Install the [Dome CLI](/install) before using `templates up`. Install Docker Compose only when you use `templates up` to start an external agent runtime locally. ```bash title="Confirm the Templates CLI is available" npx @domesystems/templates --help ``` ## Reference [#reference] Use these guides when you need the exact commands or want to browse available releases: * [Deploy agent with template](/develop/templates/run#command-reference) for the consumer CLI command reference * [Publish template](/develop/templates/publish#command-reference) for publisher and lifecycle commands * [Dome CLI reference](/cli) for the CLI used by `templates up` * [Templates Library](https://docs.domesystems.ai/templates) to browse official and community templates # Publish template (/develop/templates/publish) The Templates Registry distributes immutable, source-only Dome agent templates. Use this page to publish a release, manage who can publish in a namespace, and deprecate a bad version. To consume a published release, see [Deploy agent with template](/develop/templates/run). The examples use `npx`, so a global Templates CLI installation is not required. Publishing requires Node.js 20 or later, a clean Git checkout, GitHub authorization for the source repository, and Registry publisher access. ## Publish a template [#publish-a-template] Publish from the directory containing `dome.yaml`. A release is immutable: increase `metadata.version` before publishing a correction. ```bash title="Validate first" npx @domesystems/templates publish --dry-run # Publish the next SemVer version after validation succeeds. npx @domesystems/templates publish ``` The Registry publishes source only: `dome.yaml` and referenced assets such as prompts, rules, and guards. It rejects generated Terraform, Compose files, locks, and credentials. The CLI requires a clean Git checkout and GitHub authorization for the source repository. At minimum, `dome.yaml` must have a valid API version and kind, a scoped package name, SemVer version, title, GitHub HTTPS source repository and relative source path, and one or more uniquely named managed or external agents. ```yaml title="dome.yaml" apiVersion: templates.domesystems.ai/v1 kind: Template metadata: name: acme/incident-triage version: "1.0.0" title: Triage production incidents summary: Route and summarize incoming incidents. source: repository: https://github.com/acme/agent-templates path: incident-triage models: - name: incident-model provider_id: anthropic provider_config: { model: claude-sonnet-5 } auth_method: api-key credential_type: shared secret_values: { Authorization: var.anthropic_api_key } agents: - name: incident-triage type: managed gateway: incident-tools default_model: triage-pool system_prompt: path: agents/incident-triage/instructions.md ``` For a GitHub organization package, the package scope must equal the repository owner. The signed-in GitHub account must be a repository administrator and the Dome Templates Registry GitHub App must have access to that repository. ## Manage publisher access [#manage-publisher-access] Use `auth status` to see roles. Namespace owners and publishers can deprecate releases; namespace owners manage membership. ```bash title="Invite a publisher" npx @domesystems/templates access invite acme \ teammate@acme.com --role publisher # The invited person signs in, then accepts the one-time code. npx @domesystems/templates access accept # Inspect or change access. npx @domesystems/templates access list acme npx @domesystems/templates access role acme teammate@acme.com --role owner --yes npx @domesystems/templates access remove acme teammate@acme.com --yes ``` ## Deprecate a bad release [#deprecate-a-bad-release] Do not unpublish immutable releases. Deprecate an exact version with a reason so new consumers resolve to the newest non-deprecated version, while existing pinned deployments remain recoverable. ```bash npx @domesystems/templates deprecate \ acme/incident-triage@1.2.1 \ "Incorrect quota policy" \ --yes ``` To remove the warning after a review: ```bash npx @domesystems/templates deprecate \ acme/incident-triage@1.2.1 \ --clear --yes ``` The Library marks deprecated versions and shows the reason on direct version pages. `templates view versions` shows the same lifecycle status in the terminal. ## Command reference [#command-reference] Use `npx @domesystems/templates --help` for the exact options for one command. | Command | Purpose | | --------------------------------------------------- | ------------------------------------------------------- | | `auth login`, `auth status`, `auth logout` | Manage a Registry sign-in and inspect publisher access. | | `access list`, `invite`, `accept`, `role`, `remove` | Manage namespace publisher membership. | | `doctor publish` | Check publishing prerequisites. | | `publish [--dry-run]` | Validate or publish an immutable source release. | | `deprecate --yes` | Mark an exact release as deprecated. | # Deploy agent with template (/develop/templates/run) Deploy a governed agent from a published Templates Registry release. The Templates CLI lets you inspect an immutable release, generate local Terraform, provision Dome, and—when applicable—run its external agent runtime. To create or maintain a release, see [Publish template](/develop/templates/publish). ## Before you begin [#before-you-begin] The examples use `npx`, so a global Templates CLI installation is not required. `auth`, `view`, `pull`, and `generate` need Node.js 20 or later and network access. Install the [Dome CLI](/install) before using `up`; install Docker with the Compose plugin only when `up` will start an external agent runtime. ```bash title="Confirm the CLI is available" npx @domesystems/templates --help ``` Remote commands use the production Registry by default. Use `--server ` to discover the Registry from a Dome application, or `--registry ` to connect directly. Use one, not both. ## Deploy agent with template [#deploy-agent-with-template] ### Sign in [#sign-in] Sign in once per Registry environment. The selected endpoint becomes the default for later remote commands, and credentials remain isolated by endpoint. ```bash title="Sign in to production" npx @domesystems/templates auth login \ --registry https://templates-registry.domesystems.ai \ --github ``` Use `auth status` to check the selected Registry, identity, GitHub link, and any publisher roles: ```bash npx @domesystems/templates auth status ``` For a non-production environment, explicitly select its Registry when signing in. For example: ```bash npx @domesystems/templates auth login \ --registry https://templates-registry-dev.domesystems.ai ``` ### Inspect and pull a release [#inspect-and-pull-a-release] Inspect a template before you download it. Without a version, `view` resolves the Registry's default: the newest non-deprecated release. ```bash title="Inspect the default release" npx @domesystems/templates view dome-systems/ai-agent-for-documentation # Inspect one immutable release or see the version history. npx @domesystems/templates view dome-systems/ai-agent-for-documentation@0.1.2 npx @domesystems/templates view dome-systems/ai-agent-for-documentation versions ``` Pull a release into an empty directory: ```bash title="Pull a template" npx @domesystems/templates pull dome-systems/ai-agent-for-documentation \ --dir ./ai-agent-for-documentation cd ai-agent-for-documentation ``` The CLI verifies the downloaded SHA-256, extracts only the expected `template/` root, writes `.dome-template-lock.yaml`, and copies `.env.example` to `.env` when present. An exact deprecated version remains pullable with a warning; pin versions when you need a reproducible deployment. ### Review, configure, and generate Terraform [#review-configure-and-generate-terraform] Start with interactive generation: ```bash title="Preview the topology and generate Terraform" npx @domesystems/templates generate ``` The CLI first renders a colored topology showing agents, gateways, tools, models, pools, rules, guards, quotas, and triggers. Select **Generate** to keep the template defaults, or **Configure** to choose a deployment configuration. When configuring, the CLI asks in this order: 1. **Runtime for each agent:** choose **Managed** when Dome runs the agent, or **External** when you run its runtime yourself. 2. **Triggers:** choose schedule, webhook, or disabled for each trigger that targets a managed agent. 3. **Model for each model role:** choose a provider, model, and credential type. Managed and external are the two agent types. Delegation is separate: either type can use an Act-As envelope when access must depend on the person represented by the agent. Native Dome triggers invoke managed agents only. If you select an external runtime, the CLI disables its native triggers instead of asking for a trigger that cannot apply. HMAC Act-As delegation is the exception: it requires the runtime to sign each request, so it is supported only by external agents. The CLI rejects `act_as.method: hmac` or `act_as.hmac_secret` on a managed agent before it generates Terraform. Use `--verbose` to expand the tools within each connection and models within each pool: ```bash npx @domesystems/templates generate --verbose ``` The generated `dome.tf` is local output, not template source. Review it before provisioning. The command will not replace an existing output unless you explicitly pass `--force`. ```bash npx @domesystems/templates generate --output generated.dome.tf npx @domesystems/templates generate --force ``` ### Configure models safely [#configure-models-safely] Templates give models role-based names—such as `documentation-model`—rather than tying names to one provider. The picker supports the Dashboard provider catalog, including OpenAI, Anthropic, Google, Azure OpenAI, Bedrock, Mistral, Groq, Together AI, Fireworks AI, DeepSeek, Moonshot, xAI, Perplexity, Cohere, OpenRouter, Cerebras, NVIDIA NIM, DeepInfra, SambaNova, AI21, Databricks, vLLM, Ollama, OpenAI-compatible endpoints, and custom passthrough models. When a model uses a shared credential, the CLI adds the provider's sensitive variable and correct credential wiring to generated Terraform. Choose **per-user** only when callers provide credentials through a verified Act-As identity. Providers such as Azure OpenAI, Bedrock, self-hosted, and custom endpoints may ask for provider-specific configuration. For automation, put the selections in a YAML values file: ```yaml title="deployment-values.yaml" models: documentation-model: provider: anthropic model: claude-haiku-4-5-20251001 credential_type: shared runtime: docs-answerer: external variables: anthropic_api_key: sk-ant-… ``` Then generate non-interactively: ```bash npx @domesystems/templates generate --values deployment-values.yaml ``` `variables` values are written to a local `terraform.tfvars` file with owner-only permissions. Keep the values file and generated `terraform.tfvars` out of source control. Runtime, trigger, and model choices affect only this Terraform generation by default. To deliberately persist those choices back to the source template, review the printed diff and use both safeguards: ```bash npx @domesystems/templates generate \ --values deployment-values.yaml \ --write-config --yes ``` `--write-config` makes a targeted `dome.yaml` update and preserves unrelated comments and ordering. Do not use it merely to provision a one-off environment. ### Provision and run a template (Preview) [#provision-and-run-a-template-preview] `up` is a Preview command. It reads the generated `dome.tf`; it does not ask for arbitrary template variables, so provide them with `generate --values` beforehand. When a template declares `metadata.guide`, `up` prints its `GUIDE.md` before provisioning or starting anything. Then provision: ```bash title="Provision Dome and start an external runtime" npx @domesystems/templates up ``` `up` imports `dome.tf`. For an external runtime, it obtains the one-time runtime token and gateway URL from the import, writes only `DOME_TOKEN` and `DOME_GATEWAY_URL` to the ignored local `.env`, generates `.dome-compose.yaml`, and starts the runtime with Docker Compose. Use `--skip-provision --no-start` to review only the setup guide, `--no-start` to provision without starting it, `--detach` to run in the background, and `--debug` for safe endpoint/status/timing diagnostics. For a first deployment, Studio is the recommended way to evaluate a template: it deploys the selected immutable release into your Dome workspace, or creates one when you do not have one, then opens the included experience. [Follow the AI Documentation agent Studio instructions](https://docs.domesystems.ai/templates/dome-systems/ai-agent-for-documentation#usage) for an example, then [try it in Studio](https://studio.domesystems.ai/patterns/chat?templates=dome-systems%2Fai-agent-for-documentation\&managed=true\&version=0.1.2). Use `templates up` when you need to provision from your local checkout or start an external runtime yourself. Managed agents are provisioned in Dome; they have no local container to start. If a template has more than one external agent, select the one to run: ```bash npx @domesystems/templates up --agent docs-answerer ``` If an import has pending runtime outputs, recover them without reprovisioning: ```bash npx @domesystems/templates up --import-job ``` ### Troubleshoot before an operation [#troubleshoot-before-an-operation] Run the targeted preflight when a machine is new or an operation fails: ```bash npx @domesystems/templates doctor pull npx @domesystems/templates doctor up --dir ./ai-agent-for-documentation ``` `doctor up` checks `dome.yaml`, Docker Compose, and the Dome CLI. Add `--json` for automation. ## Command reference [#command-reference] Use `npx @domesystems/templates --help` for the exact options for one command. | Command | Purpose | | | ------------------------------------------ | -------------------------------------------------------------------------------------- | --------------------------------------- | | `auth login`, `auth status`, `auth logout` | Manage a Registry sign-in and inspect publisher access. | | | `view [versions]` | Inspect a release or its version history. | | | `pull ` | Download and verify an immutable source release. | | | `generate` | Review topology, optionally configure it, and write local Terraform. | | | `up` | **Preview:** provision a local template and start an external runtime when applicable. | | | \`doctor \[pull | up]\` | Check operation-specific prerequisites. | # Rules assistant (/govern/rules/assistant) The rules assistant drafts and refines Dome authorization rules from natural language in the dashboard rules editor. Dome validates each draft and routes assistant calls through the model broker like any other agent. ## Overview [#overview] The assistant runs as a Dome agent in the workspace. 1. Enable the assistant on the workspace. Dome registers a `cedar-assistant` agent and provisions its key. 2. Open the rules editor. The chat thread lives in the right rail and shares context with the editor, including open files, agents, tools, and models. 3. Send a prompt. Dome calls the model through the Dome model broker, validates each draft, and surfaces it as a draft you can apply. 4. Apply or discard. Applied drafts land in the editor with changed lines highlighted. Deploy through the normal [Apply Rules](/govern/rules#apply-rules) flow. Drafts are never deployed automatically. The assistant proposes. You apply and deploy. ### Editor scope [#editor-scope] The assistant grounds every draft to the bundle you have open. | Editor scope | What the assistant proposes | | ------------ | -------------------------------------------------------------------------------------------------------------------------------- | | Workspace | rules in the workspace bundle. Tightening a single agent's access surfaces a suggestion to move the rule to that agent's bundle. | | agent | rules in that agent's bundle only. The model refuses to author cross-agent rules from this scope. | Switch scope by opening the agent's rules tab in the editor. The chat picks up the new scope on the next message. ### Limits [#limits] The assistant enforces these limits. * **Per-workspace rate limit** on chat messages and draft requests. Bursts beyond the limit surface as a `rate_limited` error in the chat. * **No tool-call replay across turns.** The assistant sees current workspace state (open files, agents, tools, models) on every turn but not its own prior tool calls. * **Limited chat markdown.** Bold, inline code, and `cedar`-fenced code blocks render in chat. ## Requirements [#requirements] Before you begin, authenticate to Dome and select a workspace. ### Permissions [#permissions] Assistant settings, chat, and draft apply use platform permissions. The same permissions apply across the dashboard, CLI, and MCP. Each operation restates its permission inline. | Default roles | Permission | Grants | | ------------------------------- | --------------- | -------------------------------------------------- | | `admin`, `operator` | `config.manage` | Enable, disable, purge, or edit assistant settings | | `admin`, `operator`, `security` | `rules.deploy` | Chat and apply drafts | | All workspace roles | `rules.view` | View threads and messages or read settings | ## Enable the assistant [#enable-the-assistant] Enable the rules assistant from the rules editor right rail. On an un-provisioned workspace, the rail shows an empty state with a single **Enable** button. Enabling provisions the `cedar-assistant` agent and key. The assistant then becomes available in the rules editor for every user with `rules.deploy`. Members without `config.manage` never see the Enable CTA — the rail opens straight to chat if the assistant is already provisioned. > **Note**: Requires `config.manage`. ## Disable the assistant [#disable-the-assistant] Disable the assistant from the inline settings view in the rules editor rail when you want to suspend the integration without deleting state. Open the thread dropdown and choose **Settings** (or use the empty-state affordance when disabled), then disable. Use **Back to chat** to return to the thread. Re-enable from the same view to resume with the same threads and history. Members without `config.manage` never see the Settings dropdown item. > **Note**: Requires `config.manage`. ## Purge the assistant [#purge-the-assistant] Purge the assistant from the Danger zone of the inline settings view when you need to remove it completely. Purge deletes the agent, key, threads, and messages for this workspace. Use purge before re-onboarding a workspace from scratch. > **Note**: Requires `config.manage`. > **Warning**: Purge is destructive. It deletes the agent, key, threads, and messages for this workspace. ## Configure context [#configure-context] Configure which workspace context each message ships to the model from the same inline settings view. Toggle individual categories off to keep that data out of every prompt. > **Note**: Requires `config.manage`. | Toggle | Sends to the model | | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | Editor file contents | The rule files currently open in the editor. | | agents catalog | agent names and IDs. | | tools catalog | MCP tool names and IDs. | | models catalog | LLM connection names and IDs. | | Schema attribute keys | The custom attribute keys your workspace contributes to authorization entities. | | rule deployment history | Recent rule-bundle deployments for the workspace and the agent the editor is open on, so the assistant can reason about what changed and roll-back history. | ## Govern assistant traffic [#govern-assistant-traffic] Govern the assistant the way you govern any other agent. Every request carries the metadata key `cedar_asst=true`, so workspace-scope rules can target it without enumerating per-workspace agent IDs. ```cedar title="restrict-rules-assistant.cedar" // Limit the assistant to a single approved model forbid( principal, action == Dome::Action::"llm:invoke", resource is Dome::LLMModel ) when { principal.metadata.cedar_asst == "true" } unless { resource.name == "anthropic-claude-sonnet" }; ``` The same pattern applies to model lists, embeddings, and any other action. Every call the assistant makes is a normal gateway request you can shape with rules. ## Chat behavior [#chat-behavior] The chat surfaces draft work and diagnostics while you work. * **Streaming responses.** Text streams token-by-token. If no tokens arrive for 60 seconds, the chat surfaces a "Stream stalled" error. * **Tool chips.** Each rule validation and draft proposal appears as a chip with a spinner while it runs. Click a chip to inspect inputs and results. * **Stop.** Cancels the in-flight response and clears any running chips. * **Validation diagnostics.** Failures auto-expand with `file:line` and a message. After three consecutive validation failures the assistant pauses and asks for a draft instead. Empty messages return a prompt to type something first. * **Drafts.** Render inline in the chat. Apply moves the files into the editor with changed lines highlighted. The highlight clears on a successful deploy. * **Thread titles.** The assistant sets a title on the first turn. ## Assistant tools [#assistant-tools] The assistant calls workspace tools through the model broker. Treat their results as ground truth — the model does not invent decisions before a tool returns. | tool | Role | | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | `validate` | Validates draft Cedar against the engine. Surfaces `file:line` diagnostics. | | `simulate` | Dry-runs one authorization decision against deployed or draft rules. Returns ALLOW or DENY, the deciding rule id, and a per-scope trace. Read-only. | | `propose_draft` | Surfaces a draft you can apply to the editor. Never deploys. | | `get_bundle_version` | Reads the active or historical bundle metadata for the current editor scope. | `simulate` answers "can this agent do that?" with a real engine decision. The customer tenant is resolved from the authenticated workspace at message time — the model cannot override it. Permission is enforced at the SSE boundary against the same `rules.deploy` scope as chat. ## Next steps [#next-steps] * [Write and apply Rules](/govern/rules#write-rules) through the normal rule lifecycle * [Simulate Rules](/govern/rules/simulate) before changing production behavior * [Authorization model](/concepts/architecture/authorization-model) concept for entity attributes a draft may reference # Rules (/govern/rules) Rules decide which tool and model requests each agent is allowed to make. Dome evaluates them on every governed request, so you can grant, restrict, or deny access down to the specific action and condition. ## Overview [#overview] Rules ship as scoped **bundles** of `.cedar` files. The gateway merges every active bundle that covers the agent and evaluates the request against that set. The typical workflow is: 1. [Write rules](#write-rules) manually or with the [Rules assistant](/govern/rules/assistant). 2. [Validate the rules](#validate-rules) for Cedar errors and advisory warnings. 3. [Simulate representative decisions](#simulate-rules) before changing production behavior. 4. [Apply the rules](#apply-rules) to activate the change. 5. [Inspect the rules that apply to an agent](#show-effective-rules) and [roll back](#roll-back-rules) if the result is not expected. ## Requirements [#requirements] Before you begin: * Authenticate to Dome and select a workspace * Register at least one [external agent](/build/agents/external) * Identify the tools or models the rules will govern * Choose the workspace or agent scope where the rules should apply ### Permissions [#permissions] Rule bundle operations require platform permissions. Each operation states its required permission inline. | Default roles | Permission | Grants | | ------------------------------- | ---------------- | ------------------------ | | All workspace roles | `rules.view` | View bundles and history | | `admin`, `operator`, `security` | `rules.deploy` | Deploy rules | | `admin`, `operator`, `security` | `rules.rollback` | Roll back a rule bundle | ## Write Rules [#write-rules] Write each authorization requirement as a sentence before translating it to Cedar. For example, “Allow this agent to call the `github/list_issues` tool.” You can also use the [Rules assistant](/govern/rules/assistant) to translate natural-language requirements into a draft. Assistant drafts never deploy automatically. > **Note**: Writing local files requires no Dome permission. Using the rules assistant to draft or apply changes requires `rules.deploy`. Map the sentence to a rule in five steps. 1. Choose `permit` for an allowed request or `forbid` for a denied request. 2. Set the principal to the agent's UUID or use a broader form when the rule should cover every agent in scope. 3. Choose the action that represents the operation. 4. Set the resource to the specific tool or model, or use a resource type when the rule should cover every resource of that type. 5. Add a `when` condition if the rule should apply only under certain circumstances or add `unless` to define an exception. Inside the parentheses, name `principal`, `action`, and `resource`. Omit a constraint to match every value. Use `==` for one entity, `is` for every entity of a type, and `in` for several actions. Common actions are `mcp:call`, `mcp:discover`, and LLM actions such as `llm:invoke`, `llm:embed`, and `llm:moderate`. Connection attributes appear as `resource.`. Per-call values appear as `resource.arguments.` after `resource has arguments`. The full action catalog and attribute tables are on the [Rules](/reference/controls/rules) reference. ### Author in the dashboard [#author-in-the-dashboard] The rules editor supports a Visual **Builder** alongside raw Cedar. The Builder is a form for the common shape: effect (`permit`, `forbid`), principal, one or more actions, a resource, and `when` / `unless` conditions. Dropdowns are sourced from your workspace catalog (agents, tools, models, pools, attribute keys). Cedar renders live in the preview pane. Toggle **Builder ↔ Cedar** on the editor toolbar. In-progress form state is preserved across the switch. Builder-generated rules parse back into the form on reopen. Rules the Builder cannot model (custom annotations, cross-clause `||`, set helpers outside the Builder's operators) render as a raw card and open in the code editor. **Create rule** opens a scope picker — workspace bundle or a specific agent's bundle. Edit links from elsewhere in the dashboard skip the picker and open the bundle directly. The rules screen can also show the read-only **Effective rules** view for a chosen agent: the resolved policy across organization, tenant, workspace, and agent scopes, grouped into scope cards in precedence order. Filter, search, expand Cedar, or open [Simulate](/govern/rules/simulate) from any row. ### Permit a tool call [#permit-a-tool-call] Replace `AGENT_ID` with the registered agent's UUID. The tool resource uses `CONNECTION_NAME/TOOL_NAME`. ```cedar title="rules.cedar" permit( principal == Dome::Agent::"AGENT_ID", action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"github/list_issues" ); ``` Discovery is a different action. A rule that only permits `mcp:discover` does not allow tool calls. ```cedar title="discover.cedar" permit( principal, action == Dome::Action::"mcp:discover", resource ); ``` ### Forbid with an exception [#forbid-with-an-exception] Deny a sensitive tool for everyone, then carve out agents whose metadata marks them for it. Guard the read with `has` first, because an agent without that metadata key errors the rule out instead of matching it. ```cedar title="restrict-deploy.cedar" forbid( principal, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"deployment/production-deploy" ) unless { principal has metadata && principal.metadata has deploy_target && principal.metadata.deploy_target == "production" }; ``` ### Condition on attributes or arguments [#condition-on-attributes-or-arguments] Gate an LLM call on a connection attribute (`resource.`) or a per-call argument (`resource.arguments.`). Guard argument reads with `resource has arguments` first. Dereferencing a missing argument errors the rule out. ```cedar title="attribute-and-args.cedar" permit( principal, action == Dome::Action::"llm:embed", resource is Dome::LLMModel ) when { resource.pii_certified == true }; forbid( principal, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"vector-search" ) when { resource has arguments && resource.arguments has query && resource.arguments.query like "*Atlas*" }; ``` A `.cedar` file can contain multiple rules. Include every user-authored file that should remain active at the target scope because [Apply rules](#apply-rules) replaces the current user-authored bundle. After writing the files, [validate the rules](#validate-rules) before simulation or deployment. ## Validate Rules [#validate-rules] Validate one or more Cedar files without deploying them. Validation returns blocking Cedar errors and advisory warnings for resource references. > **Note**: Scoped validation and the MCP tool require `rules.view`. Scope-less CLI and API validation require authentication. **CLI** ```bash dome rules validate rules.cedar ``` Add `--agent data-pipeline` to check tool references against that agent's workspace catalog. Without `--agent`, the CLI checks Cedar syntax and semantics only. > **Note**: Reference: [`dome rules validate`](/cli/govern/rules#validate-rules) **MCP** Tool: `dome_rules_validate` ```json { "files": [ { "name": "rules.cedar", "content": "permit(principal == Dome::Agent::\"data-pipeline\", action == Dome::Action::\"mcp:call\", resource == Dome::MCPTool::\"database-query\");" } ] } ``` > **Note**: Reference: [`dome_rules_validate`](/reference/mcp/rules#rules-validate) **API** ```http POST /v1/rules/validate Content-Type: application/json { "files": [ { "name": "rules.cedar", "content": "permit(principal == Dome::Agent::\"data-pipeline\", action == Dome::Action::\"mcp:call\", resource == Dome::MCPTool::\"database-query\");" } ], "scope_kind": "workspace", "scope_id": "{{WORKSPACE_ID}}" } ``` Include a workspace or agent scope to check catalog references. Scope-less validation checks Cedar syntax and semantics. > **Note**: Reference: [`ValidateRules`](/api/tag/authorization/validate-rules) **Agent** ```text title="Validate Rules" Validate rules.cedar for the active workspace and explain every error or warning. ``` ## Simulate Rules [#simulate-rules] Simulate an authorization decision against the rules currently in effect without performing the requested action. Supply the agent, action, resource, and any request context the rules inspect. > **Note**: Requires `rules.view`. **CLI** ```bash dome rules simulate \ --agent data-pipeline \ --action mcp:call \ --resource database-query \ --resource-type mcp_tool ``` > **Note**: Reference: [`dome rules simulate`](/cli/govern/rules#simulate-rules) **MCP** Tool: `dome_rules_simulate` ```json { "agent_id": "data-pipeline", "action": "mcp:call", "resource": "database-query", "resource_type": "mcp_tool" } ``` > **Note**: Reference: [`dome_rules_simulate`](/reference/mcp/rules#rules-simulate) **API** ```http POST /v1/authz/evaluate Content-Type: application/json { "caller": { "agent_id": "{{AGENT_ID}}" }, "action": "mcp:call", "resource": "database-query", "resource_type": "mcp_tool", "workspace_id": "{{WORKSPACE_ID}}" } ``` `workspace_id` selects simulation mode and loads that workspace's effective rules. > **Note**: Reference: [`Evaluate`](/api/tag/authorization/evaluate) **Agent** ```text title="Simulate Rules" Simulate whether "data-pipeline" may call the "database-query" MCP tool. ``` Refer to [Simulate Rules](/govern/rules/simulate) for request arguments, agent Act-As claims, and historical replay. ## Apply Rules [#apply-rules] Apply one or more Cedar files to replace the active user-authored bundle at a target scope. Each successful apply creates a bundle with a new sequence number and content hash. > **Note**: Requires `rules.deploy`. > **Warning**: Applying rules replaces the active user-authored bundle at the selected scope. Include every user-authored file that should remain active. Dome also keeps generated bundles (allowed resources, Act-As, blocked tools, and similar). Change those through the feature that created them, not by applying over them. **CLI** ```bash dome rules apply rules.cedar --name "production-v2" ``` The active workspace is the default scope. Add `--agent data-pipeline` to apply the bundle to one agent instead. The CLI preserves managed `tool-*.cedar` files when they are omitted. Advisory warnings identify MCP tool references that do not match the workspace catalog. Warnings do not block the apply. > **Note**: Reference: [`dome rules apply`](/cli/govern/rules#apply-rules) **MCP** Tool: `dome_rules_deploy` ```json { "files": [ { "name": "rules.cedar", "content": "permit(principal == Dome::Agent::\"data-pipeline\", action == Dome::Action::\"mcp:call\", resource == Dome::MCPTool::\"database-query\");" } ], "name": "production-v2", "scope_kind": "workspace", "scope_id": "{{WORKSPACE_ID}}" } ``` The tool defaults to the active workspace when you omit the scope. The tool preserves managed `tool-*.cedar` files and returns advisory validation warnings without blocking the apply. > **Note**: Reference: [`dome_rules_deploy`](/reference/mcp/rules#rules-deploy) **API** ```http POST /v1/rules Content-Type: application/json { "files": [ { "name": "rules.cedar", "content": "permit(principal == Dome::Agent::\"data-pipeline\", action == Dome::Action::\"mcp:call\", resource == Dome::MCPTool::\"database-query\");" } ], "scope_kind": "workspace", "scope_id": "{{WORKSPACE_ID}}", "name": "production-v2" } ``` The API requires `scope_kind` and `scope_id`. Use `org`, `tenant`, `workspace`, or `agent`. An agent scope also requires `workspace_id`. > **Note**: Reference: [`DeployBundle`](/api/tag/authorization/deploy-bundle) **Agent** ```text title="Apply Rules" Apply rules.cedar to the active workspace as a bundle named "production-v2". ``` After applying rules, [show the effective rules](#show-effective-rules) to confirm that the new bundle contributes to the expected agents. Gateways pick up the change through [effective Rules caching](/concepts/architecture/authorization-model#effective-policy). Allow time for the next sync before testing requests. ## Show effective Rules [#show-effective-rules] Show the rules that apply to an agent after Dome assembles organization, tenant, workspace, agent, and generated bundles. The result includes a content hash for gateway synchronization and the contributing bundles that formed the [effective Rules](/concepts/architecture/authorization-model#effective-policy). > **Note**: Requires `rules.view`. **CLI** ```bash dome rules show --agent data-pipeline ``` Omit `--agent` to show the effective rules for every agent in the active workspace. > **Note**: Reference: [`dome rules show`](/cli/govern/rules#show-rules) **API** ```http GET /v1/agents/{{AGENT_ID}}/policies?workspace_id={{WORKSPACE_ID}} ``` The API uses `policy` in this endpoint name and response schema. The returned `effective_policy` is the assembled effective rule set. > **Note**: Reference: [`GetAgentEffectivePolicy`](/api/tag/agents/get-agent-effective-policy) **Agent** ```text title="Show effective Rules" Show every Rule that applies to "data-pipeline" and identify the contributing bundles. ``` ## Get active Rules at a scope [#get-active-rules-at-a-scope] Get the currently active user-authored rules at one scope when you need that scope's files rather than the assembled [effective rules](#show-effective-rules). > **Note**: Requires `rules.view`. **MCP** Tool: `dome_rules_get_active` ```json { "scope_kind": "workspace", "scope_id": "{{WORKSPACE_ID}}" } ``` > **Note**: Reference: [`dome_rules_get_active`](/reference/mcp/rules#rules-get-active) **API** ```http GET /v1/rules/active?scope_kind=workspace&scope_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`GetBundle`](/api/tag/authorization/get-bundle) **Agent** ```text title="Get active Rules at a scope" Get the active user-authored Rules for the current workspace. ``` ## List Rule history [#list-rule-history] List deployment history at a scope to retrieve IDs, names, sequence numbers, timestamps, and active status. Use an ID when you [roll back rules](#roll-back-rules). > **Note**: Requires `rules.view`. **CLI** ```bash dome rules list --limit 20 ``` Add `--agent data-pipeline` to list the history for one agent. > **Note**: Reference: [`dome rules list`](/cli/govern/rules#list-rules) **MCP** Tool: `dome_rules_list_versions` ```json { "scope_kind": "workspace", "scope_id": "{{WORKSPACE_ID}}", "limit": 20 } ``` > **Note**: Reference: [`dome_rules_list_versions`](/reference/mcp/rules#rules-list-versions) **API** ```http GET /v1/rules?scope_kind=workspace&scope_id={{WORKSPACE_ID}}&limit=20 ``` > **Note**: Reference: [`ListBundles`](/api/tag/authorization/list-bundles) **Agent** ```text title="List Rule history" List the 20 most recent Rule deployments for the active workspace. ``` ## Roll back Rules [#roll-back-rules] Roll back to a historical user-authored bundle when a deployment produces an unexpected authorization result. Rollback creates a new bundle from the selected historical content and preserves the original deployment. > **Note**: Requires `rules.rollback`. > **Warning**: Rollback changes the active user-authored rules at the bundle's stored scope. You cannot roll back the currently active bundle or a system-generated bundle. Generated bundles (`kind=generated`, labeled by `generator` — allowed resources, Act-As, blocked tools, and similar) appear in deployment history for lineage, but they are not rollback targets. The dashboard hides rollback for those rows. Diffs are scoped to the same lineage (scope + kind + generator). Change generated content through the feature that created it, not by rolling back a user-authored bundle over it. **CLI** ```bash dome rules rollback {{BUNDLE_ID}} ``` The bundle ID identifies its scope, so no scope flag is required. > **Note**: Reference: [`dome rules rollback`](/cli/govern/rules#rollback-rules) **MCP** Tool: `dome_rules_rollback` ```json { "bundle_id": "{{BUNDLE_ID}}" } ``` > **Note**: Reference: [`dome_rules_rollback`](/reference/mcp/rules#rules-rollback) **API** ```http POST /v1/rules/rollback Content-Type: application/json { "bundle_id": "{{BUNDLE_ID}}" } ``` > **Note**: Reference: [`RollbackBundle`](/api/tag/authorization/rollback-bundle) **Agent** ```text title="Roll back Rules" Roll back to Rule bundle "{{BUNDLE_ID}}" and confirm the new active bundle. ``` After rollback, [show the effective rules](#show-effective-rules) to confirm that the restored content contributes at the expected scope. ## Delete Rules [#delete-rules] Delete the active user-authored rules at a scope when that scope should no longer contribute custom rules. Deletion preserves bundle history for later inspection. > **Note**: Requires `rules.deploy`. > **Warning**: Deleting rules removes the active authorization contribution from the selected scope. Broader, narrower, and system-generated rules can still apply. **API** ```http DELETE /v1/rules?scope_kind=workspace&scope_id={{WORKSPACE_ID}} ``` > **Note**: Reference: [`DeleteRules`](/api/tag/authorization/delete-rules) **Agent** ```text title="Delete Rules" Delete the active user-authored Rules from the current workspace while preserving bundle history. ``` After deletion, [list rule history](#list-rule-history) and [show effective rules](#show-effective-rules) to confirm the resulting authorization state. ## Generate starter Rules [#generate-starter-rules] > **Warning**: `dome rules generate` is deprecated. It writes a static discovery permit and a commented tool-call example, and `--from-tools` does not change the output. Prefer [writing rules](#write-rules) or the [Rules assistant](/govern/rules/assistant). Generate a static Cedar template with one active rule that lets every agent discover available tools. The template also includes a commented example for permitting calls to one MCP tool. The generated rules do not permit tool calls, inspect registered tools, or change active rules. The `--from-tools` flag produces the same static template. > **Note**: The MCP tool requires `rules.view`. CLI generation runs locally. **CLI** ```bash dome rules generate --output starter.cedar ``` Omit `--output` to print the generated rules to standard output. > **Note**: Reference: [`dome rules generate`](/cli/govern/rules#generate-rules) **MCP** Tool: `dome_rules_generate` ```json {} ``` > **Note**: Reference: [`dome_rules_generate`](/reference/mcp/rules#rules-generate) **Agent** ```text title="Generate starter Rules" Generate a starter Cedar template with a tool-discovery permit and a commented example for permitting a tool call. ``` Validate and simulate the generated file before applying it. ## Next steps [#next-steps] * [Rules](/concepts/controls/rules) concept for how authorization decisions work * [Rules](/reference/controls/rules) reference for actions and attributes * [Draft with the Rules assistant](/govern/rules/assistant) when you prefer natural-language drafts * [Simulate Rules](/govern/rules/simulate) to probe decisions and replay history * [Authorization model](/concepts/architecture/authorization-model) concept for evaluation semantics # Simulate rules (/govern/rules/simulate)

{simulation}

## Overview [#overview] Simulation takes candidate rules and replays them against recorded authorization decisions from your audit log. For each historical event, it compares the original decision with the decision the candidate rules would produce. The output is a set of DecisionDiffs: entries where the allow/deny outcome differs between the current rules and the candidate rules. Use simulation to answer questions like: * Would this new `forbid` have blocked any requests that were previously allowed? * Does this `permit` open access to anything that was previously denied? You can also probe a single synthetic request against the active effective rules without performing the action. That path returns the decision and the rule that determined it. Use it when you want a fast check for one agent, action, and resource before you look at historical diffs. Simulation sits between writing rules and deploying them. Refer to [Authorize Access](/govern/rules) for deploy and rollback. The typical workflow is: 1. [Run a simulation](#run-a-simulation) for one agent, action, and resource against the rules in effect. 2. Optionally [simulate draft rules in the editor](#simulate-draft-rules-in-the-editor) before you apply. 3. Optionally [simulate with agent Act-As](#simulate-with-agent-act-as) or [simulate with arguments](#simulate-with-arguments). 4. [Read results](#read-results) for historical DecisionDiffs when you replay candidate rules against audit history. ## Requirements [#requirements] Before you begin: * Authenticate to Dome and select a workspace * Have an active rule bundle * For historical replay, have authorization events available in the audit log ### Permissions [#permissions] Simulation and DecisionDiff reads require `rules.view`. All workspace roles hold it. | Default roles | Permission | Grants | | ------------------- | ------------ | --------------------------------------------- | | All workspace roles | `rules.view` | Run simulations and read DecisionDiff results | ## Run a simulation [#run-a-simulation] Simulate an authorization decision for one agent, action, and resource against the rules currently in effect. > **Note**: Requires `rules.view`. Write or refine the Cedar rules you want to test before you deploy them: ```cedar title="candidate-rules.cedar" permit( principal == Dome::Agent::"data-pipeline", action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"database-query" ); ``` Then run the simulation with the caller, action, and resource you care about: **CLI** ```bash dome rules simulate \ --agent data-pipeline \ --action mcp:call \ --resource database-query \ --resource-type mcp_tool ``` | Flag | Type | Default | Description | | ------------------ | ----------- | ------------ | --------------------------------------------------------------------------------------------- | | `--agent` | string | **Required** | agent name or ID to simulate as the caller | | `--action` | string | **Required** | Action to evaluate (for example `mcp:call`) | | `--resource` | string | **Required** | Resource identifier (for example `database-query`) | | `--resource-type` | string | `mcp_tool` | `mcp_tool`, `llm_model`, or `resource` | | `--eval-context` | key=value | — | Context key=value pair (repeatable) | | `--eval-arguments` | JSON object | — | Per-call arguments surfaced as `resource.arguments.` (for example `'{"query":"Atlas"}'`) | | `--actas-sub` | string | — | Act-as subject identifier | | `--actas-email` | string | — | Act-as email | | `--actas-roles` | string | — | Act-as roles (comma-separated) | | `--actas-groups` | string | — | Act-as groups (comma-separated) | > **Note**: Reference: [`dome rules simulate`](/cli/govern/rules#simulate-rules) **MCP** Tool: `dome_rules_simulate` ```json { "agent_id": "data-pipeline", "action": "mcp:call", "resource": "database-query", "resource_type": "mcp_tool" } ``` | Param | Type | Default | Description | | --------------- | ------ | ------------ | ---------------------------------------------------------- | | `agent_id` | string | **Required** | agent ID or name (names are resolved to UUIDs by the tool) | | `action` | string | **Required** | Action to evaluate | | `resource` | string | **Required** | Resource identifier | | `resource_type` | string | **Required** | `mcp_tool`, `llm_model`, or `resource` | | `context` | object | — | Additional context key-value pairs | | `actas_sub` | string | — | Act-as subject identifier | | `actas_email` | string | — | Act-as email | | `actas_roles` | string | — | Act-as roles (comma-separated) | | `actas_groups` | string | — | Act-as groups (comma-separated) | `dome_rules_simulate` calls `Authorization.Evaluate` synchronously and returns the decision immediately. The separate `dome_rules_simulate_result` tool polls the historical-replay Simulation service by simulation ID. > **Note**: Reference: [`dome_rules_simulate`](/reference/mcp/rules#rules-simulate) **API** ```http POST /v1/authz/evaluate Content-Type: application/json { "caller": { "agent_id": "" }, "action": "mcp:call", "resource": "database-query", "resource_type": "mcp_tool", "workspace_id": "" } ``` | Field | Type | Default | Description | | ----------------- | ------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `caller.agent_id` | string | **Required** | agent UUID | | `action` | string | **Required** | Action to evaluate | | `resource` | string | **Required** | Resource identifier | | `resource_type` | string | **Required** | `mcp_tool`, `llm_model`, or `resource` (lowercase string) | | `workspace_id` | string | **Required** (simulation) | When set, the API server fetches the workspace effective rules and evaluates against them (simulation mode). When empty, the pre-loaded global evaluator is used (gateway path). | | `context` | map\ | — | Additional context key-value pairs | | `act_as` | ActAs | — | End-user identity (`sub`, `email`, `roles`, `groups`, `claims`) | | `arguments` | bytes | — | JSON object encoded as bytes. Top-level keys become `resource.arguments.` (for example `{"query":"Atlas"}`) | > **Note**: Reference: [`Evaluate`](/api/tag/authorization/evaluate) **Agent** ```text title="Simulate Rules" Simulate authorization for agent "data-pipeline" doing mcp:call on mcp_tool "database-query". ``` ## Simulate draft Rules in the editor [#simulate-draft-rules-in-the-editor] In the rules editor, click **Simulate** in the toolbar. The slide-over shows an **Against: Deployed | Draft** toggle (defaults to Draft). On Draft, the editor's current unsaved files ship as the override for the scope being edited. Production traffic is untouched — the override lasts for that `Evaluate` call only. `Evaluate` accepts an optional `override` that replaces one scope's bundle for the duration of the call. Workspace and agent scopes only. ```json { "caller": { "agent_id": "" }, "action": "mcp:call", "resource": "database-query", "resource_type": "mcp_tool", "workspace_id": "", "override": { "scope_kind": "workspace", "scope_id": "", "files": [ { "path": "rules.cedar", "content": "permit(principal, action, resource);" } ] } } ``` | Field | Description | | --------------------- | ------------------------------------------------------------- | | `override.scope_kind` | `workspace` or `agent` | | `override.scope_id` | UUID of the scope whose bundle is overridden | | `override.files` | Draft Cedar files to evaluate in place of the deployed bundle | An empty, missing, or unknown-scope `override` is a no-op — the call evaluates the deployed policy. ## Simulate with Agent Act-As [#simulate-with-agent-act-as] Include Act-As claims when your Cedar rules reference end-user identity and you want to verify behavior for specific profiles. > **Note**: Requires `rules.view`. The Act-As flags populate the `act_as` record on the principal that Cedar rules can reference. For example, a rule that checks `principal.act_as.roles.contains("admin")` evaluates against the roles you provide. Simulation accepts these claims as test input. Live requests must pass [Delegated agents](/build/agents/delegated) verification before the same values become available to rules. **CLI** ```bash dome rules simulate \ --agent support-agent \ --action mcp:call \ --resource customer-records \ --resource-type mcp_tool \ --actas-sub user-123 \ --actas-email admin@example.com \ --actas-roles admin,manager \ --actas-groups support ``` | Flag | Cedar value | | ---------------- | ------------------------- | | `--actas-sub` | `principal.act_as.sub` | | `--actas-email` | `principal.act_as.email` | | `--actas-roles` | `principal.act_as.roles` | | `--actas-groups` | `principal.act_as.groups` | > **Note**: Reference: [`dome rules simulate`](/cli/govern/rules#simulate-rules) **MCP** Tool: `dome_rules_simulate` ```json { "agent_id": "support-agent", "action": "mcp:call", "resource": "customer-records", "resource_type": "mcp_tool", "actas_sub": "user-123", "actas_email": "admin@example.com", "actas_roles": "admin,manager", "actas_groups": "support" } ``` > **Note**: Reference: [`dome_rules_simulate`](/reference/mcp/rules#rules-simulate) **API** ```http POST /v1/authz/evaluate Content-Type: application/json { "caller": { "agent_id": "" }, "action": "mcp:call", "resource": "customer-records", "resource_type": "mcp_tool", "workspace_id": "", "act_as": { "sub": "user-123", "email": "admin@example.com", "roles": ["admin", "manager"], "groups": ["support"] } } ``` | Field | Type | Default | Description | | --------------- | ------------------- | ------- | ------------------------ | | `act_as.sub` | string | — | Subject identifier | | `act_as.email` | string | — | Email claim | | `act_as.roles` | string\[] | — | Roles claim | | `act_as.groups` | string\[] | — | Groups claim | | `act_as.claims` | map\ | — | Additional custom claims | > **Note**: Reference: [`Evaluate`](/api/tag/authorization/evaluate) **Agent** ```text title="Simulate with Act-As" Simulate authorization for agent "support-agent" doing mcp:call on mcp_tool "customer-records" acting as user "user-123" with email "admin@example.com" and roles "admin,manager". ``` ## Simulate with arguments [#simulate-with-arguments] Pass per-call arguments when your rules reference `resource.arguments.` and you want to verify behavior for a specific payload. Top-level keys of the JSON object become Cedar keys on the resource. Refer to [conditions on attributes or arguments](/govern/rules#condition-on-attributes-or-arguments) for the full shape. > **Note**: Requires `rules.view`. A rule like `resource.arguments.query like "*Atlas*"` matches the example below. Keys whose JSON values are unrepresentable in Cedar (fractional floats, `null`, mixed-type lists) are dropped silently. Rules that reference them will not match. **CLI** ```bash dome rules simulate \ --agent data-pipeline \ --action mcp:call \ --resource vector-search \ --resource-type mcp_tool \ --eval-arguments '{"query":"Atlas","limit":50}' ``` | Flag | Type | Default | Description | | ------------------ | ----------- | ------- | -------------------------------------------------------------------------- | | `--eval-arguments` | JSON object | — | Per-call arguments as a JSON object surfaced as `resource.arguments.` | > **Note**: Reference: [`dome rules simulate`](/cli/govern/rules#simulate-rules) **Dashboard** In the Simulate panel, open the **Arguments** section and add one key-value row per argument. Each row becomes `resource.arguments.` for the evaluation. **API** ```http POST /v1/authz/evaluate Content-Type: application/json { "caller": { "agent_id": "" }, "action": "mcp:call", "resource": "vector-search", "resource_type": "mcp_tool", "workspace_id": "", "arguments": "eyJxdWVyeSI6IkF0bGFzIn0=" } ``` | Field | Type | Default | Description | | ----------- | ----- | ------- | -------------------------------------------------------------------------------------------------------------------------------- | | `arguments` | bytes | — | Base64-encoded JSON object. Top-level keys are surfaced as `resource.arguments.`. Non-object payloads are dropped silently. | > **Note**: Reference: [`Evaluate`](/api/tag/authorization/evaluate) ## Read results [#read-results] DecisionDiffs show where allow/deny outcomes would change between the current effective rules and the candidate rules. Each diff entry includes: * The original decision (allow or deny) under the current rules * The new decision under the candidate rules * The specific event that produced the diff (agent, action, resource) * The rule that matched in each case ```json { "status": "completed", "total_events": 142, "decision_diffs": [ { "event_id": "evt-...", "current": "allow", "candidate": "deny", "rule_id": "rule-..." } ] } ``` Review diffs carefully before deploying. A simulation that shows no diffs means the candidate rules produce identical outcomes for all historical events. It does not guarantee behavior for requests absent from that history. Add synthetic simulations for important unobserved cases. Use historical replay to answer: * Which previously allowed requests would a new `forbid` block? * Which previously denied requests would a new `permit` allow? * Do the candidate rules preserve all observed outcomes? > **Note**: `dome_rules_simulate` evaluates one request synchronously. `dome_rules_simulate_result` retrieves the result of a historical replay by simulation ID. Both tools support AI-assisted rule authoring: an agent writes rules, simulates them, and iterates on results. ## Next steps [#next-steps] * [Write and apply Rules](/govern/rules#write-rules) through the normal rule lifecycle * [Delegated agents](/build/agents/delegated) so live Act-As claims match what you simulated * [Authorization model](/concepts/architecture/authorization-model) concept for entity attributes a simulation may reference # Guards (/reference/controls/guards) This page lists guard types and the catalogs that back them. * Filters rewrite or withhold content. * Validators are pure predicates that block tool traffic when structured checks fail. For how content inspection works, see the [Guards](/concepts/controls/guards) concept. To configure guards, see [Inspect content](/govern/guards). ## Filters [#filters] Filters inspect and rewrite model or tool content on a connection and direction. They run in an ordered chain. A matching `BLOCK` short-circuits the chain. ### Kinds [#kinds] | Kind | Connection | Matchers | Actions | | ------ | ---------- | ------------------------------------------------------------------ | ------------------------- | | `text` | model | Substring, SSN, credit card, phone, digits, IP address, email, URL | `redact`, `block` | | `json` | tool | JSON field path and optional content matchers | `redact`, `omit`, `block` | Filter kind is immutable after create. ### Actions and precedence [#actions-and-precedence] | Action | Effect | | --------------------------------- | ------------------------------------------------------------ | | `redact` / `FILTER_ACTION_REDACT` | Rewrites the matched value or span with a redaction sentinel | | `omit` / `FILTER_ACTION_OMIT` | Removes the key and value (JSON only) | | `block` / `FILTER_ACTION_BLOCK` | Withholds the whole message and short-circuits the chain | When more than one JSON action targets the same path, precedence is `BLOCK` > `OMIT` > `REDACT`. ### Path syntax [#path-syntax] JSON filter `matcher.path` values use a locked-down dialect. It is not JSONPath. | Form | Matches | Example | | ----------------------------------- | -------------------------------------------------- | ----------------------------------------------------------- | | `key` | A top-level field | `email` | | `a.b` | A nested field at an exact path | `user.email` | | `a.b[3].c` | A specific array element by index | `contacts[0].phone` | | `a.b.c` against an array of objects | Every element (implicit fan-out) | `employees.ssn` redacts the field on every employee | | `**.key` or `**.a.b` | The trailing path at **any depth** in the response | `**.phone` redacts every `phone` field, nested at any level | Exact-path matching is the default. The `**.` prefix redacts a field by name wherever it appears. Recursive descent (`**.phone`) fits when the field name is a reliable sensitivity signal regardless of depth, when response shapes vary across tools, or when enumerating every exact path is brittle. Exact paths (`primary_contact.phone`) fit when only specific occurrences are sensitive and a same-named field elsewhere should pass through. `**` is only recognized as a leading prefix. Mid-path `**` (for example `a.**.b`) is treated as literal key characters and never matches. There is no JSONPath `..`, no wildcards, and no slice ranges. ### Content matchers [#content-matchers] JSON filters can match on field values as well as key paths. Author them in `matcher.contentMatchers` on a JSON filter config. | Mode | `path` | `contentMatchers` | Behavior | | ---------------- | ------ | ----------------- | ------------------------------------- | | Key-only | Set | Empty | Matches the field at the path | | Content-only | Empty | Non-empty | Scans values for the matcher patterns | | Path and content | Set | Non-empty | Both must match (AND) | Supported content matcher arms: `substring`, `ssn`, `credit_card`, `phone`, `digits`, `ip`, `email`, and `url`. ### Network-pattern matchers [#network-pattern-matchers] Text and JSON content matchers can recognize common network-facing values without maintaining a literal list. Use `ip` with one or both address families enabled; `email` recognizes email addresses; and `url` recognizes absolute URLs with a scheme and host. ```json title="Redact IP addresses and email addresses" { "text": { "components": [ { "action": "FILTER_ACTION_REDACT", "matchers": [ { "ip": { "v4": true, "v6": true } }, { "email": {} }, { "url": {} } ] } ] } } ``` At least one of `ip.v4` or `ip.v6` must be enabled. These matchers identify values by their standard address or URL syntax; use a substring matcher when you need to match one specific hostname, domain, or address. For `FILTER_ACTION_REDACT`, set `redactTarget` to `REDACT_TARGET_CONTENT_MATCHES` to rewrite only the matched spans. Omit `redactTarget` to redact the whole field value. `REDACT_TARGET_CONTENT_MATCHES` requires a non-empty `contentMatchers` list. ```json { "json": { "components": [ { "field_actions": [ { "matcher": { "path": "**.note", "contentMatchers": [{ "ssn": {} }] }, "action": "FILTER_ACTION_REDACT", "redactTarget": "REDACT_TARGET_CONTENT_MATCHES" } ] } ] } } ``` ### Tool payload coverage [#tool-payload-coverage] JSON filters traverse every tool-result shape the MCP server can return. | Payload | Coverage | | ------------------- | --------------------------------------------- | | Content body | Raw JSON object or array | | Content items | Top-level MCP content array | | Embedded JSON | JSON encoded inside `text` or `resource.text` | | `structuredContent` | Structured mirror attached by the MCP server | Field matchers apply at any depth. A matching `BLOCK` short-circuits the guard chain and replaces the result with a safe placeholder. The audit event identifies the blocking filter. ### Guard audit events [#guard-audit-events] Every acting filter chain emits `guard.filter.evaluate` at `stage=completed`. The event is verdictless: its payload records what the filter did, while the enclosing `tool.call` or `model.call` carries `result=allowed` or `result=denied`. Use payload `direction` (`request` or `response`), `connectionType`, `toolName`, `model`, and `provider` to distinguish the path. A blocking action produces a denied enclosing call with `denial.reason=guard_blocked`. Filter-chain payloads carry: | Field | Description | | --------------------- | ----------------------------------------------- | | `actions` | Deduped set of actions the chain took | | `blockedByFilterIds` | filter IDs that produced a block | | `redactedByFilterIds` | filter IDs that rewrote content in place | | `omittedByFilterIds` | filter IDs that dropped fields from the payload | | `matchCount` | Number of matches, when available | Validator runs emit `guard.validator.evaluate`, also verdictless and completed-only. Its payload carries `direction`, `failedByValidatorIds`, `failureReasons`, `connectionId`, `toolName`, and `connectionType`. A failed validator makes the enclosing `tool.call` denied with `denial.reason=guard_blocked`. If an assigned filter cannot be decoded or compiled, the gateway fails closed for that connection and direction until you roll back or clear the chain. ### Streaming window [#streaming-window] The effective window at stream time is `max(workspace floor, connection override, per-request override)`. Any layer set to `0` drops out of the max. | Layer | Where it's set | Notes | | --------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | Workspace floor | **Settings → Config** in the dashboard, or `UpdateWorkspaceLLMFilterWindow` on the API | Bytes ≤ 1 MiB, tokens ≤ 4096. | | Per-connection | `--filter-window-bytes` / `--filter-window-tokens` on `dome models add` or `dome models update` | `0` inherits the workspace floor. On `update`, passing `0` with the flag present clears the override back to the floor. | | Per-request | `_dome.filter_window_bytes` / `_dome.filter_window_tokens` in the OpenAI or Anthropic request body | The `_dome` key is stripped before the request reaches the upstream provider. | Workspace floor fields are `llm_filter_window_bytes` and `llm_filter_window_tokens`. Per-connection flags live on [Models](/connect/models). Setting the layers is on [Configure the streaming window](/govern/guards#configure-the-streaming-window). ## Validators [#validators] Validators are a guard type for tool connections. They never rewrite content. Every assigned validator must pass (order-independent AND). A failure blocks the whole tool request or response and records which conditions failed. ### Kinds [#kinds-1] | Kind | Edge | What it inspects | | --------------- | -------- | ------------------- | | `tool_request` | Request | tool call arguments | | `tool_response` | Response | MCP tool results | Validator kind is immutable after create. Response validators are MCP-only. Dome rejects assigning a `tool_response` validator to a REST tool connection. ### Conditions [#conditions] Each validator config is a protojson `dome.guards.v1.ValidatorConfig` with either a `toolRequest` or `toolResponse` arm. | Condition | Effect | | -------------------------------------------- | ------------------------------------------------------------------------------------------- | | `json.requiredPaths` | Every listed path must be present | | `json.maximumSize` | Arguments or target payload must not exceed this byte size | | `by_tool` | Per-sub-tool `JSONValidator` map, AND-composed with the top-level `json` for that tool name | | `target` (response only) | Where response conditions run | | `require_structured_content` (response only) | Require MCP `structuredContent` | A validator must set at least one condition. Empty `json` objects are rejected. Response `target` values: | Target | Runs conditions against | | -------------------------------------- | --------------------------------------- | | `VALIDATION_TARGET_STRUCTURED_CONTENT` | MCP `structuredContent` | | `VALIDATION_TARGET_ALL_JSON_CONTENT` | Every JSON-bearing content block | | `VALIDATION_TARGET_ANY_JSON_CONTENT` | At least one JSON-bearing content block | | `VALIDATION_TARGET_CONTENT_ARRAY` | The whole content array | JSON-bearing blocks are the same shapes filters unwrap: `text` blocks whose value is JSON, and `resource.text` on resource blocks. Plain prose is skipped. ### Assignment [#assignment] Validators attach to a tool connection as an unordered set on one direction. Attach and detach are atomic. Direction must match the validator kind (`request` with `tool_request`, `response` with `tool_response`). Unlike filters, validator assignment is not an ordered chain. Every assigned validator runs, and any failure blocks. Create, assign, and inspect validators on [Inspect content](/govern/guards#validators). ## Next steps [#next-steps] * [Guards](/concepts/controls/guards) concept for filters, validators, directions, and fail-closed behavior * [Configure Guards](/govern/guards) to create, assign, and tune windows * [Models](/connect/models) for per-connection filter windows # Quotas (/reference/controls/quotas) This page lists subject types and exhaustion behavior, reset windows, model quota options, and audit event names. For how spend caps work, see the [Quotas](/concepts/controls/quotas) concept. To create and manage quotas, see [Set Usage Limits](/govern/quotas). ## Subjects [#subjects] | Subject | What the quota covers | Exhaustion behavior | | --------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | Workspace | Aggregate governed LLM usage in one workspace | Rejects affected calls with HTTP `429` | | agent | Calls made by one agent | Rejects that agent's affected calls with HTTP `429` | | Act-as | Calls made under one verified end-user OIDC subject | Rejects that subject's affected calls with HTTP `429` | | gateway | Every LLM call routed through one gateway | Rejects calls through that gateway with HTTP `429` | | Pool | Every call routed through one model pool | Rejects calls to that pool with HTTP `429` | | model | Calls dispatched to one model, globally or within one pool | Removes the exhausted model from pool routing when another member remains; otherwise rejects with HTTP `429` | | tool | Calls to one discovered tool on an MCP server connection | Rejects calls to that tool with HTTP `429` | | tool connection | Every call to any tool served by one MCP server connection | Rejects calls through that connection with HTTP `429` | | trigger | Runs queued by one managed-agent trigger | Refuses a new run before it is queued | A model quota can also use **per-caller** scope. Each agent and each verified end user then receives an independent budget against that model. Quota scope is cumulative. A request proceeds only when every applicable limit has remaining budget. Workspace and agent quotas can cover all governed traffic together, only LLM traffic, or only tool traffic. Act-as quotas can cover LLM or tool traffic. Pools, models, and gateways are LLM-only; tools and tool connections are tool-only. Run quotas are different from gateway-enforced traffic quotas. They use `dimension=run`, `unit=runs`, and apply only to a workspace, managed agent, or trigger. They cap how many managed-agent runs can enter the queue in a day or month. ## Organization and tenant allowances [#organization-and-tenant-allowances] At an organization or tenant context, quotas are **usage allowances**, rather than a budget for one resource. An allowance caps all governed traffic, LLM traffic, or tool traffic at that scope for a daily or monthly window. It applies to the scope itself; it does not take an agent, model, pool, or gateway subject. Use allowances when a shared organization- or tenant-level traffic budget is the policy you need. Refer to [Set usage limits](/govern/quotas#set-an-organization-or-tenant-usage-allowance) for the CLI workflow. ## Windows [#windows] Cost limits are stored in micro-USD. CLI, MCP, and dashboard expose them in USD. On the API, `1000000000` micro-USD is $1,000.00. | Window | Reset | | --------- | ------------------------------------------------------------------------------------------ | | `daily` | UTC midnight | | `monthly` | Start of each UTC calendar month | | `per_run` | One managed-agent run; only LLM quotas on an agent, measured in `tokens` or `provider_usd` | The default window on create is `monthly`. One quota may exist for each subject identity and window pair. A `per_run` quota stops a managed-agent run once it reaches its token or estimated-provider-spend budget. It does not constrain ordinary gateway traffic, and one model call can exceed the cap before Dome receives its final usage. ## Run quotas [#run-quotas] Run quotas cap queued work rather than model usage. Set one for a workspace, managed agent, or trigger when a schedule, webhook, or manual run must not create more than a fixed number of runs in a UTC day or month. An admitted run counts when it is queued, including one later withdrawn before it starts. A scheduled occurrence refused for a full quota is recorded as cancelled with `quota_exceeded`; a signed webhook receives HTTP `429`; and a manual run or trigger fire reports the refusal and reset time. Refer to [Set usage limits](/govern/quotas#limit-managed-agent-runs) for the CLI, MCP, and API workflow. ## Reported usage and write-offs [#reported-usage-and-write-offs] Quota reads combine the durable usage baseline with recent gateway usage. The reported value excludes recorded non-billable excess before per-caller totals are reduced to the highest-usage caller. | Unit | Reported usage | | ------------ | ------------------------------------------------ | | Dome USD | Billable usage, clamped to the quota limit | | Tokens | Billable usage, clamped to the quota limit | | Calls | Billable usage, clamped to the quota limit | | Provider USD | Unclamped estimate of the upstream provider bill | A zero limit means unlimited and is not clamped. Write-offs are tied to the capped subject and window, so deleting and recreating a quota cannot reset prior usage or make excluded excess billable. When several caps cover the same call, billing excludes the excess once rather than once per quota. ## Model Quotas [#model-quotas] A model quota can be global, limited to one pool, or per-caller: | Option | What it counts | | --------------- | ----------------------------------------------------- | | Global | Direct calls and calls through every pool | | Within one pool | Only dispatches from that pool | | Per-caller | Separate counter for each agent and verified end user | Exhausted within-pool model quotas spill to another eligible pool member when one remains. Direct exhausted model calls do not spill. Refer to [Quotas](/concepts/controls/quotas#exhaustion-reject-or-spill-inside-a-pool) concept. ## Observability [#observability] | Event | When it fires | | -------------------------------------------------------------------------- | ---------------------------- | | `model.call` at `stage=completed` | model call with token counts | | The refused operation with `result=denied`, `denial.reason=quota_exceeded` | quota exhaustion | | `quota.create` | quota created | | `quota.update` | quota updated | | `quota.delete` | quota deleted | ## Next steps [#next-steps] Create quotas from the how-to. Routing and Act-As subjects show up in pools and delegated agents: * [Quotas](/concepts/controls/quotas) concept for cumulative scopes, spillover, and passthrough * [Set Usage Limits](/govern/quotas) to create, update, list, and remove quotas * [Pools](/connect/pools) for routing strategies and failover * [Delegated agents](/build/agents/delegated) for Act-As subjects * [Event catalog](/reference/events/catalog) reference for the broader audit catalog # Rules (/reference/controls/rules) This page lists `Dome::*` entity types, actions the gateways set, attributes and argument keys rules can read, and constraint forms. It does not catalog customer-owned `resource.` vocabulary. Dome rules are based on [Cedar](https://www.cedarpolicy.com/) policies. For how evaluation works, see the [Authorization Model](/concepts/architecture/authorization-model) concept. To write and deploy rules, see [Authorize Access](/govern/rules). ## Entity types [#entity-types] Each request maps to one principal, one action, and one resource. Conditions may also read `context`. | Entity | Type | Role | | ------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------ | | **Principal** | `Dome::Agent` | Authenticated agent. Carries `metadata` and optionally verified `act_as` claims. | | **Action** | `Dome::Action` | Operation the gateway set for this request. | | **Resource** | `Dome::MCPTool` or `Dome::LLMModel` | Target tool or model. | | **Context** | map | Request-time metadata (timestamp, source IP, and related fields) available to `when` / `unless`. | A specific entity takes the form `Dome::::""`. An agent's identifier is its UUID. A tool's identifier is `CONNECTION_NAME/TOOL_NAME`. ## Actions [#actions] Actions are string literals. There is no separate registration step. The gateway that receives the request sets the action. There is no default action. | gateway | Action | Wire `resource_type` | Resource entity | | ------- | ----------------------------------------------------------------- | -------------------- | ---------------- | | MCP | `mcp:call` | `mcp_tool` | `Dome::MCPTool` | | MCP | `mcp:discover` | `mcp_tool` | `Dome::MCPTool` | | LLM | `llm:invoke` (chat / completion / responses) | `llm_model` | `Dome::LLMModel` | | LLM | `llm:embed` | `llm_model` | `Dome::LLMModel` | | LLM | `llm:moderate` | `llm_model` | `Dome::LLMModel` | | LLM | `llm:list-models` | `llm_model` | `Dome::LLMModel` | | LLM | `llm:count-tokens` (Anthropic pre-flight token counting) | `llm_model` | `Dome::LLMModel` | | LLM | `llm:passthrough` (opaque-body forwarding to a `custom` provider) | `llm_model` | `Dome::LLMModel` | `llm:count-tokens` is distinct from `llm:invoke`, so token counting can be allowed broadly while invocation stays tightly gated. `llm:passthrough` is likewise distinct from `llm:invoke`. The LLM protocol endpoint catalog lives on the [LLM gateway](/concepts/gateways/llm-gateway#endpoints) concept. ## Constraint forms [#constraint-forms] Inside the parentheses, a rule names three constraints in order: `principal`, `action`, `resource`. | Constraint | Available forms | Example | | ----------- | ------------------- | -------------------------------------------------------------------- | | `principal` | Omitted, `is`, `==` | `principal == Dome::Agent::"AGENT_ID"` | | `action` | Omitted, `==`, `in` | `action in [Dome::Action::"mcp:call", Dome::Action::"mcp:discover"]` | | `resource` | Omitted, `is`, `==` | `resource is Dome::MCPTool` | An omitted constraint matches every value. `==` matches one entity. `is` matches every entity of one type. `in` with a list matches several actions. ## Principal attributes [#principal-attributes] | Attribute | Type | Description | | --------------- | -------------- | ----------------------------------------------- | | `metadata` | record | Custom key-value pairs set on the agent record | | `act_as.sub` | string | End-user ID when act-as is present and verified | | `act_as.email` | string | End-user email | | `act_as.roles` | set of strings | End-user roles | | `act_as.groups` | set of strings | End-user groups | | `act_as.claims` | record | Additional customer-defined claims | `metadata` is present only when the agent record carries at least one pair, so guard reads with `principal has metadata` before dereferencing a key. Act-as attributes are available only when the act-as header is present and verified. Claim names and verification methods for setup are on [Delegated agents](/build/agents/delegated#identity-claims). ## Resource attributes [#resource-attributes] Reserved structural attributes cannot be overridden. | Attribute | Type | Source | | ---------- | ------------------------------- | ------------------------------------------------------------------------ | | `type` | string | Resource entity type (`mcp_tool`, `llm_model`) | | `name` | string | Resource name (tool or model identifier) | | `gateways` | set | gateway IDs that include this resource (stamped at sync from membership) | | `` | string, bool, long, set, record | Any top-level key in the connection's `attributes` JSONB | The custom attribute namespace is customer-owned. Dome does not define keys such as `pii_certified` or `data_locality`. Those come from whatever your team stores on the connection. A gateway grant can test membership with `resource.gateways.contains("")`. Configure membership on [Gateways](/build/gateways#resource-membership). Supported value shapes: strings, booleans, whole-number JSON numbers (`Long`), homogeneous sets, and nested records. Fractional numbers, `null`, and mixed-type lists are dropped. Reserved keys (`type`, `name`, `arguments`) are ignored if present in `attributes`. ### LLM-injected attributes [#llm-injected-attributes] For LLM actions, Dome also injects server-side keys that describe the upstream actually dispatched. | Attribute | Meaning | | -------------------------- | -------------------------------------------------------------------------------------- | | `resource.name` | model or pool name the request asked for. Unchanged by pool resolution. | | `resource.resolved_model` | Upstream native model id that will actually be called. | | `resource.connection_name` | Resolved connection's name. | | `resource.pool` | Pool that routed the call, or absent when the request addressed a connection directly. | `resolved_model`, `connection_name`, and `pool` win over any same-named key in `attributes`. On failover, each candidate upstream is evaluated against its own attributes and resolved model. Use `resource.pool` to grant every model behind a pool without enumerating members. Direct connection calls leave `resource.pool` unset, so a pool grant does not authorize them. Ingress behavior is on the [LLM gateway](/concepts/gateways/llm-gateway#authorization) concept. ## Per-call arguments [#per-call-arguments] Values that change per call appear as `resource.arguments.`. | gateway | Keys under `resource.arguments` | | ----------- | ----------------------------------------------------------------------------------------------------------------------- | | MCP | Top-level keys of the `tools/call` `arguments` object | | LLM (chat) | `model`, `stream`, `message_count`, `max_tokens`, `temperature`, `top_p`, `tool_choice`, `tool_names`, `stop_sequences` | | LLM (embed) | `model`, `input_count`, `user` | Guard with `resource has arguments` before reading `resource.arguments.`. The attribute is absent when the call sends no arguments, an empty object, or a non-object payload. Dereferencing a missing attribute errors the policy out, so the rule does not fire. Argument values keep their JSON types when they are strings, booleans, whole-number integers, homogeneous lists, or nested records. Fractional numbers (including `temperature` such as `0.7`), `null`, and mixed-type lists are dropped, so `resource.arguments has ` returns false for those args. Message bodies and embedding inputs are not surfaced. `resource.arguments` is distinct from `context`: * `resource.arguments.*` is what the call carries from the agent. * `context.*` is request-time metadata Dome attaches to the evaluation. By default the audit event for a call does not persist `resource.arguments`, because tool payloads are PII-shaped. Rule evaluation still reads them. Contact support to enable `data.arguments` capture on a workspace. ## Evaluation outcomes [#evaluation-outcomes] | Situation | Decision | | -------------------------------------------------- | --------------------- | | Any matching `forbid` | Denied | | No `forbid`, at least one matching `permit` | Allowed | | No rule matches | Denied (default-deny) | | Evaluator error, stale policy, or no policy loaded | Denied | `forbid` always wins over `permit`, regardless of scope. Refer to [Authorization Model](/concepts/architecture/authorization-model) concept for effective policy assembly and fail-closed detail. ## Next steps [#next-steps] Write and simulate against this catalog: * [Authorization Model](/concepts/architecture/authorization-model) concept for permit/forbid semantics and effective policy * [Authorize Access](/govern/rules) to write, validate, simulate, and apply rules * [Simulate](/govern/rules/simulate) to probe decisions before deploy * [Permissions](/reference/permissions) reference for platform RBAC (separate from rules) # Agents (/reference/entities/agents) This page lists the fields and state transitions of an agent record. An agent is the durable identity Dome authorizes, audits, and attaches credentials and grants to. An agent can be: * An **external agent**, whose worker you run in your own runtime. * A **managed agent**, whose worker Dome runs. * An **interactive agent**, a system-provisioned record for signed-in human gateway traffic. All three types share this identity record, lifecycle, grants, rules, and audit behavior. Refer to [Agents](/concepts/agents) for the identity model. Register and manage agents on [Connect agents](/build/agents). ## Identity [#identity] | Field | Type | Description | | -------------- | -------------- | ------------------------------------------------------------------------- | | `id` | UUID | Stable agent identifier and the identifier used by `Dome::Agent` in rules | | `name` | string | Display name, unique within the workspace | | `tenant_id` | UUID | Tenant that owns the agent | | `workspace_id` | UUID | Workspace that owns the agent and its generated rules | | `parent_id` | UUID | Optional parent agent; fixed after registration | | `metadata` | map of strings | Customer-defined attributes exposed to rules as `principal.metadata` | | `created_at` | timestamp | Registration time | | `updated_at` | timestamp | Last record update | | `last_seen_at` | timestamp | Most recent authenticated activity | An agent hierarchy may be at most 10 levels deep. Parent and child must belong to the same tenant. Hierarchy does not grant access: each agent keeps its own credentials, grants, and effective rules. ## Lifecycle [#lifecycle] | Status | Meaning | Allowed transition | | ------------- | --------------------------------------------- | ------------------------------------- | | `provisioned` | Identity exists but has not yet authenticated | Becomes `active` after successful use | | `active` | May authenticate and make governed calls | Suspend or revoke | | `suspended` | Temporarily blocked from authenticating | Reactivate or revoke | | `revoked` | Permanently blocked | Delete | Suspension can cascade to descendants. Revocation always cascades. Deletion is a hard delete and requires the agent to be revoked first. ## Resource grants [#resource-grants] The agent record exposes grants in two forms: | View | Fields | Behavior | | -------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------- | | Name view | `allowed_pool_names`, `allowed_direct_model_names`, `allowed_tools` | Authoring input and display projection; reflects current resource names | | Canonical view | `allowed_pool_ids`, `allowed_direct_model_ids`, `allowed_tool_ids` | Rename-safe identifiers Dome stores and enforces | | gateway access | `allowed_gateway_ids` | gateway UUIDs whose endpoints the agent may use | Tool entries take the form `/`. Canonical tool entries keep the leaf tool name but replace the connection name with its UUID. Writing these fields generates an agent-scoped rule bundle. Pool and model grants permit model actions; tool grants permit `mcp:call` and `mcp:discover`; gateway grants permit the actions reachable through that gateway. Workspace rules and explicit forbids still apply. ## Managed agents [#managed-agents] A managed agent is an agent that Dome executes. An external agent runs in your own runtime instead. A managed agent keeps the identity, lifecycle, gateway grant, rules, and audit behavior on this page, then adds a system prompt, model or pool, and one gateway for its execution worker. Managed agents cannot carry separate tool grants: their one gateway grant permits the tools that gateway exposes. A [trigger](/build/agents/managed#schedule-runs) decides when the agent runs; it can start work manually, on a schedule, or from a signed webhook. Refer to [Managed agents](/build/agents/managed) for configuration and run operations. ## Interactive agents [#interactive-agents] An interactive agent is a system-provisioned agent record for signed-in human MCP traffic on one gateway. It does not run a worker. Refer to [Interactive access](/build/gateways/interactive-mcp-access) for configuration. ## Delegated identity [#delegated-identity] The `actas_*` fields define how Dome verifies the person an agent acts for and which verified people it may represent. | Field | Description | | -------------------------------- | ----------------------------------------------------------- | | `actas_method` | Verification method: `none`, `oidc`, `hmac`, or `bound` | | `actas_required` | Whether every request must include verified Act-As identity | | `actas_verification_provider_id` | Shared verification provider used by this agent | | `actas_oidc_discovery_url` | Inline OIDC issuer material | | `actas_config_name` | Label for inline agent-specific configuration | | `actas_allowed_groups` | Verified groups the agent may represent | | `actas_allowed_emails` | Verified email addresses the agent may represent | | `actas_allowed_subjects` | Verified subjects the agent may represent | When every allow-list is empty, any identity accepted by the effective workspace Act-As policy may be represented. Populating any list generates a forbid-unless rule against the verified claims. `interactive_access` permits authorized humans to ride the agent through Dome's OAuth flow. It requires at least one allowed email or subject. Groups cannot qualify an interactive login. Device-bound agents expose `pop_required`, `actas_bound_identity`, and `device` as read-only fields set by enrollment. They cannot also use interactive access. ## Credentials [#credentials] Credentials are separate records from the agent identity. Creating an agent does not issue a key. | Property | Behavior | | ------------- | ----------------------------------------------------------------------------- | | agent API key | Long-lived secret exchanged for short-lived agent access tokens | | `token_ttl` | Lifetime of those access tokens; defaults to `10m`, accepted range `1m`–`24h` | | Rotation | Revokes the old key and returns a new secret | | Revocation | Permanently invalidates one key without changing the agent's grants | Key secrets are returned once. Dome stores their verification material, not a retrievable plaintext value. ## Related references [#related-references] * [`dome agents`](/cli/build/agents) CLI commands * [Agents MCP tools](/reference/mcp/agents) * [Agents API](/api/tag/agents/register-agent) * [Rules entity types](/reference/controls/rules#entity-types) # Callers (/reference/entities/callers) This page lists the fields and projection behavior of a Caller record. A Caller is one verified end-user identity observed behind delegated agent traffic in a workspace. Refer to [Callers](/connect/callers) to configure verification providers and inspect the registry. Callers cannot be created directly. ## Identity [#identity] A Caller is keyed by: ```text workspace + verification provider + subject ``` The same `sub` verified by two providers produces two Caller records because Dome cannot assume the providers identify the same person. Inline material, `none`, and device-bound verification use an internal provider identity for the same reason. | Field | Type | Description | | -------------------------- | --------------- | -------------------------------------------------------------------------------- | | `id` | UUID | Stable Caller record identifier | | `tenant_id` | UUID | Tenant that contains the workspace | | `workspace_id` | UUID | Workspace in which the identity was observed | | `sub` | string | Stable subject from the verified Act-As assertion | | `email` | string | Most recently verified email | | `roles` | list of strings | Most recently verified roles | | `groups` | list of strings | Most recently verified groups | | `claims_json` | JSON object | Snapshot of additional string claims from the latest assertion | | `verification_method` | string | Most recently observed method: `none`, `oidc`, `hmac`, or `bound` | | `verification_methods` | list of strings | Every method observed for this Caller | | `verification_provider` | string | Provider display name | | `verification_provider_id` | UUID | Provider that verified the identity; empty for inline, `none`, or bound identity | | `first_seen_at` | timestamp | First accepted delegated activity | | `last_seen_at` | timestamp | Most recent accepted delegated activity | Identity and claims are projected from `caller.identity.set` audit events. Activity is projected from completed model and tool calls carrying the same verified subject. Interactive OAuth users do not become Callers. Their identity and revocable access belong to interactive grants. ## Activity [#activity] | Field | Scope | | ------------- | --------------------------------------------------------------------------------------- | | `llm_calls` | Lifetime completed model calls | | `tool_calls` | Lifetime completed tool calls | | `llm_tokens` | Lifetime provider-reported input, cache-read, cache-write, output, and reasoning tokens | | `agent_count` | Distinct agents the Caller has appeared behind | | `agents` | Per-agent activity; returned by Get, not List | | `resources` | models and tools used, most recently used first; returned by Get, not List | | `monthly` | Current UTC calendar month's calls and provider-reported tokens; returned by Get | Monthly activity is present only when the Caller was active in the current UTC month. A prior month's accumulator is omitted until new activity resets it. Token totals never use byte-derived estimates, and Caller records do not carry spend. Each agent and resource detail includes first seen, last seen, calls, tokens where applicable, and the same current-month block. Tool resources always report `0` tokens. ## List behavior [#list-behavior] Caller lists are workspace-scoped and return lean rows rather than agent and resource details. | filter | Match | | ----------------------------------- | ---------------------------------- | | `search` | Substring of `sub` or `email` | | `group` | Exact membership in `groups` | | `attribute_key` + `attribute_value` | Exact match in the claims snapshot | | `verification_provider_id` | One verification provider | Pagination is zero-based. The default page size is `50` and the maximum is `200`. ## Erasure [#erasure] Deleting a Caller erases the projected Caller record and its per-agent activity rows. It does not delete the underlying audit events. The registry is rebuilt from new evidence, so later delegated traffic carrying the same identity creates the Caller again. Deletion is therefore PII erasure from the operational projection, not a deny-list or an audit-retention operation. ## Related references [#related-references] * [`dome callers`](/cli/connect/callers) CLI commands * [Callers MCP tools](/reference/mcp/callers) * [Delegated agents](/build/agents/delegated) * [Audit event catalog](/reference/events/catalog) # Managed agents (/reference/entities/managed-agents) A managed agent is an agent whose execution worker Dome runs. An external agent runs its worker in your own runtime. A managed agent extends an [agent](/reference/entities/agents) with the configuration needed to execute its prompt through one gateway. | Field | Description | | --------------- | ------------------------------------------------------------------------------------ | | `agent` | Underlying agent identity, lifecycle, access grant, and rules | | `system_prompt` | Persistent instructions for each run | | `default_model` | model or pool the worker invokes | | gateway grant | Exactly one allowed gateway; it determines the models and tools the worker can reach | Managed agents cannot carry separate tool grants. Dome holds the runner credential and never returns it. ## Runs [#runs] | Field | Description | | -------------------------------------------- | ---------------------------------------------------------------- | | `trigger_source` | `manual`, `schedule`, or `webhook` | | `status` | `pending`, `running`, `succeeded`, `failed`, or `cancelled` | | `scheduled_for`, `started_at`, `finished_at` | Queue and execution timestamps | | `output_summary` | Final assistant text for a successful run | | `error` | Last failure reason when present | | `attempt`, `max_retries` | Attempt count and retry budget captured when the run was created | | `trigger_id` | Trigger that queued the run; empty for a manual run | | `cancel_reason` | Why pending work was withdrawn, when cancelled | Refer to [Managed agents](/build/agents/managed) for operations and [Triggers](/reference/entities/triggers) for the resource that starts runs. # Triggers (/reference/entities/triggers) A trigger decides when managed agents run. A trigger is a workspace resource with one or more managed-agent targets. | Field | Description | | --------------------------- | ----------------------------------------------------------------------------------- | | `kind` | `schedule` or `webhook` | | `config` | Schedule cron expression and optional IANA timezone; webhook configuration is empty | | `input` | First user message for each run; a manual fire or webhook body can override it | | `max_concurrent_runs` | Maximum runs across all targets; `0` is unlimited | | `targets` | Managed-agent target edges, each with an independent enabled switch | | `catch_up` | `once`, `all`, or `skip` for missed schedule occurrences | | `catch_up_deadline_seconds` | How late a missed occurrence can run; `0` means one schedule interval | | `max_retries` | Infrastructure retry budget; `0` disables retries | A webhook trigger returns its signing secret once. Its endpoint URL stays readable, but every request must carry a Standard Webhooks v1 signature. A changed schedule, paused trigger, removed target, or suspended agent can cancel pending schedule runs. Refer to [Managed agents](/build/agents/managed) for configuration and [Managed agents](/reference/entities/managed-agents) for run fields. # Audit event catalog (/reference/events/catalog) Dome writes one audit trail for configuration and runtime activity. This page is the complete list of event types on that trail, what each one records, and which are also delivered to webhook subscriptions. Use it to pick the types you want to query, subscribe to, or alert on. For the envelope fields, enum forms, and filter syntax those types share, refer to [Event contracts](/reference/events/contracts). ## How an event type is named [#how-an-event-type-is-named] Every type is `entity.verb` in present tense: the entity the event is about, then the operation. `agent.register`, `bundle.deploy`, `connection.create`, `workspace.config.update`. Nested entities keep their path, as in `agent.key.rotate` and `verification.provider.update`. > **Note**: Event types name a single entity: `agent.register`, `bundle.deploy`, `quota.update`. [Permissions](/reference/permissions) name a collection: `agents.register`, `rules.deploy`, `gateways.manage`. The singular form is always the event; the plural form is always the permission. ## Event classes [#event-classes] Every type belongs to exactly one class. | Class | Description | | -------------- | ----------------------------------- | | `governing` | Authorization and runtime decisions | | `state_change` | Configuration mutations | | `security` | Authentication front door | | `audit_access` | Reads of the trail itself | Class is the coarse filter. Query `security` to review the authentication front door, `audit_access` to see who read the trail, `state_change` for configuration history, `governing` for runtime decisions. ## Outcomes and phases [#outcomes-and-phases] A type's name never changes to describe its outcome. The same event carries the verdict. | Field | Meaning | | -------- | ----------------------------------------------------------------------------- | | `stage` | `attempted` or `completed`. Types with a two-phase profile emit both. | | `result` | `allowed` or `denied` on types that have a verdict. | | `denial` | Present exactly when `result` is `denied`, with the reason and deciding rule. | | `error` | Handling or dispatch failure, independent of `result`. | There is no separate denial event type and no `access.denied`. A refused operation is its own event with `stage=completed`, `result=denied`, and the `denial` block. To find refusals, filter any type on `result=denied`. Guard blocks leave the verdict on the enclosing call with `denial.reason=guard_blocked`. These five carry the most contract detail: | Type | Contract | | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tool.call` | One tool operation. Emits `stage=attempted` and `stage=completed`; the completed row carries `result=allowed` or `result=denied`, plus an independent `error` when handling or dispatch failed. | | `model.call` | One model operation with the same phase and verdict contract. Completed rows carry token, byte, latency, provider, connection, pool, and model fields when available. | | `authorization.evaluate` | Completed Cedar evaluation with `result=allowed` or `result=denied`. | | `guard.filter.evaluate` | Completed filter evaluation. The verdict is on the enclosing `tool.call` or `model.call`; this event has no `result`. Payload includes `direction`, `actions`, acting filter IDs, connection facts, and tool/model facts. | | `guard.validator.evaluate` | Completed validator evaluation. The verdict is on the enclosing `tool.call`; this event has no `result`. Payload includes `direction`, failed validator IDs, and failure reasons. | ## Webhook delivery [#webhook-delivery] Webhook event types are the same strings as audit event types, byte for byte, so one fact carries one name on both. The delivered catalog is a subset: the **Webhook** column below marks which types reach subscriptions. `eventing.test` is webhook-only, a synthetic ping with no audit twin. The body differs even when the name matches. A webhook carries a slim public `data` projection with no PII, credentials, or raw tool payloads. Refer to [Event contracts](/reference/events/contracts#webhooks) for that envelope and the bundle presets. ## Payload fields [#payload-fields] This page stops at the event type. Each type also has a typed payload whose fields are defined per type, and only catalog-marked fields are filterable. **CLI** ```bash dome audit catalog list dome audit catalog show tool.call ``` > **Note**: Reference: [`dome audit catalog`](/cli/operate/audit#catalog) **MCP** Tools: `dome_audit_catalog_list`, `dome_audit_catalog_show` > **Note**: Reference: [`dome_audit_catalog_show`](/reference/mcp/audit#catalog-show) **Dashboard** Open **Settings → Eventing → Event Catalog** to browse payload fields, sample bodies, and JSON schemas. ## Catalog [#catalog] {/* BEGIN GENERATED CATALOG */} 223 event types, grouped by Connect, Govern, Operate, and Manage. The **Webhook** column marks the 49 types also delivered to webhook subscriptions. ### Connect [#connect] #### Agents [#agents] | Event type | Class | Webhook | Description | | ------------------------------ | -------------- | ------- | -------------------------------------------------------------- | | `agent.activate` | `state_change` | ✅ | An agent became active and may send traffic. | | `agent.delete` | `state_change` | ✅ | An agent identity was deleted. | | `agent.enroll` | `state_change` | ✅ | A device-bound agent completed enrollment. | | `agent.enrollmenttoken.create` | `state_change` | — | An enrollment token was issued for device binding. | | `agent.enrollmenttoken.read` | `governing` | — | Enrollment token metadata was read. | | `agent.enrollmenttoken.revoke` | `state_change` | — | An enrollment token was revoked. | | `agent.key.create` | `state_change` | ✅ | An API key was issued for an agent. | | `agent.key.read` | `governing` | — | agent key metadata was read. The key itself is never returned. | | `agent.key.revoke` | `state_change` | ✅ | An agent API key was revoked. | | `agent.key.rotate` | `state_change` | ✅ | An agent API key was rotated. | | `agent.list` | `governing` | — | agents were listed. | | `agent.reactivate` | `state_change` | ✅ | A suspended agent was returned to active. | | `agent.read` | `governing` | — | An agent record was read. | | `agent.register` | `state_change` | ✅ | An agent identity was registered. | | `agent.revoke` | `state_change` | ✅ | An agent was revoked and can no longer authenticate. | | `agent.suspend` | `state_change` | ✅ | An agent was suspended and its traffic blocked. | | `agent.token.issue` | `security` | — | An agent exchanged its API key for a short-lived access token. | | `agent.update` | `state_change` | ✅ | An agent record, access, or Act-As settings changed. | | `managedagent.create` | `state_change` | — | A managed agent was created. | | `managedagent.delete` | `state_change` | — | A managed agent was deleted. | | `managedagent.list` | `governing` | — | Managed agents or their run history were listed. | | `managedagent.read` | `governing` | — | A managed agent or run was read. | | `managedagent.run` | `state_change` | ✅ | A managed-agent run started or completed. | | `managedagent.run.cancel` | `state_change` | ✅ | A queued managed-agent run was cancelled before execution. | | `managedagent.run.schedule` | `state_change` | ✅ | A managed-agent run was queued. | | `managedagent.update` | `state_change` | — | A managed agent's prompt or model changed. | | `managedagent.webhook.create` | `state_change` | — | An agent-scoped webhook trigger was requested. | | `managedagent.webhook.read` | `governing` | — | agent-scoped webhook triggers were read. | | `managedagent.webhook.revoke` | `state_change` | — | An agent-scoped webhook trigger was revoked. | #### Triggers [#triggers] | Event type | Class | Webhook | Description | | ---------------- | -------------- | ------- | --------------------------------- | | `trigger.create` | `state_change` | — | A trigger was created. | | `trigger.delete` | `state_change` | — | A trigger was deleted. | | `trigger.list` | `governing` | — | Triggers were listed. | | `trigger.read` | `governing` | — | A trigger was read. | | `trigger.start` | `state_change` | — | A trigger was fired. | | `trigger.update` | `state_change` | — | A trigger or its targets changed. | #### Identity, sessions, and callers [#identity-sessions-and-callers] | Event type | Class | Webhook | Description | | ------------------------- | -------------- | ------- | -------------------------------------------------------------------------------- | | `apikey.create` | `state_change` | ✅ | A platform API key was created. | | `apikey.read` | `governing` | — | Platform API key metadata was read. | | `apikey.revoke` | `state_change` | ✅ | A platform API key was revoked. | | `caller.identity.delete` | `state_change` | — | A projected caller record was erased. Audit evidence is untouched. | | `caller.identity.read` | `governing` | — | The Callers registry was read. | | `caller.identity.set` | `security` | — | A verified Act-As identity was observed and projected into the Callers registry. | | `impersonation.start` | `security` | — | A support impersonation session started. | | `impersonation.terminate` | `security` | — | An impersonation session ended. | | `interactivegrant.create` | `security` | — | An interactive OAuth grant was issued so a person could ride an agent. | | `interactivegrant.read` | `governing` | — | Interactive grants were read. | | `interactivegrant.revoke` | `security` | — | An interactive grant was revoked. | | `mcpclient.register` | `state_change` | — | An MCP client registered itself for interactive OAuth. | | `session.login` | `security` | — | A person signed in to the platform. | | `session.rotate` | `security` | — | A platform session token was refreshed. | | `session.switch` | `security` | — | A session switched organization, tenant, or workspace context. | | `session.terminate` | `security` | — | A platform session ended. | | `user.create` | `security` | — | A platform user record was created. | | `user.read` | `governing` | — | Platform user records were read. | #### Verification providers [#verification-providers] | Event type | Class | Webhook | Description | | ------------------------------------ | -------------- | ------- | ---------------------------------------------------------- | | `verification.provider.create` | `state_change` | ✅ | A verification provider was created. | | `verification.provider.delete` | `state_change` | ✅ | A verification provider was deleted. | | `verification.provider.secret.issue` | `security` | — | An HMAC secret was issued for a verification provider. | | `verification.provider.sync` | `state_change` | — | A verification provider was synced from an SSO connection. | | `verification.provider.update` | `state_change` | ✅ | A verification provider was updated. | #### Tools [#tools] | Event type | Class | Webhook | Description | | ---------------------- | -------------- | ------- | --------------------------------------------------------------------- | | `tool.call` | `governing` | ✅ | One tool operation through the tool gateway, from attempt to outcome. | | `tool.catalog.read` | `governing` | — | A tool catalog was read. | | `tool.catalog.sync` | `state_change` | ✅ | A tool catalog was refreshed from its upstream MCP server. | | `tool.list` | `governing` | — | An agent discovered the tools available to it. | | `tool.status.set` | `state_change` | ✅ | A tool was enabled or disabled. | | `tool.validator.read` | `governing` | — | validator assignments on a tool were read. | | `tool.validator.set` | `state_change` | — | A validator was assigned to a tool. | | `tool.validator.unset` | `state_change` | — | A validator was removed from a tool. | #### Models [#models] | Event type | Class | Webhook | Description | | ---------------------- | ----------- | ------- | ---------------------------------------------------------------------- | | `model.call` | `governing` | — | One model operation through the model broker, from attempt to outcome. | | `model.list` | `governing` | — | An agent listed the models available to it. | | `model.upstream.proxy` | `governing` | — | A request was proxied to an upstream model provider. | #### Model pools [#model-pools] | Event type | Class | Webhook | Description | | -------------------- | -------------- | ------- | ---------------------------------------------- | | `pool.create` | `state_change` | — | A model pool was created. | | `pool.default.set` | `state_change` | — | A pool was made the workspace default. | | `pool.delete` | `state_change` | — | A model pool was deleted. | | `pool.member.create` | `state_change` | — | A model connection was added to a pool. | | `pool.member.delete` | `state_change` | — | A model connection was removed from a pool. | | `pool.member.update` | `state_change` | — | A pool member's routing settings changed. | | `pool.move` | `state_change` | — | A pool was moved to another scope. | | `pool.read` | `governing` | — | model pools were read. | | `pool.update` | `state_change` | — | A pool's routing or failover settings changed. | #### Connections and credentials [#connections-and-credentials] | Event type | Class | Webhook | Description | | ----------------------------------- | -------------- | ------- | --------------------------------------------------------------- | | `connection.consent.grant` | `state_change` | — | Consent was granted for an upstream connection. | | `connection.create` | `state_change` | ✅ | A connection to an upstream tool or model provider was created. | | `connection.credential.disconnect` | `state_change` | — | Stored upstream credentials were disconnected. | | `connection.credential.read` | `security` | — | Upstream credential metadata was read. | | `connection.credential.refresh` | `state_change` | — | An upstream OAuth credential was refreshed. | | `connection.credential.rotate` | `state_change` | — | Upstream credentials were rotated. | | `connection.credentiallink.consume` | `state_change` | — | A credential link was redeemed to attach upstream credentials. | | `connection.credentiallink.issue` | `state_change` | — | A credential link was issued for out-of-band credential entry. | | `connection.delete` | `state_change` | ✅ | A connection was deleted. | | `connection.oauth.client.register` | `state_change` | — | An OAuth client was registered for a connection. | | `connection.oauth.connect` | `security` | — | An OAuth authorization flow ran for a connection. | | `connection.read` | `governing` | — | Connections were read. | | `connection.update` | `state_change` | ✅ | A connection's configuration or egress settings changed. | #### Gateways [#gateways] | Event type | Class | Webhook | Description | | ---------------------------- | -------------- | ------- | ----------------------------------------------------------------- | | `gateway.allagentsgrant.set` | `state_change` | — | A workspace-wide agent grant on a gateway was set or cleared. | | `gateway.create` | `state_change` | ✅ | A gateway was created. | | `gateway.default.set` | `state_change` | — | A gateway was made the workspace default. | | `gateway.delete` | `state_change` | ✅ | A gateway was deleted and its endpoint stopped accepting traffic. | | `gateway.member.create` | `state_change` | ✅ | A resource was attached to a gateway. | | `gateway.member.delete` | `state_change` | ✅ | A resource was detached from a gateway. | | `gateway.read` | `governing` | — | gateways were read. | | `gateway.state.set` | `state_change` | — | A gateway was enabled or disabled. | | `gateway.update` | `state_change` | ✅ | A gateway's configuration changed. | ### Govern [#govern] #### Rules and policy [#rules-and-policy] | Event type | Class | Webhook | Description | | ------------------------ | -------------- | ------- | ------------------------------------------------------------------- | | `assistant.run` | `governing` | — | The rules assistant drafted or refined a policy. | | `authorization.evaluate` | `governing` | — | Cedar evaluated a governed request and returned allow or deny. | | `authorization.simulate` | `governing` | — | A decision was simulated without affecting live traffic. | | `bundle.delete` | `state_change` | ✅ | A rule bundle was deleted. | | `bundle.deploy` | `state_change` | ✅ | A rule bundle was deployed and became effective policy. | | `bundle.read` | `governing` | — | A rule bundle was read. | | `bundle.rollback` | `state_change` | ✅ | A rule bundle was rolled back to an earlier version. | | `bundle.validate` | `governing` | — | A rule bundle was validated without deploying. | | `effectivepolicy.read` | `governing` | — | The merged effective policy for an agent was read. | | `simulation.read` | `audit_access` | — | A stored simulation result was read. | | `simulation.run` | `state_change` | — | A simulation batch was run against historical or supplied requests. | | `snapshot.apply` | `state_change` | — | A policy snapshot was applied. | #### Guards [#guards] | Event type | Class | Webhook | Description | | -------------------------- | -------------- | ------- | -------------------------------------------------------------------------------------------- | | `filter.assignment.set` | `state_change` | — | filter assignments on a connection changed. | | `filter.create` | `state_change` | — | A filter guard was created. | | `filter.delete` | `state_change` | — | A filter guard was deleted. | | `filter.read` | `governing` | — | filter guards were read. | | `filter.rollback` | `state_change` | — | A filter guard was rolled back to an earlier version. | | `filter.update` | `state_change` | — | A filter guard was updated. | | `guard.filter.evaluate` | `governing` | ✅ | A filter inspected request or response content. The verdict stays on the enclosing call. | | `guard.validator.evaluate` | `governing` | ✅ | A validator checked a tool call against its schema. The verdict stays on the enclosing call. | | `validator.create` | `state_change` | — | A validator guard was created. | | `validator.delete` | `state_change` | — | A validator guard was deleted. | | `validator.read` | `governing` | — | validator guards were read. | | `validator.rollback` | `state_change` | — | A validator guard was rolled back to an earlier version. | | `validator.update` | `state_change` | — | A validator guard was updated. | #### Quotas [#quotas] | Event type | Class | Webhook | Description | | -------------- | -------------- | ------- | --------------------------------- | | `quota.create` | `state_change` | — | A quota was created. | | `quota.delete` | `state_change` | — | A quota was removed. | | `quota.read` | `governing` | — | quotas were read. | | `quota.update` | `state_change` | — | A quota's limit or scope changed. | ### Operate [#operate] #### Audit access and SIEM [#audit-access-and-siem] | Event type | Class | Webhook | Description | | ------------------------ | -------------- | ------- | --------------------------------------------------- | | `audit.event.read` | `governing` | — | A single audit event was fetched. | | `audit.export.create` | `audit_access` | — | An export job was created. | | `audit.export.run` | `audit_access` | ✅ | An export job ran and delivered records downstream. | | `audit.probe.run` | `audit_access` | — | An audit pipeline health probe ran. | | `audit.query` | `governing` | — | The audit trail was queried. | | `audit.stream.create` | `audit_access` | — | An audit stream was opened. | | `audit.stream.delete` | `audit_access` | — | An audit stream was closed. | | `siemstream.cursor.set` | `audit_access` | — | A SIEM forwarder cursor was moved. | | `siemstream.enabled.set` | `audit_access` | — | SIEM forwarding was turned on or off. | | `siemstream.status.set` | `audit_access` | ✅ | A SIEM forwarder reported a status change. | #### Metrics [#metrics] | Event type | Class | Webhook | Description | | --------------- | ----------- | ------- | ---------------------------- | | `metric.create` | `governing` | — | A metric series was written. | | `metric.read` | `governing` | — | Metrics were read. | #### Webhooks [#webhooks] | Event type | Class | Webhook | Description | | ---------------------------- | -------------- | ------- | -------------------------------------------------- | | `delivery.bulkreplay.create` | `state_change` | — | A bulk replay of past deliveries was requested. | | `delivery.cancel` | `state_change` | — | A pending delivery was cancelled. | | `delivery.read` | `governing` | — | Delivery history was read. | | `delivery.replay` | `state_change` | — | One delivery was replayed. | | `destination.create` | `state_change` | ✅ | A webhook destination was created. | | `destination.delete` | `state_change` | ✅ | A webhook destination was deleted. | | `destination.read` | `governing` | — | Webhook destinations were read. | | `destination.rotate` | `security` | — | A destination's signing secret was rotated. | | `destination.test` | `state_change` | — | A test delivery was sent to a destination. | | `destination.update` | `state_change` | ✅ | A webhook destination was updated. | | `subscription.create` | `state_change` | ✅ | A webhook subscription was created. | | `subscription.delete` | `state_change` | ✅ | A webhook subscription was deleted. | | `subscription.enabled.unset` | `state_change` | ✅ | A webhook subscription was disabled. | | `subscription.read` | `governing` | — | Webhook subscriptions were read. | | `subscription.update` | `state_change` | ✅ | A webhook subscription's types or filters changed. | ### Manage [#manage] #### Import and export configuration [#import-and-export-configuration] | Event type | Class | Webhook | Description | | --------------------------- | -------------- | ------- | -------------------------------------------------- | | `export.read` | `governing` | — | Exportable configuration was listed. | | `export.create` | `governing` | — | A configuration export was created. | | `import.job.create` | `state_change` | — | An import or plan job was created. | | `import.job.read` | `governing` | — | An import job was read. | | `import.job.cancel` | `state_change` | — | Cancellation of an import job was requested. | | `import.job.run` | `state_change` | — | An import job reached a terminal result. | | `import.job.output.consume` | `security` | — | One-time outputs from an import job were revealed. | #### Workspaces [#workspaces] | Event type | Class | Webhook | Description | | ------------------------------------------- | -------------- | ------- | --------------------------------------------------------- | | `workspace.actas.update` | `state_change` | — | The workspace Act-As floor or provider selection changed. | | `workspace.config.update` | `state_change` | ✅ | Workspace configuration changed. | | `workspace.create` | `state_change` | — | A workspace was created. | | `workspace.delete` | `state_change` | — | A workspace was deleted. | | `workspace.filterwindow.update` | `state_change` | — | The workspace filter window changed. | | `workspace.freshnesswindow.update` | `state_change` | ✅ | The workspace policy freshness window changed. | | `workspace.membership.set` | `state_change` | ✅ | A member's workspace role was assigned or changed. | | `workspace.membership.unset` | `state_change` | ✅ | A member was removed from the workspace. | | `workspace.physicalgateway.credential.move` | `state_change` | — | gateway credentials were moved between physical gateways. | | `workspace.physicalgateway.set` | `state_change` | — | The workspace's physical gateway assignment changed. | | `workspace.read` | `governing` | — | Workspace records were read. | | `workspace.update` | `state_change` | — | Workspace settings changed. | #### Tenants [#tenants] | Event type | Class | Webhook | Description | | ----------------------------------- | -------------- | ------- | ----------------------------------------------- | | `tenant.actas.update` | `state_change` | — | The tenant Act-As provider selection changed. | | `tenant.create` | `state_change` | — | A tenant was created. | | `tenant.defaultphysicalgateway.set` | `state_change` | — | The tenant's default physical gateway changed. | | `tenant.delete` | `state_change` | — | A tenant was deleted. | | `tenant.membership.set` | `state_change` | — | A member's tenant role was assigned or changed. | | `tenant.membership.unset` | `state_change` | — | A member was removed from the tenant. | | `tenant.read` | `governing` | — | Tenant records were read. | | `tenant.update` | `state_change` | — | Tenant settings changed. | #### Organization, SSO, and billing [#organization-sso-and-billing] | Event type | Class | Webhook | Description | | ----------------------------------------- | -------------- | ------- | -------------------------------------------------------- | | `organization.actas.update` | `state_change` | — | The organization Act-As provider selection changed. | | `organization.billing.contact.update` | `state_change` | — | The billing contact changed. | | `organization.billing.credit.grant` | `state_change` | — | Account credit was granted. | | `organization.billing.read` | `governing` | — | Billing records were read. | | `organization.create` | `state_change` | — | An organization was created. | | `organization.defaultphysicalgateway.set` | `state_change` | — | The organization's default physical gateway changed. | | `organization.domain.create` | `state_change` | — | A verified email domain was added. | | `organization.domain.requiresso.set` | `state_change` | — | SSO enforcement for a domain was turned on or off. | | `organization.featureflags.read` | `governing` | — | Organization feature flags were read. | | `organization.membership.read` | `governing` | — | Organization memberships were read. | | `organization.membership.set` | `state_change` | — | A member's organization role was assigned or changed. | | `organization.membership.unset` | `state_change` | — | A member was removed from the organization. | | `organization.modelprice.delete` | `state_change` | — | A model rate was removed from the organization rate era. | | `organization.modelprice.read` | `governing` | — | Organization model rates were read. | | `organization.modelprice.set` | `state_change` | — | A model rate was set, opening or extending a rate era. | | `organization.modelprice.update` | `state_change` | — | An organization model rate changed. | | `organization.paymentmethod.default.set` | `state_change` | — | The default payment method changed. | | `organization.paymentmethod.delete` | `state_change` | — | A payment method was removed. | | `organization.paymentmethod.update` | `state_change` | — | A payment method was added or updated. | | `organization.previews.set` | `state_change` | — | An organization preview feature changed. | | `organization.quantity.set` | `state_change` | — | An organization workspace quantity changed. | | `organization.read` | `governing` | — | Organization records were read. | | `organization.seats.set` | `state_change` | — | The purchased seat count changed. | | `organization.sku.set` | `state_change` | — | The subscription SKU changed. | | `organization.sso.read` | `governing` | — | SSO configuration was read. | | `organization.sso.setup.start` | `state_change` | — | An SSO connection setup flow started. | | `organization.subscription.cancel` | `state_change` | — | The subscription was cancelled. | | `organization.subscription.reactivate` | `state_change` | — | A cancelled subscription was reactivated. | | `organization.subscription.update` | `state_change` | — | The subscription changed state. | | `organization.update` | `state_change` | — | Organization settings changed. | #### Integrations and catalogs [#integrations-and-catalogs] | Event type | Class | Webhook | Description | | ----------------------------- | -------------- | ------- | ------------------------------------------------ | | `integration.catalog.create` | `state_change` | — | A catalog integration was added. | | `integration.catalog.delete` | `state_change` | — | A catalog integration was removed. | | `integration.catalog.update` | `state_change` | — | A catalog integration was updated. | | `integration.instance.create` | `state_change` | — | An integration was connected for this workspace. | | `integration.instance.delete` | `state_change` | — | A connected integration was removed. | | `integration.instance.read` | `governing` | — | Connected integrations were read. | | `integration.instance.update` | `state_change` | — | A connected integration changed. | | `mcpcatalog.create` | `state_change` | — | An MCP catalog entry was added. | | `mcpcatalog.delete` | `state_change` | — | An MCP catalog entry was removed. | | `mcpcatalog.enabled.set` | `state_change` | — | An MCP catalog entry was enabled or disabled. | #### Scheduled jobs [#scheduled-jobs] | Event type | Class | Webhook | Description | | ------------ | -------------- | ------- | ---------------------------- | | `job.create` | `state_change` | — | A scheduled job was created. | | `job.delete` | `state_change` | — | A scheduled job was deleted. | | `job.read` | `governing` | — | Scheduled jobs were read. | | `job.run` | `state_change` | — | A scheduled job ran. | | `job.update` | `state_change` | — | A scheduled job was updated. | {/* END GENERATED CATALOG */} ## Next steps [#next-steps] * [Event contracts](/reference/events/contracts) for the envelope, enum forms, correlation, and filter syntax * [Audit events](/concepts/audit) concept for how the one trail works * [Audit events](/operate/audit) to query events and follow activity chains * [Subscribe to Events](/operate/webhooks) to send the marked types to a destination # Audit event contracts (/reference/events/contracts) This page is the wire contract shared by every audit event: the envelope fields, how enums render on each surface, how events correlate, and what a webhook body looks like. For the list of event types and what each records, refer to the [Event catalog](/reference/events/catalog). Typed `payload` and `data` field schemas are defined per event type, not here; the product API and dashboard catalog carry them. For how the one trail works, see the [Audit events](/concepts/audit) concept. To query and reconstruct events, see [Audit events](/operate/audit). | Contract | Schema | Surfaces | | --------------------------------- | ----------------------------------- | ------------------------------------------- | | Audit v1 | Full envelope + typed `payload` | Query, stream, export, ingest | | Webhooks | `dome.webhook.v1` envelope + `data` | Signed HTTP delivery | | OpenTelemetry / product telemetry | Separate models | Observability only; not compliance evidence | ## Audit v1 [#audit-v1] Audit v1 is the public envelope and service version. Its current event registry is the schema-v4 catalog. Every query, stream, export, and ingest record uses this envelope and catalog. ### Envelope [#envelope] Every audit event uses this envelope. Envelope fields are filterable without inspecting `payload`. The shape is identical across CLI, MCP, SDK, dashboard, stream, query, and export. A denied `tool.call`, with the optional blocks populated: ```json { "event_id": "3f9a1c74-8e2b-4d51-9f0a-7c6b2e5d8a13", "event_type": "tool.call", "event_class": "governing", "stage": "completed", "result": "denied", "denial": { "reason": "policy_denied", "detail": "no rule grants tools.invoke on this connection", "required_permission": "tools.invoke", "deciding_bundle_id": "…", "default_deny": true }, "occurred_at": "2026-08-19T14:02:11.442Z", "accepted_at": "2026-08-19T14:02:11.518Z", "scope": { "kind": "workspace", "organization_id": "…", "tenant_id": "…", "workspace_id": "…", "agent_id": "…" }, "actor": { "kind": "agent", "id": "…", "display": "checkout-worker", "auth_method": "agent" }, "identity_chain": { "hops": [ { "kind": "agent", "id": "…" }, { "kind": "end_user", "id": "u_8842", "verification_method": "oidc", "roles": ["support"] } ] }, "primary_resource": { "kind": "tool_connection", "id": "…", "name": "prod-postgres" }, "related_resources": [{ "kind": "tool", "id": "…", "name": "database-query" }], "request_surface": { "surface": "gateway_mcp", "source_ip": "203.0.113.42", "source_ip_class": "public" }, "correlation": { "trace_id": "0af7651916cd43dd8448eb211c80319c", "activity_id": "case-12345", "activity_trust": "caller_asserted" }, "operation_id": "…", "parent_event_id": "…", "payload": { "@type": "type.googleapis.com/dome.audit.v1.ToolCallV1", "toolName": "database-query" }, "data_handling": { "redacted": true } } ``` | Field | Type | Description | | ------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------- | | `event_id` | UUID | Globally unique event identifier | | `event_type` | string | Concrete operation (for example `tool.call`) | | `event_class` | enum | `governing`, `state_change`, `security`, `audit_access` | | `stage` | enum | Operation phase: `attempted` or `completed` | | `result` | enum | Operation verdict: `allowed` or `denied` | | `denial` | object | Shared refusal detail: `reason`, `detail`, `required_permission`, deciding rule/bundle, `default_deny`, and bounded `context` | | `error` | object | Handling or dispatch failure, independent of `result` | | `occurred_at` | timestamp | When the event happened at the producer | | `accepted_at` | timestamp | When the audit pipeline durably accepted it | | `scope` | object | `organization_id`, `tenant_id`, `workspace_id`, `agent_id` | | `actor` | object | `kind`, `id`, `display`, `email`, plus [caller authentication context](#caller-authentication-context) | | `identity_chain` | object | `hops[]` of delegation; act-as hops carry [end-user attributes](#act-as-end-user-attributes) | | `primary_resource` | object | `kind` + `id` of the resource the event is about | | `related_resources` | object\[] | Additional resources referenced by the event | | `request_surface` | object | Origin surface and [network context](#network-and-transport-context); unset on many runtime authorization decisions | | `correlation` | object | `trace_id`, `activity_id`, `activity_trust`, `idempotency_key` — refer to [Correlation](#correlation) | | `operation_id` | UUID | Stable ID for a multi-event operation | | `parent_event_id` | UUID | The event that caused this one | | `payload` | object | Event-specific typed payload (`dome.audit.v1.V1`) | | `data_handling` | object | Flags: `omitted`, `summarized`, `truncated`, `redacted`, `hashed`, `encrypted` | The fields above are the complete customer envelope. Internal pipeline metadata is not returned. ### Enum rendering [#enum-rendering] Enum fields (`event_class`, `result`, `actor.kind`, `scope.kind`, `primary_resource.kind`, `request_surface.surface`) render in one of two forms. Filters use the same form the surface returns. | Surface | Enum form | | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | CLI (table and `--format json`), MCP tool results, dashboard, exports (`json`, `jsonl`, `csv`, `ocsf`, `cef`) | Short tokens: `governing`, `denied`, `gateway_mcp`, `rule_bundle` | | gRPC / Connect API and generated SDK clients | Full constants: `EVENT_CLASS_GOVERNING`, `RESULT_DENIED`, `INITIATOR_SURFACE_GATEWAY_MCP` | A short token is the constant with its type prefix stripped and lowercased. CLI flags and MCP arguments take short tokens. API request fields take full constants or their integer values. ### Network and transport context [#network-and-transport-context] Configuration events carry network origin under `request_surface`. | Field | Type | Description | | ----------------- | ------ | ------------------------------------------------------------------------------------- | | `source_ip` | string | Caller IP from the inbound connection, resolved through the trusted-hops boundary | | `user_agent` | string | Raw `User-Agent` header, capped at 512 bytes (`data_handling.truncated` when clipped) | | `http_method` | string | HTTP verb (`GET`, `POST`, …) for HTTP-surfaced requests | | `source_ip_class` | string | Derived zone: `private`, `vpc`, `public`, `unknown` | OCSF exports map `source_ip` to `src_endpoint.ip`; `user_agent` and `http_method` are carried under `unmapped`. CEF exports map them to `src`, `requestClientApplication`, and `requestMethod`. `source_ip` is the **rightmost trusted** entry of `X-Forwarded-For + [connecting peer]`. `DOME_TRUSTED_HOPS` on the api-server and gateway is the number of appending reverse-proxy hops in front of Dome. | Value | Topology | Trusted entry | | ------------------------- | ---------------------------------------- | ----------------------------- | | `0` | Dome exposed directly to clients | Connecting peer (XFF ignored) | | `1` *(default)* | Single fronting ALB in XFF `append` mode | Entry the ALB appended | | `2` | `CDN → ALB → Dome` | Entry the inner hop appended | | `N` | N appending hops | Nth from the right | > **Warning**: Set `DOME_TRUSTED_HOPS` to match your actual edge. Over-trusting lets a caller forge `source_ip` by injecting headers; under-trusting records the proxy IP instead of the client. Spoofed values reach audit events, OCSF/CEF exports, the dashboard Authority card, and the credential-provision rate-limiter key. The resolver clamps to the leftmost entry when fewer hops are present — it never reads past the boundary. The default `1` assumes one AWS ALB in XFF `append` mode. The ALB appends the connecting client on the right without stripping a caller-supplied `X-Forwarded-For`, so the rightmost entry is the only edge-guaranteed value. ### Caller authentication context [#caller-authentication-context] `actor` includes how the immediate principal authenticated. | Field | Type | Description | | -------------------- | ------ | ------------------------------------------------------------------------------------ | | `auth_method` | string | `session`, `api_key`, `agent`, `gateway`, `admin_token` | | `session_id` | string | Browser session ID when session-backed | | `api_key_id` | string | Platform or agent API key ID when key-backed | | `api_key_scope_kind` | string | `workspace`, `tenant`, `org`, or `platform` | | `api_key_scope_id` | string | ID of the key's scope | | `assurance_level` | string | Authentication assurance level (for example `aal1`, `aal2`) when surfaced by the IdP | ### Act-as end-user attributes [#act-as-end-user-attributes] When an agent acts on behalf of an end user, the corresponding `identity_chain` hop carries these fields. Producers cap each list at 32 entries. | Field | Type | Description | | --------------------- | --------------------- | ------------------------------------- | | `roles` | string\[] | End-user roles supplied by the caller | | `groups` | string\[] | End-user groups | | `claims` | `map` | Additional verified claims | | `verification_method` | string | `oidc`, `hmac`, or `none` | ### Correlation [#correlation] Three IDs stitch events together, each at a different width. Pick the one that matches the question you are asking. | Field | Scope | | ------------------------- | ---------------------------------------------------- | | `operation_id` | One operation's `attempted` → `completed` phase pair | | `correlation.trace_id` | One HTTP request cascade | | `correlation.activity_id` | One session, LLM turn, or scripted run across planes | An activity chain is the set of audit events that share one `activity_id` within a workspace. Chains are computed at read time; there is no stored chain object. `correlation.activity_trust` records where that `activity_id` came from: | Value | Meaning | | ----------------- | -------------------------------------------------- | | `server_owned` | Dome set the id. A caller cannot forge this label. | | `caller_asserted` | The id arrived on the `X-Dome-Activity-Id` header. | | `unspecified` | No `activity_id` on this event. | `activity_id` can be set by a CLI run (`--activity` or `DOME_ACTIVITY_ID`), an SDK session, an agent request header, or Dome for browser and assistant threads. Chain reads return only the active workspace's slice, so human-meaningful IDs (`case-12345`) are safe to use. `activity_trust` is provenance metadata, not a grouping key. ### Decision provenance [#decision-provenance] Runtime operation and authorization payloads stamp policy snapshot fields when a bundle was loaded. Use the event catalog to confirm the fields available on a specific type. | Field | Type | Description | | ------------------------------ | --------- | ---------------------------------------------------------------------------------------------------- | | `payload.bundle_etag` | string | Content hash of the effective policy at decision time | | `payload.contributing_bundles` | object\[] | Bundles merged into the effective policy (`bundle_id`, `name`, `scope_kind`, `scope_id`, `sequence`) | | `payload.rule_id` | string | File identifier of the matched rule | Events with no loaded bundle omit these fields. The dashboard decision explainer deep-links contributing bundles to `/rules/bundles?scope=&scopeId=`; the same fields are available on `dome audit get`, `dome_audit_get_event`, and `QueryEvents`. ### Payload filters [#payload-filters] Payload filters match fields inside the event-specific payload (for example `tool.call:toolName=database-query`). Each filter is scoped to one `event_type` and one catalog-marked field. Non-filterable fields return a validation error. | Operator | Behavior | | -------- | ----------------------------------------------------------------------------------- | | `equals` | Default when a value is provided. Payload field matches any of the supplied values. | | `exists` | Payload field is present and non-empty. | Stream and query share this vocabulary. ### Ingest [#ingest] Producers write events to the trail on these routes, using the same envelope readers get back. | Path | Description | | --------------------------- | ----------------------------- | | `POST /api/v1/audit/events` | gateway batch upload to Dome | | `POST /v1/audit/events` | Programmatic ingestion (SDKs) | Delivery semantics: at-least-once. ## Webhooks [#webhooks] Webhooks deliver a signed public projection of selected events for automation. Webhook event types are audit event types. The strings match Audit schema-v4 operation names byte for byte, so one product fact carries one name on both surfaces, and there is no separate webhook catalog to learn. Two things differ: * **Coverage.** The delivered set is a subset of the audit catalog. Types that exist only on the trail, including `model.call`, are never delivered, and `eventing.test` is the one webhook type with no audit twin. The [Event catalog](/reference/events/catalog) marks delivery per type. * **Body.** A webhook carries a slim envelope plus a public `data` projection. PII, credentials, raw tool payloads, and forensic fields are omitted. Operating limits and retry status handling are on [Webhooks](/concepts/audit/webhooks#operating-limits). ### Envelope [#envelope-1] Every delivery body uses this envelope, whatever the event type. A suspended agent, delivered to a subscription: ```json { "schema": "dome.webhook.v1", "event_id": "0b9c1e2a-6f4d-4c3b-9a1e-2f5d7c8b0a11", "event_type": "agent.suspend", "event_version": 1, "occurred_at": "2026-07-14T10:30:00.000Z", "stage": "completed", "result": "allowed", "scope": { "kind": "workspace", "tenant_id": "…", "workspace_id": "…" }, "actor": { "kind": "platform_user", "id": "…" }, "resource": { "type": "agent", "id": "…" }, "correlation": { "trace_id": "0af7651916cd43dd8448eb211c80319c", "operation_id": "…" }, "data": { "agent_id": "…", "status": "suspended", "agent_name": "checkout-worker", "reason": "policy_violation" } } ``` | Field | Description | | --------------- | ----------------------------------------------------------------------- | | `schema` | Always `dome.webhook.v1` | | `event_id` | Delivery source event ID (random UUID; order by `occurred_at`) | | `event_type` | Audit schema-v4 operation name | | `event_version` | Public contract version for `data` | | `occurred_at` | Event time | | `stage` | `attempted` or `completed` | | `result` | `allowed` or `denied` when the operation has a verdict | | `error` | Present when Dome accepted the operation and then failed to complete it | | `denial` | Present exactly when `result` is `denied` | | `scope` | Scope object | | `actor` | `kind` + `id` only (no email or display name) | | `resource` | `type` + `id` | | `correlation` | Correlation object | | `data` | Typed public payload (no PII, credentials, or raw tool payloads) | ### Delivery headers [#delivery-headers] The lowercase `webhook-*` headers are the [Standard Webhooks](https://www.standardwebhooks.com/) signature set, so any off-the-shelf verifier works; check the signature before trusting the body. Providers that authenticate with a credential in the body receive no `webhook-signature`. The `Dome-*` headers let you route and dedupe without parsing JSON. | Header | Description | | ---------------------- | ----------------------------------------------------------------------------------------- | | `webhook-id` | Unique ID of this delivery. Stable across retry attempts; a replay gets a fresh one. | | `webhook-timestamp` | Unix seconds when the body was signed. | | `webhook-signature` | Space-delimited `v1,` tokens over `..`. | | `Dome-Event-Id` | Source event ID; dedupe key (stable across retries and replays). | | `Dome-Event-Type` | Event type. | | `Dome-Event-Version` | Contract version of the payload. | | `Dome-Subscription-Id` | Subscription that produced the delivery. | | `Dome-Attempt` | 1-based attempt counter. | ### Bundles [#bundles] Subscriptions accept any combination of the types the [Event catalog](/reference/events/catalog) marks as delivered. Bundles are presets over that list. A bundle selects event types, so it cannot mean "any denial"; add `result=denied` when that is the question. | Bundle | Types | | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | agent lifecycle | `agent.register`, `agent.update`, `agent.enroll`, `agent.activate`, `agent.suspend`, `agent.reactivate`, `agent.revoke`, `agent.delete` | | Governance changes | `bundle.deploy`, `bundle.rollback`, `bundle.delete`, `workspace.config.update`, `workspace.freshnesswindow.update`, `workspace.membership.set`, `workspace.membership.unset`, `connection.create`, `connection.update`, `connection.delete`, `gateway.create`, `gateway.update`, `gateway.delete`, `gateway.member.create`, `gateway.member.delete`, `tool.status.set`, `tool.catalog.sync`, `verification.provider.create`, `verification.provider.update`, `verification.provider.delete` | | Security signals | `guard.filter.evaluate`, `guard.validator.evaluate`, `agent.key.create`, `agent.key.rotate`, `agent.key.revoke`, `apikey.create`, `apikey.revoke` | | Incidents | `agent.suspend`, `agent.revoke`, `audit.export.run`, `siemstream.status.set` | ## Next steps [#next-steps] * [Event catalog](/reference/events/catalog) for every event type, its class, and webhook delivery * [Audit events](/concepts/audit) concept for how the one trail works * [Webhooks](/concepts/audit/webhooks) concept for the signed delivery model, limits, and retries * [Audit events](/operate/audit) to query events and follow activity chains * [Export Data](/manage/export) for forwarders and ingest # Pools (/reference/resources/model-pools) This page lists routing strategies, failover limits, resolution order, and the `match_when` predicate dialect. Refer to [Pools](/concepts/resources/model-pools) concept for how routing works. Configure on [Pools](/connect/pools). ## Routing strategies [#routing-strategies] | Strategy | Primary selection | Member fields it uses | | ---------------------- | ------------------------------------------------------------------------------------------------------ | --------------------- | | `priority_weighted` | Chooses by weight from the lowest priority tier | Priority and weight | | `round_robin` | Rotates through all members in order | Neither | | `least_loaded` | Chooses the member with the fewest in-flight requests and breaks ties randomly | Neither | | `most_quota_remaining` | Chooses the member with the most remaining per-model cost-quota headroom; unmetered members serve last | Neither | `strategy_scope`: `workspace` shares round-robin, least-loaded, and `most_quota_remaining` tiebreak state across agents; `caller` tracks per agent. Priority-weighted routing ignores `strategy_scope`. For `most_quota_remaining`, scope only affects the tiebreak rotation — primary ordering always follows remaining headroom. `most_quota_remaining` reads the same cost-quota signal that gates routing. Exhausted members are locked out first by the quota barrier; this strategy only orders the survivors. With no per-model quotas configured, every member ties and the strategy degrades to round-robin. Meter every member for the ordering to have effect. ## Failover [#failover] | Value | Runtime behavior | | ----------------- | ------------------------------------------------ | | No limit or `all` | Try every eligible member until one succeeds | | `0` | Try only the primary | | `N` | Try the primary and up to `N` additional members | Authorization and streaming failover rules are on [Pools](/connect/pools#failover). ## Automatic pool selection [#automatic-pool-selection] Use a `match_when` rule to select a pool from request attributes when the request does not name a pool directly. This selects the pool; its routing strategy and failover settings then select a member inside that pool. Dome resolves a request's `model` value in this order: 1. A pool with that exact name 2. A direct model connection with that exact name 3. A direct connection whose upstream model identifier matches 4. The first pool in the configured order whose `match_when` predicate matches 5. The workspace default pool Exact names beat conditional routes. When more than one `match_when` rule matches, the first pool in the configured pool order wins. Reorder pools to change that precedence. ### Match rule syntax [#match-rule-syntax] Enter one JSON predicate. By default, every condition in the object must match. An empty rule does not select the pool automatically. ```json title="Route long prompts to this pool" { "prompt_tokens": { "gt": 100000 } } ``` ```json title="Route requests to a versioned endpoint" { "endpoint": { "prefix": "/v1/enterprise/" } } ``` `match_when` accepts these request attributes: | Input | Supported matching | | ----------------------------------------------------- | ------------------------------------------------------------------------ | | `prompt_tokens` | Estimated prompt size, characters ÷ 4, with numeric `gt`, `lt`, and `eq` | | `requested_max_tokens`, `tool_count` | Numeric `gt`, `lt`, and `eq` | | `endpoint` and `header.` | Equality, `in`, `prefix`, `suffix`, and RE2 `regex` | | `principal.metadata.` | String or numeric matching | | `principal.act_as.sub`, `.email`, and `.claims.` | String or numeric matching | | `principal.act_as.roles` and `.groups` | `contains`, `containsAny`, and `containsAll` | | Nested predicates | `any`, `all`, and `not` | Use `any`, `all`, or `not` to combine conditions differently: ```json title="Route requests that meet either condition" { "any": [ { "prompt_tokens": { "gt": 100000 } }, { "endpoint": { "prefix": "/v1/batch/" } } ] } ``` An unknown condition, missing value, or unverified act-as attribute never matches. Automatic pool selection does not replace authorization. ## Next steps [#next-steps] Create pools and attach them to gateways: * [Pools](/concepts/resources/model-pools) concept for members, routing, and reachability * [Pools](/connect/pools) to create pools, manage members, and attach gateways * [Models](/reference/resources/models) reference for provider and credential catalogs * [LLM gateway](/concepts/gateways/llm-gateway) concept for dispatch on the wire # Models (/reference/resources/models) This page lists supported providers, model-rate behavior, authentication pairings, and filter-window bounds. Refer to [Models](/concepts/resources/models) concept for how connections work. Configure on [Models](/connect/models). ## Providers [#providers] Provider IDs fall into three groups. You cannot change the provider after adding the model. * **Native providers.** Dome translates between the gateway request and the provider's native wire format. `openai`, `anthropic`, `google`, `azure_openai`, and `bedrock`. * **Hosted OpenAI-compatible providers.** Dome sends requests through the provider's OpenAI-compatible API. `mistral`, `groq`, `together`, `fireworks`, `deepseek`, `xai`, `perplexity`, `cohere`, `openrouter`, `cerebras`, `nvidia`, `deepinfra`, `sambanova`, `ai21`, `moonshot`, and `databricks`. * **Bring your own endpoint.** Use `openai_compatible` for an OpenAI-shaped endpoint such as vLLM or Ollama. Use `custom` when Dome should forward provider-specific requests without translating them. Dome supplies a base URL for hosted providers that have a default. For Google, Azure OpenAI, Bedrock, Databricks, `openai_compatible`, and `custom`, you must provide an endpoint or the provider-specific details needed to locate the model. These details can include an Azure deployment, a Google project and location, or a Bedrock region. Hosted OpenAI-compatible providers share the OpenAI chat and embeddings wire shape. Native and bring-your-own adapters differ: ### Provider capabilities [#provider-capabilities] | Provider | Embeddings | Distinct behavior | | ------------------- | ---------- | --------------------------------------------------------------------------------------------------- | | `openai` | Yes | `provider_config.base_url` defaults to `https://api.openai.com` | | `anthropic` | No | Only adapter with upstream `count_tokens` | | `google` | Yes | Gemini `contents[]/parts[]`; Vertex `:predict` for embeddings. Workload identity on GCP | | `bedrock` | No | AWS Converse / ConverseStream. SigV4 via static keys or the default credential chain | | `azure_openai` | Yes | Auth header is `api-key`, not `Authorization`. Requires `endpoint`, `deployment`, and `api_version` | | `openai_compatible` | Yes | Auth is optional | | `custom` | N/A | Opaque passthrough. See [Custom passthrough](#custom-passthrough) | An unsupported gateway operation for the resolved provider returns HTTP `501` with a structured error. ## Model rates [#model-rates] Model rates are expressed in micro-USD per one million tokens and may differ for input, cache-read, cache-write, and output tokens. Reasoning tokens use the output rate. Rate resolution has two layers: 1. The organization's rate or model association, when one covers the model and time. 2. Dome's rate book, including its fallback when no specific row matches. Within a layer, lower sort order wins, then the longer model match. Rate windows are half-open: a row applies from its start time up to, but not including, its end time. Historical cost reads resolve the window covering the usage time. Live quota enforcement uses the rate card effective now. Provider cost is always an estimate of the organization's upstream bill, not a Dome charge. When the provider supplies token counts, Dome prices those counts. When no counts are available, Dome estimates tokens as: ```text ceil((request bytes + response bytes) / bytes per token) ``` The active byte-per-token assumptions are shown by [`dome models rates`](/cli/connect/models#model-rates). ### Custom passthrough [#custom-passthrough] `POST /gateways//v1/passthrough/:name` forwards the request body byte-exact to a `custom`-provider connection. Identity, tenant match, and Cedar (`llm:passthrough`) still apply. The canonical content filter is bypassed (no canonical shape to filter against). | Constraint | Behavior | | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Body limit | 1 MiB | | Caller headers | Forwarded only when the name matches `provider_config.header_passthrough_allow` (glob list on the connection) | | Dropped headers | `Authorization`, `Cookie`, and `Proxy-Authorization` are dropped unconditionally so a caller cannot smuggle credentials past the connection's configured auth | Configure `header_passthrough_allow` (and related `custom` keys such as `endpoint` and `request_shape_doc_url`) on the model connection. See [Create LLM model connection](/api/tag/models/create-llm-model-connection). ## Credentials [#credentials] | Authentication method | Credential type | What Dome sends | | --------------------- | --------------- | ------------------------------------------------------- | | `none` | `none` | No provider credential | | `api-key` | `shared` | One workspace-managed API key for every call | | `api-key` | `per-user` | An API key linked to the verified end user | | `oauth` | `shared` | One administrator-authorized OAuth grant for every call | | `oauth` | `per-user` | An OAuth grant linked to the verified end user | When the provider requires no authentication, set both to `none`. When the provider uses an API key or OAuth, the credential type must be `shared` or `per-user`. If you omit both settings, Dome uses `api-key` with `shared`. Per-user provisioning and workload identity are on [Models](/connect/models#credentials). ## Filter window [#filter-window] A model can buffer at most 1 MiB or 4,096 tokens of streamed output before outbound guards run. Dome uses the largest window configured on the workspace, model, or request. A value of `0` uses the workspace setting. Layer sources and effective-max rules are on the [Guards](/reference/controls/guards#streaming-window) reference. ## Next steps [#next-steps] Add connections, or jump to pools when you need routing: * [Models](/concepts/resources/models) concept for connections, attributes, and direct vs pool * [Models](/connect/models) to add models, rotate credentials, and attach gateways * [Pools](/reference/resources/model-pools) reference for routing across connections * [LLM gateway](/concepts/gateways/llm-gateway) concept for the model ingress # Tools (/reference/resources/tools) This page lists upstream authentication pairings, egress header sources, discovered-tool statuses, and protocol constraints. Refer to [Tools](/concepts/resources/tools) concept for how connections work. Configure on [Tools](/connect/tools). ## Upstream authentication [#upstream-authentication] | Auth method | When the upstream | | ----------- | ---------------------------------------- | | `none` | Requires no credential | | `api-key` | Accepts a static API key or bearer token | | `oauth` | Supports OAuth 2.0 or 2.1 | | Credential type | What the gateway sends | | --------------- | ----------------------------------------------- | | `none` | No credential | | `shared` | One workspace-managed credential for every call | | `per-user` | One credential per verified act-as subject | Valid pairings: `none` with `none` only; `api-key` and `oauth` each with `shared` or `per-user`. Defaults when credential type is omitted: `none`→`none`, `api-key`→`shared`, `oauth`→`per-user`. OAuth requires `streamable-http`. ## Egress headers [#egress-headers] | Source | Value | | --------------- | --------------------------------------------------- | | Literal | Fixed string on every outbound request | | Stored secret | Injected at egress | | Act-as identity | Verified end-user identity from the inbound request | Only `streamable-http` tools can carry egress headers. An act-as header (`--header-actas`) is the forwarding opt-in: it sends the assertion the workspace Act-As floor already admitted, including `none` when that floor allows it. The gateway does not re-rank methods at egress. The call fails closed when no raw assertion is available, including device-bound and interactive session identity. Act-as headers are not valid with OAuth upstream auth. Configure headers on [Tools](/connect/tools#egress-headers). ## Discovered tools [#discovered-tools] | Status | Behavior | | ------------ | ---------------------------------------------- | | `active` | Discoverable and callable when rules allow | | `deprecated` | Callable, with a catalog warning | | `blocked` | Hidden from discovery and denied on invocation | Blocking denies the operation even if another rule would permit it. Status persists when the gateway observes the operation again. Only a restore returns it to `active`. ## Protocols [#protocols] | Protocol | Use case | Notes | | ----------------- | ------------------ | --------------------------------- | | `streamable-http` | Remote MCP servers | Supports OAuth and egress headers | | `stdio` | Local processes | No HTTP headers; no OAuth | Also refer to [Tools gateway](/concepts/gateways/tools-gateway#egress-protocols) concept for REST catalog egress. ## Next steps [#next-steps] Add connections and attach them to gateways: * [Tools](/concepts/resources/tools) concept for credentials, catalogs, and reachability * [Tools](/connect/tools) to add tools, manage catalogs, and attach gateways * [Tools gateway](/concepts/gateways/tools-gateway) concept for the MCP ingress # API (/reference/surfaces/api) # CLI (/reference/surfaces/cli) # MCP (/reference/surfaces/mcp) # SDK (/reference/surfaces/sdk) # Agents (/reference/mcp/agents)

{agent}

Refer to [Agents](/build/agents) for how to register agents, issue credentials, and manage lifecycle. All tools require workspace context. ## Agents [#agents] ### dome_agents_list [#dome_agents_list] List registered agents. Returns agent ID, name, and status. | Parameter | Type | Required | Description | | -------------- | ------ | -------- | ----------------------------------------------------------------- | | `status` | string | No | filter by status: `active`, `suspended`, `provisioned`, `revoked` | | `workspace_id` | string | No | filter by workspace ID (defaults to active workspace) | | `limit` | number | No | Maximum results (default: 100) | | `offset` | number | No | Pagination offset | > **Note**: Requires `agents.view`. ```json title="Example tool call" { "name": "dome_agents_list", "arguments": { "status": "active", "limit": 25 } } ``` ### dome_agents_get [#dome_agents_get] Get detailed information about a specific agent by ID. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------ | | `agent_id` | string | Yes | agent ID (UUID) | | `gateway_id` | string | No | gateway ID used to return complete endpoints; required when the agent can access more than one gateway | > **Note**: Requires `agents.view`. ### dome_agents_register [#dome_agents_register] Register a new AI agent on the platform. After registration, create an API key with `dome_agents_create_key`. | Parameter | Type | Required | Description | | ---------------------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------- | | `name` | string | Yes | agent name (unique within workspace) | | `parent_id` | string | No | Parent agent ID for hierarchical agents | | `workspace_id` | string | No | Workspace to register in (defaults to active workspace) | | `metadata` | object | No | Key-value metadata | | `token_ttl` | string | No | Access-token lifetime for this agent, such as `15m` (`1m`–`24h`). Omit to use the `10m` default | | `allowed_pool_names` | array | No | LLM pools the agent may route to. Emits a `permit` against `Dome::LLMModel` matched via `resource.pool == ""` | | `allowed_direct_model_names` | array | No | LLM model connections the agent may invoke directly (advanced). Emits a `permit` against `Dome::LLMModel` | | `allowed_tools` | array | No | MCP tools the agent may call, each as `connection/tool`. Emits `mcp:call` and `mcp:discover` permits against `Dome::MCPTool` | | `allowed_gateway_ids` | array | No | gateway IDs the agent may reach. Emits per-gateway permit rules | | `actas_allowed_groups` | array | No | Groups the verified act-as identity may belong to. Emits a `forbid` unless the verified group matches | | `actas_allowed_emails` | array | No | Emails the agent may act on behalf of. Emits a `forbid` unless the verified email matches | | `actas_allowed_subjects` | array | No | Subjects the agent may act on behalf of. Emits a `forbid` unless the verified subject matches | | `actas_method` | string | No | Act-as verification method: `none`, `oidc`, `hmac` | | `actas_required` | bool | No | Require act-as header on every request | | `actas_provider_id` | string | No | Workspace verification provider ID | | `actas_oidc_url` | string | No | Inline OIDC discovery URL | | `actas_hmac_secret` | string | No | Inline HMAC shared secret | | `actas_config_name` | string | No | Label for agent-specific verification config | | `interactive_access` | bool | No | Let allow-listed people sign in through Dome and ride this agent from an MCP client | > **Note**: Requires `agents.register`. If the request includes a pool, model, tool, gateway, or act-as access setting, it also requires `rules.deploy` because registration generates the agent's rule bundle. ```json title="Example tool call" { "name": "dome_agents_register", "arguments": { "name": "code-reviewer", "token_ttl": "15m", "metadata": { "team": "platform", "owner": "infra@example.com" } } } ``` ### dome_agents_update [#dome_agents_update] Update an existing agent's metadata, token lifetime, allowed resources, or act-as verification config. | Parameter | Type | Required | Description | | ---------------------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------- | | `agent_id` | string | Yes | agent ID or name | | `metadata` | object | No | Updated key-value metadata | | `token_ttl` | string | No | Set the agent's access-token lifetime, such as `15m` (`1m`–`24h`). An empty string resets to the `10m` default | | `allowed_pool_names` | array | No | Replace the agent's allowed LLM pool list | | `allowed_direct_model_names` | array | No | Replace the agent's allowed direct-model list | | `allowed_tools` | array | No | Replace the agent's allowed MCP tool list, each as `connection/tool` | | `allowed_gateway_ids` | array | No | Replace the agent's allowed gateway ID list | | `actas_allowed_groups` | array | No | Replace the agent's act-as allowed-groups list | | `actas_allowed_emails` | array | No | Replace the agent's act-as allowed-emails list | | `actas_allowed_subjects` | array | No | Replace the agent's act-as allowed-subjects list | | `actas_method` | string | No | Act-as verification method: `none`, `oidc`, `hmac` | | `actas_required` | bool | No | Require act-as header on every request | | `actas_provider_id` | string | No | Workspace verification provider ID | | `actas_oidc_url` | string | No | Inline OIDC discovery URL | | `actas_hmac_secret` | string | No | Inline HMAC shared secret | | `actas_config_name` | string | No | Label for agent-specific verification config | | `interactive_access` | bool | No | Enable or disable interactive MCP access | > **Note**: Requires `agents.register`. Changing any pool, model, tool, or `actas_allowed_*` field regenerates the agent's rule bundle and additionally requires `rules.deploy`. Interactive access requires at least one exact `actas_allowed_emails` or `actas_allowed_subjects` entry. Groups cannot match an interactive user. Their traffic spends the agent's quotas, and interactive access cannot be combined with device binding. ## Interactive grants [#interactive-grants] ### dome_agents_interactive_grants_list [#dome_agents_interactive_grants_list] List people who authorized an MCP client to ride an agent. A platform user sees their own grants by default. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------------------------------------------------------- | | `all_users` | bool | No | List every grant in the active workspace; requires `agents.view` | | `agent_id` | string | No | filter by agent name or ID; implies `all_users` | API-key credentials have no personal interactive grants. Use `all_users=true` with a workspace context and `agents.view`. ### dome_agents_interactive_grants_revoke [#dome_agents_interactive_grants_revoke] Revoke one grant and all refresh tokens issued beneath it. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ------------------------------------------------------------ | | `grant_id` | string | Yes | Grant UUID returned by `dome_agents_interactive_grants_list` | A person may revoke their own grant. Revoking someone else's grant requires `agentkeys.manage`. ## Lifecycle [#lifecycle] ### dome_agents_suspend [#dome_agents_suspend] Suspend an active agent, preventing it from making requests. Optionally cascade to child agents. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | -------------------------------------------- | | `agent_id` | string | Yes | agent ID (UUID) | | `reason` | string | No | Reason for suspension | | `cascade` | bool | No | Also suspend child agents (default: `false`) | > **Note**: Requires `agents.suspend`. ```json title="Example tool call" { "name": "dome_agents_suspend", "arguments": { "agent_id": "code-reviewer", "reason": "Investigating anomalous behavior", "cascade": true } } ``` ### dome_agents_reactivate [#dome_agents_reactivate] Reactivate a previously suspended agent. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | --------------- | | `agent_id` | string | Yes | agent ID (UUID) | > **Note**: Requires `agents.suspend`. ### dome_agents_revoke [#dome_agents_revoke] Permanently revoke an agent. This cannot be undone. Marked destructive. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | --------------------- | | `agent_id` | string | Yes | agent ID (UUID) | | `reason` | string | No | Reason for revocation | > **Note**: Requires `agents.revoke`. > **Warning**: Revocation is permanent and cannot be undone. ### dome_agents_delete [#dome_agents_delete] Permanently delete a revoked agent and all its data. Agent must already be in the revoked state. Marked destructive. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ----------------------------- | | `agent_id` | string | Yes | agent ID (UUID) | | `reason` | string | No | Reason for deletion | | `cascade` | bool | No | Also delete descendant agents | > **Note**: Requires `agents.delete`. > **Warning**: Hard-delete removes all agent data irreversibly. The agent must be revoked first. ## Allowed tools [#allowed-tools] ### dome_tools_list [#dome_tools_list] List registered agents and the tools they reach in the active workspace. Only returns agents in `active` or `provisioned` status. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | > **Note**: Requires `agents.view`. ## API keys [#api-keys] ### dome_agents_create_key [#dome_agents_create_key] Create a new API key for an agent. Returns the token, selected gateway ID, and complete gateway endpoints once — save the token immediately. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------ | | `agent` | string | Yes | agent name | | `name` | string | Yes | Key name (unique per agent) | | `gateway_id` | string | No | gateway ID used to return complete endpoints; required when the agent can access more than one gateway | > **Note**: Requires `agentkeys.manage`. ```json title="Example tool call" { "name": "dome_agents_create_key", "arguments": { "agent": "code-reviewer", "name": "production-v1", "gateway_id": "{{GATEWAY_ID}}" } } ``` > **Note**: Store the returned key secret securely. It cannot be retrieved after creation — only rotated or revoked. ### dome_agents_list_keys [#dome_agents_list_keys] List active API keys for an agent. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `agent` | string | Yes | agent name | > **Note**: Requires `agents.view`. ### dome_agents_rotate_key [#dome_agents_rotate_key] Rotate an agent's API key — revokes the old secret and issues a new one with the same name. Returns the new token once. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------ | | `agent` | string | Yes | agent name | | `key_name` | string | Yes | Name of the key to rotate | | `gateway_id` | string | No | gateway ID used to return complete endpoints; required when the agent can access more than one gateway | > **Note**: Requires `agentkeys.manage`. ### dome_agents_revoke_key [#dome_agents_revoke_key] Revoke an agent's API key. The key is no longer usable for authentication. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ------------------------- | | `agent` | string | Yes | agent name | | `key_name` | string | Yes | Name of the key to revoke | > **Note**: Requires `agentkeys.manage`. ## Next steps [#next-steps] Full agent workflows live under Connect. Lifecycle and rules stay one hop away: * [Register Agents](/build/agents) * [Agent Lifecycle](/concepts/agents/agent-lifecycle) concept * [Rules](/reference/mcp/rules) # Audit (/reference/mcp/audit)

{auditEvent}

Refer to [Audit events](/operate/audit) for how to query and export the trail. Refer to [Audit events](/concepts/audit) concept for how the trail is shaped. Tool results render enum fields as short tokens (`governing`, `denied`, `gateway_mcp`), and filter arguments accept those same tokens. Refer to [Enum rendering](/reference/events/contracts#enum-rendering) reference. > **Note**: Audit reads are scoped to the active workspace. The server checks the workspace-level `audit.view` permission, so a workspace member can read their own workspace's audit even without a tenant role. Tenant- or org-scoped API keys reading without a workspace context fall back to the tenant-level `audit.view`. ## Events [#events] ### dome_audit_query [#dome_audit_query] Query audit events with optional filters. Returns events with type, agent, timestamp, and data. | Parameter | Type | Required | Description | | ----------------------- | ------- | -------- | ---------------------------------------------------------------------------- | | `agent_id` | string | No | filter by agent ID | | `type` / `types` | string | No | Event types, comma-separated | | `classes` | string | No | `governing`, `state_change`, `security`, `audit_access` (comma-separated) | | `stages` | string | No | `attempted`, `completed` (comma-separated) | | `results` | string | No | `allowed`, `denied` (comma-separated) | | `deny_reasons` | string | No | Shared denial reasons, comma-separated | | `has_error` | boolean | No | Error-presence filter; omit for no filter | | `act_as_sub` | string | No | Governed calls made for one verified end-user subject | | `agent_ids` | string | No | Multiple agent IDs, comma-separated | | `primary_resource_id` | string | No | Primary resource ID | | `primary_resource_kind` | string | No | Primary resource kind | | `trace_id` | string | No | Every event for one request | | `activity_id` | string | No | Every event in one [activity chain](/reference/events/contracts#correlation) | | `operation_id` | string | No | Multi-event operation ID | | `parent_event_id` | string | No | Children of a given event | | `actor_kind` | string | No | Actor kind | | `actor_id` | string | No | Actor ID | | `producer_service` | string | No | Producer service | | `producer_gateway_id` | string | No | Producer gateway ID | | `request_surface` | string | No | Origin surface | | `caller_surface` | string | No | Caller application surface | | `payload_filter` | string | No | `event.type:field=value`, semicolon-separated or JSON array | | `since` | string | No | Start time (RFC3339) | | `until` | string | No | End time (RFC3339) | | `limit` | number | No | Maximum results (default: 50) | | `page_token` | string | No | Cursor from a previous call | | `compact` | boolean | No | Bounded investigation rows without full payload (default: false) | > **Note**: Requires `audit.view`. ```json title="Example tool call" { "name": "dome_audit_query", "arguments": { "type": "agent.register,agent.suspend", "limit": 10, "since": "2025-01-01T00:00:00Z" } } ``` Returns events in reverse chronological order. Each event includes an ID, type, stage, result when the type has a verdict, shared denial detail on refusals, error detail when handling failed, timestamp, actor, and event-specific payload. ### dome_audit_get_event [#dome_audit_get_event] Get a single audit event by its ID. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | -------------- | | `event_id` | string | Yes | Audit event ID | > **Note**: Requires `audit.view`. ```json title="Example tool call" { "name": "dome_audit_get_event", "arguments": { "event_id": "evt_01HQXYZ..." } } ``` Returns the full event record including all metadata, the acting principal, and the complete event payload. ### dome_audit_chains [#dome_audit_chains] List activity chains, or pass `activity_id` to return that chain's events in order. A chain groups the audit events that share an activity ID in the active workspace. | Parameter | Type | Required | Description | | ----------------------------------------------- | -------------- | -------- | -------------------------------------------------------------- | | `activity_id` | string | No | Drill into one activity chain | | `type`, `types`, `classes`, `stages`, `results` | string | No | Restrict the chains listed to ones containing a matching event | | `agent_id`, `actor_kind`, `actor_id` | string | No | Restrict by identity | | `since`, `until` | string | No | RFC 3339 timestamp or duration window | | `limit`, `page_token` | number, string | No | Pagination | > **Note**: Requires `audit.view`. ### dome_audit_export [#dome_audit_export] Export audit events in a SIEM-friendly format for external processing or archival. Supports the same filters as `dome_audit_query`, plus a `format` selector. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | -------------------------------------------------------------- | | `agent_id` | string | No | filter by agent ID | | `type` | string | No | filter by event type (comma-separated for multiple) | | `since` | string | No | Start time (RFC3339) | | `until` | string | No | End time (RFC3339) | | `limit` | number | No | Maximum results (default: 1000) | | `format` | string | No | Output format: `jsonl` (default), `json`, `csv`, `ocsf`, `cef` | > **Note**: Requires `audit.export`. | Format | When to use | | ------- | ------------------------------------------------ | | `jsonl` | NDJSON, one event per line — log shippers, `jq`. | | `json` | Single pretty array — archival. | | `csv` | Comma-separated rows. | | `ocsf` | OCSF v1.1.0 JSON — Splunk, Sentinel, Chronicle. | | `cef` | Common Event Format — ArcSight, QRadar, syslog. | ```json title="Example tool call" { "name": "dome_audit_export", "arguments": { "since": "2025-01-01T00:00:00Z", "until": "2025-02-01T00:00:00Z", "limit": 5000, "format": "ocsf" } } ``` > **Note**: Export pages to exhaustion up to `limit` and refuses incomplete pages, repeated cursors, or more than 10,000 events. Unknown payload types stay in the artifact with an `@unresolved` marker. The same format set is available on `dome audit export --format`. ## Usage [#usage] ### dome_usage [#dome_usage] Show LLM token consumption and a per-class estimated cost for the active workspace over the last 24 hours. Use it when an assistant needs to summarize workspace spend, build a budget guardrail, or confirm token attribution. This tool takes no parameters — it always reports the active workspace over the last 24 hours. For dimensional breakdowns (per-agent, per-API-key, per-identity, per-model), read the [REST query surface](/operate/observe#token-usage-and-cost) directly. > **Note**: Requires `audit.view`. ```json title="Example tool call" { "name": "dome_usage", "arguments": {} } ``` Returns the workspace token summary as JSON: ```json { "llm_input_tokens": 412000, "llm_cache_read_tokens": 1820000, "llm_cache_write_tokens": 88000, "llm_output_tokens": 64000, "llm_reasoning_tokens": 12000, "llm_total_tokens": 2396000, "estimated_cost_usd": 3.4521 } ``` > **Note**: The estimated cost is a blended cross-model rate intended for trend-watching, not a billable figure. Refer to [Token Usage and Cost](/operate/observe#token-usage-and-cost) for the full token-class breakdown. ## Catalog [#catalog] ### dome_audit_catalog_list [#dome_audit_catalog_list] List every audit event type. Complete and unpaginated. Requires `audit.view`. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | ### dome_audit_catalog_show [#dome_audit_catalog_show] Show field detail for one event type. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------- | | `event_type` | string | Yes | Event type name | ## SIEM [#siem] ### dome_audit_siem_list [#dome_audit_siem_list] List continuous SIEM stream destinations for the workspace. Requires `audit.view`. Only destinations enabled at least once appear. ### dome_audit_siem_status [#dome_audit_siem_status] Read stream status for one destination. Requires `audit.view`. A never-enabled destination returns not found. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ---------------------- | | `destination` | string | Yes | Integration slug or ID | ### dome_audit_siem_enable [#dome_audit_siem_enable] Create a forward-only SIEM stream from evidence accepted at enable time. Requires `audit.export`. If a stream already exists, use resume. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ---------------------- | | `destination` | string | Yes | Integration slug or ID | ### dome_audit_siem_disable [#dome_audit_siem_disable] Stop delivery while retaining the cursor. Requires `audit.export`. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ---------------------- | | `destination` | string | Yes | Integration slug or ID | ### dome_audit_siem_resume [#dome_audit_siem_resume] Resume delivery from the cursor, or skip backlog with `skip_to_now`. Requires `audit.export`. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | --------------------------------------- | | `destination` | string | Yes | Integration slug or ID | | `skip_to_now` | bool | No | Abandon undelivered backlog permanently | Always interpret `enabled` and `state` together. A disabled stream retains its previous delivery health, so `state=active` with `enabled` absent or false means stopped, not delivering. ## Next steps [#next-steps] Prefer the Operate how-tos for query patterns. This page is the tool surface: * [Audit events](/operate/audit) * [Stream Live Events](/operate/observe) * [Stream audit evidence to a SIEM](/manage/export#stream-audit-evidence-to-a-siem) * [Event catalog](/reference/events/catalog) reference * [Event contracts](/reference/events/contracts) reference # Billing (/reference/mcp/billing) Billing tools use the organization on the active context and require organization `billing.manage`. | tool | Purpose | | --------------------------------------------------------------- | ---------------------------------------------------------------------------------- | | `dome_billing_status` | Current plan, renewal, payment method, scheduled changes, and over-limit resources | | `dome_billing_plans` | Plans, prices, features, and limits available to the organization | | `dome_billing_usage` | Accruing usage charges for the current billing period | | `dome_billing_invoices` | Invoice history; accepts optional `limit` | | `dome_billing_contact_get` / `dome_billing_contact_set` | Read or update payer details | | `dome_billing_preview_plan_change` / `dome_billing_change_plan` | Quote or commit a plan change | | `dome_billing_cancel` / `dome_billing_resume` | Schedule cancellation or resume the subscription | | `dome_billing_payment_methods_list` | List stored payment methods | | `dome_billing_payment_methods_set_default` | Select a payment method by `payment_method_id` | | `dome_billing_payment_methods_add` | Start browser-based card setup | | `dome_billing_payment_methods_remove` | Remove a saved payment method by `payment_method_id` | Card capture remains a browser flow. The add tool returns the setup information the dashboard or Stripe.js needs; it does not accept card details in an MCP tool call. ## Seats [#seats] ### dome_billing_seats [#dome_billing_seats] Return purchased and used seats. Used seats count distinct non-impersonator role holders across the organization's workspaces. ### dome_billing_seats_preview [#dome_billing_seats_preview] Quote a seat target without changing it. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `seats` | number | Yes | Absolute purchased-seat target | The response includes the assigned-seat floor, recurring total, and whether the change would be deferred. The payment provider calculates any mid-period proration, so the preview does not claim an exact amount due today. ### dome_billing_seats_set [#dome_billing_seats_set] Set the absolute purchased-seat target on an existing per-seat plan. | Parameter | Type | Required | Description | | --------- | ------ | -------- | --------------------------------------------------------- | | `seats` | number | Yes | Absolute target; cannot be below currently assigned seats | An increase applies immediately and is prorated. A reduction is scheduled for the end of the current term, without an immediate refund or early loss of access. Setting the effective count clears a scheduled reduction, and a later request replaces an earlier scheduled reduction. Use this tool to buy seats when the organization is already on the same per-seat plan. A same-plan call to `dome_billing_change_plan` is a no-op. ## Workspace quantity [#workspace-quantity] ### dome_billing_quantity [#dome_billing_quantity] Show purchased and used workspace quantity for a quantity-priced plan. When purchased quantity exceeds the number of live workspaces, the response includes the unused amount and guidance to preview a reduction. ### dome_billing_quantity_preview [#dome_billing_quantity_preview] Quote an absolute workspace-quantity target without changing it. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ----------------------------------- | | `quantity` | number | Yes | Absolute purchased-workspace target | ### dome_billing_quantity_set [#dome_billing_quantity_set] Set the absolute purchased-workspace target. Increases take effect immediately and are prorated. Reductions are scheduled for the end of the current term; they cannot go below the current workspace count. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ----------------------------------- | | `quantity` | number | Yes | Absolute purchased-workspace target | ### dome_billing_payment_methods_remove [#dome_billing_payment_methods_remove] Remove a saved payment method. Dome refuses to remove the default payment method or the last saved card. | Parameter | Type | Required | Description | | ------------------- | ------ | -------- | ----------------------------------- | | `payment_method_id` | string | Yes | Stripe payment method ID (`pm_...`) | ## Next steps [#next-steps] * [Billing](/manage/billing) for plan and seat behavior * [`dome billing`](/cli/manage/billing) for the CLI equivalents # Callers (/reference/mcp/callers) Callers are Act-As identities projected from audit evidence in the active workspace. Tools expose identity, verification, and attributed activity without returning credentials. Interactive MCP users are not added to this registry. Their session identity and revocable grants belong to the interactive OAuth flow; Callers tracks customer end users carried through delegated Act-As. ## dome_callers_list [#dome_callers_list] List callers. Requires `audit.view`. | Parameter | Type | Required | Description | | ----------------- | ------ | -------- | ------------------------------------------- | | `search` | string | No | Substring match on subject or email | | `group` | string | No | Exact group membership | | `attribute_key` | string | No | Exact claim key filter | | `attribute_value` | string | No | Exact claim value; use with `attribute_key` | | `provider_id` | string | No | Verification provider ID | | `page` | number | No | Zero-based page number | | `page_size` | number | No | Page size; default 50, maximum 200 | The response includes observed verification methods and lifetime LLM calls, tool calls, and LLM tokens. ```json title="Example tool call" { "name": "dome_callers_list", "arguments": { "group": "support", "attribute_key": "region", "attribute_value": "us" } } ``` ## dome_callers_get [#dome_callers_get] Get one caller with attributed agents, models, tools, and activity. Requires `audit.view`. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------------------------- | | `caller` | string | Yes | Caller record UUID or exact subject | Use the record UUID when two verification providers assert the same subject. Retrieve IDs with `dome_callers_list`. Current-month blocks appear only when activity belongs to the current UTC calendar month. Lifetime totals remain available separately. ```json title="Example tool call" { "name": "dome_callers_get", "arguments": { "caller": "{{CALLER_ID}}" } } ``` ## dome_callers_delete [#dome_callers_delete] Erase a projected caller record and its per-agent activity rows. Requires `config.manage`. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------------------------- | | `caller` | string | Yes | Caller record UUID or exact subject | The operation leaves underlying audit evidence intact. Later traffic for the same identity recreates the caller record. ```json title="Example tool call" { "name": "dome_callers_delete", "arguments": { "caller": "{{CALLER_ID}}" } } ``` # Context (/reference/mcp/context)

{environment}

Refer to [Environments](/manage/environments#select-a-cli-context) for how a context selects the workspace CLI and MCP tools use. The MCP server and CLI share `~/.config/dome/config.yaml`: a context switch through either surface is visible to the other, and the MCP server reloads disk changes before tool calls. These tools are always available — they do not require an active workspace context or any specific permissions. ## Context [#context] ### dome_context_list [#dome_context_list] List all available contexts in the org/tenant/workspace hierarchy. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | Returns each context with its name, alias (if set), server, and active status. ```json title="Example tool call" { "name": "dome_context_list" } ``` ### dome_context_current [#dome_context_current] Show the active context name and details. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | Returns the currently selected context including org, tenant, workspace, and server URL. ### dome_context_use [#dome_context_use] Switch the active context by name, alias, or shorthand. The selection is written to the shared config file, so the next CLI command uses it too. | Parameter | Type | Required | Description | | --------- | ------ | -------- | --------------------------------- | | `name` | string | Yes | Context name, alias, or shorthand | Supports several shorthand formats: * **Exact name:** `prod/acme/backend` * **Alias:** `backend` (if alias is set) * **Workspace shorthand:** `backend` * **Tenant/workspace:** `acme/backend` * **Org/tenant/workspace:** `prod/acme/backend` If the shorthand is ambiguous, the tool returns an error listing all matching contexts. ```json title="Example tool call" { "name": "dome_context_use", "arguments": { "name": "acme/backend" } } ``` > **Note**: After switching context, the available tool list updates to reflect your permissions in the new workspace. ### dome_context_sync [#dome_context_sync] Refresh contexts from server memberships. Fetches all org/tenant memberships, creates or updates contexts with scoped session tokens across all authenticated servers, and persists the result to the shared config file. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | ### dome_context_rename [#dome_context_rename] Rename a context. Persists the change to the config file. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ----------------------------- | | `old_name` | string | Yes | Current context name or alias | | `new_name` | string | Yes | New context name | ### dome_context_delete [#dome_context_delete] Delete a context. Persists the change to the config file. If the active context is deleted, platform tools are removed. Marked destructive. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------- | | `name` | string | Yes | Context name or alias to delete | > **Warning**: Deleting a context removes the local session. Re-run `dome_context_sync` to recreate it from server memberships. ### dome_context_alias [#dome_context_alias] Set or remove an alias for a context. Aliases provide short names for frequently used contexts. Persists the change to the config file. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ---------------------------------------------------------------------------------- | | `name` | string | Yes | Context name (or alias to remove when `remove=true`) | | `alias` | string | Yes | Alias value (ignored when `remove=true`, but the parameter must still be provided) | | `remove` | bool | No | Remove the alias instead of setting it (default: `false`) | ```json title="Example — set alias" { "name": "dome_context_alias", "arguments": { "name": "prod/acme/backend", "alias": "backend" } } ``` ```json title="Example — remove alias" { "name": "dome_context_alias", "arguments": { "name": "backend", "alias": "", "remove": true } } ``` ## Auth [#auth] ### dome_auth_status [#dome_auth_status] Show authentication status for the current session. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | Returns the authenticated user, server URL, token expiry, and active workspace. ## Version [#version] ### dome_version [#dome_version] Get the Dome MCP server version. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | Returns the server version string and build metadata. ## Next steps [#next-steps] Create tenants and workspaces from Manage, then switch context here: * [Prepare Environments](/manage/environments) * [Scopes](/concepts/platform/scopes) concept * [Setup AI assistant](/setup-ai-assistant) # Escalations (/reference/mcp/escalations) Manage [escalation workflows](/govern/escalations) and resolve review judgments from an MCP client. Each configuration change publishes a new active version and preserves history. > **Note**: All tools use workspace context. `escalations.view` reads workflows and judgments. `escalations.manage` changes workflows. `escalations.resolve` resolves judgments. ## Workflows [#workflows] ### dome_escalations_list [#dome_escalations_list] List active workflows in the workspace. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------------ | | `page_size` | number | No | Maximum results. Defaults to `10`; maximum `50`. | | `page_token` | string | No | Cursor from the previous response. | ### dome_escalations_get [#dome_escalations_get] Fetch a workflow's active configuration. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ---------------------- | | `escalation` | string | Yes | Workflow name or UUID. | ### dome_escalations_create [#dome_escalations_create] Create a workflow and its first active version. The configuration selects the immutable trigger kind. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ------------------------------------------------- | | `name` | string | Yes | Unique workflow name in the workspace. | | `description` | string | No | One-line description. | | `config_json` | string | Yes | ProtoJSON `dome.escalations.v1.EscalationConfig`. | ### dome_escalations_update [#dome_escalations_update] Update workflow metadata or publish a new active configuration version. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ---------------------------------------------------- | | `escalation` | string | Yes | Workflow name or UUID. | | `new_name` | string | No | New workflow name. | | `description` | string | No | New description. | | `config_json` | string | No | ProtoJSON configuration to publish as a new version. | Pass at least one optional parameter. You cannot change the trigger kind. ### dome_escalations_delete [#dome_escalations_delete] Delete a workflow and its version history. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ---------------------- | | `escalation` | string | Yes | Workflow name or UUID. | ## Versions [#versions] ### dome_escalations_versions [#dome_escalations_versions] List a workflow's version history, newest first. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------------ | | `escalation` | string | Yes | Workflow name or UUID. | | `page_size` | number | No | Maximum results. Defaults to `10`; maximum `50`. | | `page_token` | string | No | Cursor from the previous response. | ### dome_escalations_rollback [#dome_escalations_rollback] Copy an earlier configuration into a new active version. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------- | | `escalation` | string | Yes | Workflow name or UUID. | | `to_version` | number | Yes | Version number to copy forward. | ## Judgments [#judgments] ### dome_escalations_judgments_list [#dome_escalations_judgments_list] List judgments for one workflow, newest first. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------------ | | `escalation` | string | Yes | Workflow name or UUID. | | `status` | string | No | `pending` (default) or `resolved`. | | `page_size` | number | No | Maximum results. Defaults to `10`; maximum `50`. | | `page_token` | string | No | Cursor from the previous response. | ### dome_escalations_judgments_get [#dome_escalations_judgments_get] Fetch one judgment's status and verdict. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ---------------------- | | `escalation` | string | Yes | Workflow name or UUID. | | `judgment_id` | string | Yes | Judgment UUID. | ### dome_escalations_judgments_resolve [#dome_escalations_judgments_resolve] Record the final verdict for a pending judgment. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ---------------------- | | `escalation` | string | Yes | Workflow name or UUID. | | `judgment_id` | string | Yes | Judgment UUID. | | `verdict` | string | Yes | `approve` or `deny`. | Each verdict applies to one request. A resolved judgment cannot change. ## Next steps [#next-steps] * [Configure escalations](/govern/escalations) and attach a Cedar policy * [Use the CLI](/cli/govern/escalations) from a terminal * [Use the REST API](/api/tag/escalations/list-escalations) from an application # Gateways (/reference/mcp/gateway)

{gateway}

Refer to [Gateways](/build/gateways) for membership, access grants, and runtime endpoints. All tools require workspace context. ## Gateways [#gateways] ### dome_gateways_list [#dome_gateways_list] List gateways in the active workspace with state, membership counts, and the canonical endpoint path (`/gateways/`) — the single URL every client points at. The Dome SDK and Anthropic clients use it as-is; MCP clients append `/mcp`; OpenAI-compatible clients append `/v1`. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | > **Note**: Requires `gateways.view`. ### dome_gateways_get [#dome_gateways_get] Get a gateway with its members (individual tools, tool sources, LLM pools, direct model connections). | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------ | | `name` | string | Yes | gateway name | > **Note**: Requires `gateways.view`. ### dome_gateways_create [#dome_gateways_create] Create a gateway. Starts active with empty membership. Until a resource is added it is unreachable. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | -------------------------------------- | | `name` | string | Yes | gateway name (unique within workspace) | | `description` | string | No | Free-form description | > **Note**: Requires `gateways.manage`. ```json title="Create a Gateway" { "name": "dome_gateways_create", "arguments": { "name": "prod-tools", "description": "Production MCP tools for the ops agent" } } ``` ### dome_gateways_update [#dome_gateways_update] Rename or edit the description. Use `dome_gateways_set_state` to enable/disable. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ----------------------- | | `name` | string | Yes | Current gateway name | | `new_name` | string | No | New name (omit to keep) | | `description` | string | No | New description | > **Note**: Requires `gateways.manage`. ### dome_gateways_set_state [#dome_gateways_set_state] Enable or disable a gateway. A disabled gateway fails closed at its endpoint. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ---------------------- | | `name` | string | Yes | gateway name | | `state` | string | Yes | `active` or `disabled` | > **Note**: Requires `gateways.manage`. ### dome_gateways_set_default [#dome_gateways_set_default] Make a gateway the workspace default — the gateway pre-checked (but overridable) in dashboard create dialogs. Enforces no membership. Setting a new default clears the previous one. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------ | | `name` | string | Yes | gateway name | > **Note**: Requires `gateways.manage`. ### dome_gateways_delete [#dome_gateways_delete] Delete a gateway. Membership rows cascade; the underlying tools, connections, and pools are untouched. Marked destructive. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------ | | `name` | string | Yes | gateway name | > **Note**: Requires `gateways.manage`. ## Interactive access [#interactive-access] ### dome_gateways_interactive_enable [#dome_gateways_interactive_enable] Enable interactive MCP access for a gateway. Provide at least one exact-match email or identity-provider subject. The lists replace the gateway's existing allow-lists. | Parameter | Type | Required | Description | | ------------------ | --------------- | ----------- | ------------------------------------------- | | `gateway` | string | Yes | Gateway name | | `allowed_emails` | array of string | Conditional | People allowed by email | | `allowed_subjects` | array of string | Conditional | People allowed by identity-provider subject | ### dome_gateways_interactive_disable [#dome_gateways_interactive_disable] Disable interactive access. Dome retains its managed interactive agent and allow-lists so a later enable can restore the configuration. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------ | | `gateway` | string | Yes | Gateway name | ## Membership [#membership] ### dome_gateways_tool_add [#dome_gateways_tool_add] Add a single MCP tool. Address the tool by its `(connection, tool)` pair from the observed catalog. Run `dome_tools_for_connection` to see observed names. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------ | | `gateway` | string | Yes | gateway name | | `connection` | string | Yes | MCP connection name | | `tool` | string | Yes | tool name as observed (e.g. `create_page`) | > **Note**: Requires `gateways.manage`. ### dome_gateways_tool_remove [#dome_gateways_tool_remove] Remove an individual tool. The underlying tool is untouched. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------------- | | `gateway` | string | Yes | gateway name | | `connection` | string | Yes | MCP connection name | | `tool` | string | Yes | tool name as observed | > **Note**: Requires `gateways.manage`. ### dome_gateways_tool_source_add [#dome_gateways_tool_source_add] Add a tool source (an MCP server connection). The gateway includes every tool observed on the connection; newly observed tools propagate automatically. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------- | | `gateway` | string | Yes | gateway name | | `connection` | string | Yes | MCP connection name | > **Note**: Requires `gateways.manage`. ### dome_gateways_tool_source_remove [#dome_gateways_tool_source_remove] Remove a tool source. Tools that joined only through this source stop being included; the connection itself is untouched. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------- | | `gateway` | string | Yes | gateway name | | `connection` | string | Yes | MCP connection name | > **Note**: Requires `gateways.manage`. ### dome_gateways_model_pool_add [#dome_gateways_model_pool_add] Add an LLM pool. The gateway exposes the pool's models at its `/gateways//v1` endpoint. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------ | | `gateway` | string | Yes | gateway name | | `pool` | string | Yes | Pool name | > **Note**: Requires `gateways.manage`. ### dome_gateways_model_pool_remove [#dome_gateways_model_pool_remove] Remove an LLM pool. The pool itself is untouched. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------ | | `gateway` | string | Yes | gateway name | | `pool` | string | Yes | Pool name | > **Note**: Requires `gateways.manage`. ### dome_gateways_model_add [#dome_gateways_model_add] Add a direct (un-pooled) LLM model connection. The gateway exposes the model without going through a pool. | Parameter | Type | Required | Description | | --------- | ------ | -------- | --------------------- | | `gateway` | string | Yes | gateway name | | `model` | string | Yes | model connection name | > **Note**: Requires `gateways.manage`. ### dome_gateways_model_remove [#dome_gateways_model_remove] Remove a direct LLM model connection. The connection itself is untouched. | Parameter | Type | Required | Description | | --------- | ------ | -------- | --------------------- | | `gateway` | string | Yes | gateway name | | `model` | string | Yes | model connection name | > **Note**: Requires `gateways.manage`. ## Access grants [#access-grants] Access grants control who can *use* a gateway. An agent with no grant is rejected at the edge before Cedar evaluates. ### dome_gateways_access_list [#dome_gateways_access_list] List agents and their access state for a gateway. Revoked agents are excluded to match the CLI and dashboard — a revoked agent cannot exchange its API key for a JWT, so it can never reach the gateway. Suspended agents remain in the list because suspension is reversible. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------ | | `gateway` | string | Yes | gateway name | > **Note**: Requires `agents.view`. ### dome_gateways_agent_grant [#dome_gateways_agent_grant] Grant an agent access to a gateway. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | --------------- | | `gateway` | string | Yes | gateway name | | `agent_id` | string | Yes | agent ID (UUID) | > **Note**: Requires `agents.register` and `rules.deploy`. ### dome_gateways_agent_revoke [#dome_gateways_agent_revoke] Revoke an agent's access. Marked destructive. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | --------------- | | `gateway` | string | Yes | gateway name | | `agent_id` | string | Yes | agent ID (UUID) | > **Note**: Requires `agents.register` and `rules.deploy`. ### dome_gateways_all_agents_grant [#dome_gateways_all_agents_grant] Grant every current and future workspace agent access to a gateway. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------ | | `gateway` | string | Yes | gateway name | > **Note**: Requires `rules.deploy` and `gateways.manage`. ### dome_gateways_all_agents_revoke [#dome_gateways_all_agents_revoke] Clear the all-agents grant. Per-agent grants are unaffected. Marked destructive. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------ | | `gateway` | string | Yes | gateway name | > **Note**: Requires `rules.deploy` and `gateways.manage`. Cap gateway LLM spend with [`dome_quotas_set`](/reference/mcp/quotas#dome_quotas_set) (`subject=gateway`). ## Next steps [#next-steps] Membership and grants have a full how-to under Connect: * [Gateways](/build/gateways) * [Tools](/connect/tools) * [Develop](/develop) # Guards (/reference/mcp/guards)

{guard}

Refer to [Guards](/govern/guards) for filters, validators, and assignment. Editing a filter or validator deploys a new active version; assigned connections pick it up on the next gateway sync. All tools require workspace context. ## Filters [#filters] ### dome_guards_list_filters [#dome_guards_list_filters] List the workspace's filters, each with its active version and config. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | ### dome_guards_get_filter [#dome_guards_get_filter] Fetch one filter's active version and config. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------- | | `filter` | string | Yes | filter name or UUID | ### dome_guards_list_filter_versions [#dome_guards_list_filter_versions] List a filter's version history, newest first. Rollback-produced versions cite their source version id. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------- | | `filter` | string | Yes | filter name or UUID | ### dome_guards_create_filter [#dome_guards_create_filter] Create a filter — its first active version. Supply the config via the convenience params (text-only) or `config_json` (any kind). | Parameter | Type | Required | Description | | ------------------- | --------------- | --------------------------------------- | -------------------------------------------------------------------------- | | `name` | string | Yes | filter name (workspace-scoped) | | `description` | string | No | One-line description | | `redact_substrings` | array of string | No | Substrings to redact in matched responses (text) | | `block_substrings` | array of string | No | Substrings that block the response on a match (text) | | `redact_ssn` | bool | No | Redact US SSN patterns (text) | | `block_ssn` | bool | No | Block the response on an SSN match (text) | | `config_json` | string | For JSON filters, or full-fidelity text | Protojson `dome.guards.v1.FilterConfig`. Overrides the convenience params. | The convenience params build at most two components — a `redact` component and a `block` component, redact ordered first — and only produce text filters. Pass `config_json` to author a JSON filter or a multi-component text chain. #### JSON Filter config [#json-filter-config] ```json { "json": { "components": [ { "field_actions": [ { "matcher": { "key": "ssn" }, "action": "FILTER_ACTION_OMIT" }, { "matcher": { "key": "email" }, "action": "FILTER_ACTION_REDACT" }, { "matcher": { "key": "card" }, "action": "FILTER_ACTION_BLOCK" } ] } ] } } ``` `BLOCK` withholds the whole message. `OMIT` removes the key and value. `REDACT` rewrites the value with a redaction sentinel. When multiple actions target the same key: `BLOCK` > `OMIT` > `REDACT`. ### dome_guards_update_filter [#dome_guards_update_filter] Edit metadata in place (`new_name`, `description`), or deploy a new active version by passing any config param. History is preserved. | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------ | -------- | --------------------------------------------- | | `filter` | string | Yes | filter name or UUID | | `new_name` | string | No | New name for the logical filter | | `description` | string | No | New description | | `redact_substrings` / `block_substrings` / `redact_ssn` / `block_ssn` / `config_json` | — | No | Any config param deploys a new active version | Pass at least one of `new_name`, `description`, or a config param. ### dome_guards_rollback_filter [#dome_guards_rollback_filter] Roll a filter back to an earlier version. The target version's config is copied forward into a new active version. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------ | | `filter` | string | Yes | filter name or UUID | | `to_version` | number | Yes | Version number to roll back to | ### dome_guards_delete_filter [#dome_guards_delete_filter] Hard-delete a filter and its connection assignments. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------- | | `filter` | string | Yes | filter name or UUID | ## Filter assignment [#filter-assignment] ### dome_models_guards_filters_list [#dome_models_guards_filters_list] List the text filters assigned to a model connection, in chain order, grouped by direction. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------------- | | `connection` | string | Yes | model connection name | ### dome_models_guards_filters_set [#dome_models_guards_filters_set] Replace the entire ordered filter chain for one direction on a model connection. Only `text`-kind filters may be assigned. `response` filters completions the agent receives. `request` filters the outbound prompt before dispatch to the model provider — a match can redact or block the call. | Parameter | Type | Required | Description | | ------------ | --------------- | -------- | ----------------------------------------------------- | | `connection` | string | Yes | model connection name | | `direction` | string | Yes | `response` or `request` | | `filters` | array of string | Yes | Ordered filter names or UUIDs; empty clears the chain | ### dome_tools_guards_filters_list [#dome_tools_guards_filters_list] List the JSON filters assigned to an MCP server (tool) connection, in chain order, grouped by direction. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | -------------------------- | | `connection` | string | Yes | MCP server connection name | ### dome_tools_guards_filters_set [#dome_tools_guards_filters_set] Replace the entire ordered filter chain for one direction on a tool connection. Only `json`-kind filters may be assigned. `request` filters run over tool arguments **before** the call reaches the upstream MCP server — matched fields are redacted or omitted, or the whole call is blocked. `response` filters run over the tool result before the agent sees it. | Parameter | Type | Required | Description | | ------------ | --------------- | -------- | ----------------------------------------------------- | | `connection` | string | Yes | MCP server connection name | | `direction` | string | Yes | `response` or `request` | | `filters` | array of string | Yes | Ordered filter names or UUIDs; empty clears the chain | ## Validators [#validators] ### dome_guards_list_validators [#dome_guards_list_validators] List the workspace's validators, each with its active version and kind. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | ### dome_guards_get_validator [#dome_guards_get_validator] Fetch one validator's active version and config. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------------- | | `validator` | string | Yes | validator name or UUID | ### dome_guards_list_validator_versions [#dome_guards_list_validator_versions] List a validator's version history, newest first. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------------- | | `validator` | string | Yes | validator name or UUID | ### dome_guards_create_validator [#dome_guards_create_validator] Create a validator — its first active version. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ------------------------------------------ | | `name` | string | Yes | validator name (workspace-scoped) | | `config_json` | string | Yes | Protojson `dome.guards.v1.ValidatorConfig` | | `description` | string | No | One-line description | Kind (`tool_request` or `tool_response`) is derived from the config arm and is immutable. #### Example config [#example-config] ```json { "toolRequest": { "json": { "requiredPaths": ["user_id"], "maximumSize": 4096 } } } ``` ### dome_guards_update_validator [#dome_guards_update_validator] Edit metadata in place, or pass `config_json` to deploy a new active version. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | --------------------------- | | `validator` | string | Yes | validator name or UUID | | `new_name` | string | No | New name | | `description` | string | No | New description | | `config_json` | string | No | Deploy a new active version | Pass at least one of `new_name`, `description`, or `config_json`. ### dome_guards_rollback_validator [#dome_guards_rollback_validator] Roll a validator back to an earlier version. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------ | | `validator` | string | Yes | validator name or UUID | | `to_version` | number | Yes | Version number to roll back to | ### dome_guards_delete_validator [#dome_guards_delete_validator] Hard-delete a validator and its connection assignments. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------------- | | `validator` | string | Yes | validator name or UUID | ## Validator assignment [#validator-assignment] ### dome_tools_guards_validators_list [#dome_tools_guards_validators_list] List validators assigned to a tool connection, grouped by direction. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | -------------------------- | | `connection` | string | Yes | MCP server connection name | ### dome_tools_guards_validators_add [#dome_tools_guards_validators_add] Attach validators to one direction on a tool connection. Response validators are MCP-only. | Parameter | Type | Required | Description | | ------------ | --------------- | -------- | -------------------------- | | `connection` | string | Yes | MCP server connection name | | `direction` | string | Yes | `request` or `response` | | `validators` | array of string | Yes | validator names or UUIDs | ### dome_tools_guards_validators_remove [#dome_tools_guards_validators_remove] Detach validators from one direction on a tool connection. | Parameter | Type | Required | Description | | ------------ | --------------- | -------- | -------------------------- | | `connection` | string | Yes | MCP server connection name | | `direction` | string | Yes | `request` or `response` | | `validators` | array of string | Yes | validator names or UUIDs | ## Agent and gateway assignment [#agent-and-gateway-assignment] Agent and gateway bindings run after connection bindings. Gateway bindings run before agent bindings. These tools replace all bindings for the selected direction; pass an empty `guards` list to clear that direction. ### dome_agents_guards_list / dome_gateways_guards_list [#dome_agents_guards_list--dome_gateways_guards_list] List guards bound to an agent or gateway, grouped by direction and execution order. | Parameter | Type | Required | Description | | -------------------- | ------ | -------- | ----------------------------- | | `agent` or `gateway` | string | Yes | Agent or gateway name or UUID | ### dome_agents_guards_set / dome_gateways_guards_set [#dome_agents_guards_set--dome_gateways_guards_set] Replace the guards bound to one direction of an agent or gateway. | Parameter | Type | Required | Description | | -------------------- | --------------- | -------- | ---------------------------------------------------------------------- | | `agent` or `gateway` | string | Yes | Agent or gateway name or UUID | | `direction` | string | Yes | `request` or `response` | | `guards` | array of string | Yes | Filter or validator names or UUIDs; an empty list clears the direction | ## Next steps [#next-steps] Create and assign filters and validators from Govern. Catalogs cover windows, path syntax, and validator conditions: * [Configure Guards](/govern/guards) * [Guards](/concepts/controls/guards) concept * [Guards](/reference/controls/guards) reference # Import and export configuration (/reference/mcp/import-export) These tools export configuration from the active workspace, tenant, or organization and import a reviewed bundle into the active target scope. The target scope comes from the MCP context. Dome derives scope identifiers, so no tool accepts them as arguments. Refer to [Import and export configuration](/manage/import-export) for supported resource families, scope coverage, and dashboard instructions. ## Export [#export] ### dome_export_list [#dome_export_list] List exportable resources in the active scope, grouped by family. \| Parameter | Type | Required | Description | \| --- | --- | --- | \| — | — | — | No parameters | > **Note**: Requires `export.manage`, plus view permission for each returned resource family. The result includes resource type, ID, name, and dependencies. It names omitted families when the caller lacks view permission. ### dome_export [#dome_export] Export selected configuration as a `.tf` bundle that `dome_import` accepts. | Parameter | Type | Required | Description | | ---------------------- | ------- | -------- | ---------------------------------------------------- | | `all` | boolean | No | Export every available resource. | | `families` | array | No | Resource families to export, such as `["gateways"]`. | | `resource_ids` | array | No | Resource IDs from `dome_export_list`. | | `include_dependencies` | boolean | No | Include resources the selection references. | > **Note**: Requires `export.manage`, plus view permission for every selected resource family. Choose `all`, `families`, or `resource_ids`. Secrets are never exported. The returned `bundle.files[0].content` contains the `.tf` file, variables replace secrets and environment-specific values, and excluded resources include their reasons. ```json title="Export gateways with dependencies" { "name": "dome_export", "arguments": { "families": ["gateways"], "include_dependencies": true } } ``` ## Import [#import] ### dome_import_inspect [#dome_import_inspect] Validate a bundle without creating a job. \| Parameter | Type | Required | Description | \| --- | --- | --- | \| `files` | array | Yes | `.tf` files as `{ "name": "...", "content": "..." }` objects. | Inspection returns declared variables, resources, required permissions, missing permissions for the active scope, and validation errors. Variables marked `scope_derived`, including `workspace_id`, `tenant_id`, and `org_id`, are filled by Dome and must not be supplied. ### dome_import [#dome_import] Create an import job for a reviewed bundle. \| Parameter | Type | Required | Description | \| --- | --- | --- | \| `files` | array | Yes | `.tf` files as `{ "name": "...", "content": "..." }` objects. | \| `variables` | object | No | Variable values by name. | \| `plan_only` | boolean | No | Preview the changes without applying them. | > **Note**: Requires `import.manage`, plus every permission needed to create or update the imported resources. Call `dome_import_inspect` first, then use `plan_only: true` to review the plan. A regular import matches existing resources by their natural identity, creates the rest, and refuses any plan that destroys or replaces a resource. ```json title="Plan an import" { "name": "dome_import", "arguments": { "files": [ { "name": "dome.tf", "content": "..." } ], "variables": { "api_token": "..." }, "plan_only": true } } ``` ### dome_import_status [#dome_import_status] Get an import job and its recent progress events. \| Parameter | Type | Required | Description | \| --- | --- | --- | \| `job_id` | string | Yes | Import job ID. | > **Note**: Requires `import.manage`. Statuses are `preparing`, `running`, `planned`, `succeeded`, `failed`, `refused`, or `canceled`. A refused plan identifies each blocked resource and reason. ### dome_import_list [#dome_import_list] List import jobs in the active scope, newest first. \| Parameter | Type | Required | Description | \| --- | --- | --- | \| `limit` | number | No | Maximum jobs to return. Defaults to 20. | > **Note**: Requires `import.manage`. ### dome_import_cancel [#dome_import_cancel] Request cancellation before an import begins applying. \| Parameter | Type | Required | Description | \| --- | --- | --- | \| `job_id` | string | Yes | Import job ID. | > **Note**: Requires `import.manage`. A job that is already applying completes and reports its result. ### dome_import_outputs [#dome_import_outputs] Reveal one-time credentials produced by a completed import. \| Parameter | Type | Required | Description | \| --- | --- | --- | \| `job_id` | string | Yes | Import job ID. | > **Note**: Requires `import.manage`. Only the creator of the job can reveal its outputs. Dome returns the values exactly once, then removes them. Store them securely. # MCP Server Reference (/reference/mcp) The Dome MCP server exposes platform tools organized into groups. Tool discovery is permission-aware and fail-closed: for API-key and CLI sessions, Dome introspects the credential scope and hides tools the caller cannot invoke. You only see tools matching your permissions. > **Note**: [Dome MCP](/manage/mcp) and `dome mcp serve` expose the same Dome management tools. Dome MCP is the remote server at `https://mcp.domesystems.ai` and signs each person in with their Dome account. `dome mcp serve` is a local stdio server that uses the active CLI context or a platform API key. ## Setup [#setup] ```bash dome auth login dome context use dome mcp serve ``` ### Connect a client [#connect-a-client] `dome mcp serve` speaks JSON-RPC 2.0 over stdio. Your client launches that process and discovers tools filtered by the active workspace role. Pick the integration that matches your client: **Claude Code** Sign in, pick a workspace, then register the server with Claude Code: ```bash dome auth login dome context use claude mcp add dome -- dome mcp serve ``` Restart or reload Claude Code if tools do not appear. Tools auto-discover. **Claude Desktop** Add to `~/Library/Application Support/Claude/claude_desktop_config.json`: ```json { "mcpServers": { "dome": { "command": "dome", "args": ["mcp", "serve"] } } } ``` Restart Claude Desktop to connect. **Cursor** Add to your Cursor MCP configuration: ```json { "mcpServers": { "dome": { "command": "dome", "args": ["mcp", "serve"] } } } ``` **Codex** Sign in, pick a workspace, then register the server with Codex: ```bash dome auth login dome context use codex mcp add dome -- dome mcp serve ``` Codex stores this in `~/.codex/config.toml`. You can also write it by hand: ```toml [mcp_servers.dome] command = "dome" args = ["mcp", "serve"] ``` Confirm with `codex mcp list`, then type `/mcp` in a Codex session. **Other MCP Client** Sign in, pick a workspace, then start the server on stdio and point your client at stdin/stdout: ```bash dome auth login dome context use dome mcp serve ``` Any MCP-compatible client that launches a stdio process works. Switch workspaces mid-session with `dome_context_use` — the tool list updates to reflect your new permissions. ## Guided prompts [#guided-prompts] The MCP server ships three guided prompts that run end-to-end onboarding flows from your client. Invoke them with `/dome:quickstart`, `/dome:tutorial`, or `/dome:adopt` in Claude Code (other clients expose prompts through their own UI). * [Quickstart](/reference/mcp/prompts#quickstart): Role-aware first-time setup. * [Tutorial](/reference/mcp/prompts#tutorial): Guided governed-agent walkthrough. * [Adopt](/reference/mcp/prompts#adopt): Brownfield onboarding — route an existing codebase's LLM traffic through the gateway with no code changes. ## Tool Groups [#tool-groups] ### Build [#build] * [Agents](/reference/mcp/agents): Register agents, issue credentials, allow resources, and manage lifecycle. * [Managed agents](/reference/mcp/managed-agents): Configure and run agents that Dome hosts. * [Gateways](/reference/mcp/gateway): Group tools and models behind gateways and grant agent access. * [Triggers](/reference/mcp/triggers): Start managed agents manually, on a schedule, or from signed webhooks. ### Connect [#connect] * [Callers](/reference/mcp/callers): Inspect or erase verified end users projected from workspace audit activity. * [Tools](/reference/mcp/tools): Attach MCP servers, configure upstream authentication, and publish governed tools. * [Models](/reference/mcp/models): Connect LLM providers, secure upstream credentials, and publish governed model endpoints. * [Pools](/reference/mcp/pools): Route and fail over LLM traffic across model connections. ### Govern [#govern] * [Rules](/reference/mcp/rules): Control which tools and models each agent is allowed to use. * [Guards](/reference/mcp/guards): Inspect, redact, and constrain content on tool and model connections. * [Quotas](/reference/mcp/quotas): Cap governed LLM spend across workspaces, agents, gateways, pools, and models. ### Operate [#operate] * [Audit](/reference/mcp/audit): Query audit events by class, result, actor, resource, correlation, and payload. * [Webhooks](/reference/mcp/webhooks): Subscribe to Dome events and deliver signed webhooks with retries and replay. ### Manage [#manage] * [Billing](/reference/mcp/billing): Inspect plans and invoices, change seats, and manage subscription state. * [Platform](/reference/mcp/platform): Check platform status, manage scoped API keys, read configuration, and create tenants. * [Import & Export](/reference/mcp/import-export): Move reviewed configuration between compatible scopes and follow import jobs. * [Workspaces](/reference/mcp/workspaces): Create workspaces, manage members, and configure act-as enforcement and policy freshness. * [Verification](/reference/mcp/verification): Configure OIDC and HMAC providers that verify act-as identity for delegated agents. * [Context](/reference/mcp/context): Switch org, tenant, and workspace sessions and check authentication status. ## Permission Model [#permission-model] After selecting a context with `dome_context_use`, tools are filtered based on your workspace, tenant, and org roles. Higher-scope roles cascade into the tools visible inside a workspace context (an org owner sees every workspace tool). | Role | Access | | ------------- | ---------------------------------------------------------------------------------------------- | | **admin** | Every workspace tool — agents, gateway, rules, audit, members, API keys, configuration | | **operator** | agents, gateway, rules (deploy and rollback), audit (view, no export), API keys, configuration | | **security** | rules (deploy, rollback, simulate), audit (view and export), agent suspend, gateway view | | **developer** | agents, agent keys, rules view, audit view, gateway view | | **viewer** | Read-only queries and listings | A handful of tools are gated only by an active context (no role requirement) — refer to [Context](/reference/mcp/context) and the platform tools `dome_status_get`, `dome_config_get`, `dome_workspaces_list`, `dome_workspaces_get`, `dome_platform_keys_available_permissions`. `dome_workspaces_create` requires tenant-level `tenants.manage`; the tenant management tools `dome_tenants_list`, `dome_tenants_get`, and `dome_tenants_create` require an org role. > **Note**: Context management tools are always available regardless of role. You do not need workspace context to list or switch contexts. ## Tool Documentation Standard [#tool-documentation-standard] Each MCP tool page documents: * **Tool name** — the exact `dome_*` identifier used in JSON-RPC calls * **Parameters** — typed parameter table with required/optional markers * **Description** — one-line purpose * **Permission** — a key callout naming the RBAC permission(s) the tool requires * **Destructive flag** — noted in the permission callout when the tool modifies or deletes data Tools follow the [MCP specification](https://modelcontextprotocol.io/) for tool discovery and invocation. The server returns tool schemas via `tools/list` that MCP clients use for auto-discovery. ## Next steps [#next-steps] Connect a client, then start with agents or rules: * [Setup AI assistant](/setup-ai-assistant) to connect Claude Code, Cursor, Codex, or another client * [Agents](/reference/mcp/agents) for the first tool group most operators use * [Rules](/reference/mcp/rules) to draft and deploy Cedar from an assistant * [Quickstart](/quickstart) to verify governed traffic end to end # Managed agents (/reference/mcp/managed-agents) Use these tools to configure managed agents, whose execution worker Dome runs. For agents whose worker you run in your own runtime, use the [Agents](/reference/mcp/agents) tools. Refer to [Managed agents](/build/agents/managed) for the operating model. | tool | Permission | Description | | -------------------------------------------------------------------------------------------------------------- | ---------------------- | ----------------------------------------------------- | | `dome_managed_agents_list`, `dome_managed_agents_get` | `managedagents.view` | List or inspect managed agents | | `dome_managed_agents_create`, `dome_managed_agents_update`, `dome_managed_agents_delete` | `managedagents.manage` | Manage the prompt, model or pool, and one gateway | | `dome_managed_agents_rotate_runner_key` | `managedagents.manage` | Replace the Dome-held runner key without returning it | | `dome_managed_agents_run` | `managedagents.invoke` | Queue an immediate run with optional input | | `dome_managed_agents_runs_list`, `dome_managed_agents_runs_get` | `managedagents.view` | Inspect run history and details | | `dome_managed_agents_webhook_create`, `dome_managed_agents_webhook_list`, `dome_managed_agents_webhook_revoke` | `managedagents.manage` | Manage agent-scoped inbound webhook triggers | `dome_managed_agents_create` requires `name`. Pass `system_prompt`, `model`, and `gateway` to configure the worker; the gateway may be omitted only when exactly one workspace gateway admits every agent. The gateway grant permits every tool the gateway exposes, so separate tool grants are rejected. Use [Triggers](/reference/mcp/triggers) for reusable schedules and webhooks that can start one or more managed agents. ### dome_managed_agents_rotate_runner_key [#dome_managed_agents_rotate_runner_key] Rotate the runner key Dome holds for a managed agent. The replacement is stored before the prior key stops working, and the key is never returned. Running and later managed-agent runs use the replacement. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ------------------ | | `agent_id` | string | Yes | Managed agent UUID | > **Note**: Requires `managedagents.manage`. # Models (/reference/mcp/models)

{modelConnection}

Refer to [Models](/connect/models) for how to connect providers and publish governed endpoints. Group models into [Pools](/reference/mcp/pools) for routing and failover. Cap spend with [Quotas](/reference/mcp/quotas). Connection, OAuth, pool, and quota tools require workspace context. Rate-card tools are organization-scoped (or authenticated-only for Dome's book and suggestions). ## Models [#models] ### dome_models_list [#dome_models_list] List LLM model connections in the active workspace. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | > **Note**: Requires `gateways.view`. ### dome_models_providers [#dome_models_providers] List the supported provider catalog and each provider's curated model ids. Use it to discover valid `provider` and `provider_config.model` values before calling `dome_models_add`. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | > **Note**: Requires `gateways.view`. Each entry returns the provider id, the egress wire family, the default base URL (empty when operator-specific, for example Azure resource or Bedrock region), and a curated model list. Providers with an empty `models` array accept any model string the upstream accepts. ```json title="dome_models_providers result excerpt" { "providers": [ { "provider": "anthropic", "display_name": "Anthropic", "wire": "anthropic", "default_base_url": "https://api.anthropic.com", "models": [ { "id": "claude-opus-4-8", "display_name": "Claude Opus 4.8", "default": true }, { "id": "claude-sonnet-4-6", "display_name": "Claude Sonnet 4.6" } ] } ] } ``` ### dome_models_get [#dome_models_get] Get an LLM model connection by name. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `name` | string | Yes | model name | > **Note**: Requires `gateways.view`. ### dome_models_add [#dome_models_add] Add an LLM model connection. | Parameter | Type | Required | Description | | ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `name` | string | Yes | Connection name (unique within workspace) | | `provider` | string | Yes | `openai`, `anthropic`, `google`, `bedrock`, `azure_openai`, `mistral`, `groq`, `together`, `fireworks`, `deepseek`, `xai`, `perplexity`, `cohere`, `openrouter`, `cerebras`, `nvidia`, `deepinfra`, `sambanova`, `ai21`, `databricks`, `openai_compatible`, `custom`. Refer to [Supported providers](/reference/resources/models#providers) reference. | | `provider_config` | object | No | Provider-specific config. Common keys: `model`, `endpoint` (omit `endpoint` for hosted providers to use the registry's default base URL) | | `auth_method` | string | No | `none`, `api-key`, `oauth` (default: `api-key`) | | `credential_type` | string | No | `none`, `shared`, `per-user` (default: `shared`) | | `api_key` | string | No | API key for `api-key`+`shared`. Stored under the provider's managed auth header (`Authorization` for OpenAI/Bedrock, `x-api-key` for Anthropic, `api-key` for Azure, `x-goog-api-key` for Google) | | `secret_values` | object | No | Advanced: per-connection credential bundle for custom secret-source headers | | `attributes` | object | No | Cedar attributes used by authorization rules | | `gateways` | array | No | [Gateway](/build/gateways) names to attach the model to directly at create time. Without it the model is unreachable until attached (`dome_gateways_model_add`). | > **Note**: Requires `gateways.manage`. ```json title="Add an Anthropic model" { "name": "dome_models_add", "arguments": { "name": "claude-sonnet", "provider": "anthropic", "provider_config": { "model": "claude-3-5-sonnet-20241022" }, "api_key": "sk-ant-..." } } ``` ### dome_models_update [#dome_models_update] Update an LLM model connection. Only provided fields change. When `new_name` renames a model, managed agents configured to run on it follow the new name. | Parameter | Type | Required | Description | | ----------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | string | Yes | model name | | `new_name` | string | No | Rename the connection | | `provider_config` | object | No | Replace `provider_config` | | `auth_method` | string | No | New auth method | | `credential_type` | string | No | New credential scope | | `api_key` | string | No | Rotate the shared API key. Stored under the provider's managed auth header (`Authorization` for OpenAI/Bedrock, `x-api-key` for Anthropic, `api-key` for Azure, `x-goog-api-key` for Google) | | `attributes` | object | No | Replace Cedar attributes (pass `{}` to clear) | > **Note**: Requires `gateways.manage`. Provider is immutable after create — to switch providers, add a new connection. ### dome_models_usage [#dome_models_usage] Show what depends on a model connection before deleting or renaming it: managed agents configured to run on it, agents granted it, gateways that expose it, and pools that contain it. The response can omit names you are not allowed to view. | Parameter | Type | Required | Description | | --------- | ------ | -------- | --------------------- | | `name` | string | Yes | Model connection name | > **Note**: Requires `gateways.view`. ### dome_models_remove [#dome_models_remove] Remove an LLM model connection. Marked destructive. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------- | | `name` | string | Yes | model name | | `reassign_to` | string | No | Replacement model connection or pool. Moves managed agents configured for this model and grants the replacement to agents that held it. | > **Note**: Requires `gateways.manage`. Without `reassign_to`, managed agents configured to run on the model cannot run and agents with no other model grant lose model access. ## OAuth [#oauth] ### dome_models_oauth_connect [#dome_models_oauth_connect] Begin the shared-OAuth admin consent flow for a model configured with `auth_method=oauth`, `credential_type=shared` (Anthropic OAuth, Azure AAD service principal, Google Workload Identity for Vertex). Returns a one-shot URL valid for \~10 minutes. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `name` | string | Yes | model name | > **Note**: Requires `gateways.manage`. ### dome_models_oauth_disconnect [#dome_models_oauth_disconnect] Disconnect (revoke) shared-OAuth credentials for a model. Idempotent. Marked destructive. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `name` | string | Yes | model name | > **Note**: Requires `gateways.manage`. ## Model rates [#model-rates] Organization rate-card tools. They are the MCP surface of [`dome models rates`](/cli/connect/models#model-rates). Org id comes from the active context — there is no `org_id` argument. Rates are integer micro-USD per 1 million tokens (`$3.00/Mtok` = `3000000`). Every rate is a time-windowed **era**: `[valid_from, valid_until)` with `valid_until` unset meaning the open (current) era. Historical usage is priced at the era covering its own time, not at today's rate. `dome_models_rate_set` appends a new era (it closes the match's open era). `dome_models_rate_era_update` is the audited in-place correction of one existing era. **Source** is which card won: `customer` (this organization's contract or association) or `dome_default` (Dome's published book). **Provenance** (`origin`) is where those numbers came from: `seed`, `litellm`, `openrouter`, `merged`, or `customer`. Resolution never branches on provenance. > **Warning**: A provider cost is always an estimate of the organization's upstream bill, never a Dome charge. Dome's own charges meter raw usage at Dome's rates and are exact. When a provider reports no token usage, Dome derives tokens from wire bytes (`tokens = ceil((request_bytes + response_bytes) / bytes_per_token)`). Those tokens are doubly estimated: an estimated count priced at an estimated rate. `dome_models_rate_defaults` and `dome_models_rate_suggest` need authentication only — they read Dome's platform-global book. The other five require organization-scoped `modelrates.manage` (owners and admins hold it by default; it does not cascade from a workspace role). Reads take the write gate: contract rates are contract terms. ### dome_models_rate_defaults [#dome_models_rate_defaults] Show Dome's own per-model rate book (seeded families plus rates imported from the LiteLLM and OpenRouter feeds) and the byte-to-token conversion table used when a provider reports no token usage. Does **not** include the organization's contract rates — use `dome_models_rates` for those. The book is large; pass `filter`. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------------------------- | | `filter` | string | No | Substring filter over match strings | > **Note**: Authenticated only — no organization permission. Does not return org contract rates. Returns `rate_source: "dome_defaults"`, `cost_basis` (`estimate of your upstream provider bill; never a Dome charge`), `rates` (each row `source: "dome_default"`, plus the four micro-USD-per-Mtok fields and `bytes_per_token` / `bytes_per_token_source`), and `byte_to_token_conversion` (`applies_when`, `formula`, `rules`, `default_bytes_per_token`, `derived_tokens_estimate`). Feed provenance (`origin`) is not emitted on each rate row of this view. ```json title="Narrow Dome's book" { "name": "dome_models_rate_defaults", "arguments": { "filter": "claude-sonnet" } } ``` ### dome_models_rates [#dome_models_rates] Show the **effective** model rate card for the active organization: its own contract rates and confirmed model associations (`org_model_prices` eras) layered over Dome's book, plus the byte-to-token divisor in force. Pass `filter` to narrow the card. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------------------------- | | `filter` | string | No | Substring filter over match strings | > **Note**: Requires organization-scoped `modelrates.manage`. Returns `rate_source: "effective"`, `org_id`, the same `cost_basis` string, `rates` (each row labelled `source`: `customer` or `dome_default`), and `byte_to_token_conversion`. This view does not include era ids; take `price_id` from `dome_models_rate_history` (customer segments) for `dome_models_rate_era_update` / `dome_models_rate_remove`. ```json title="Effective card for one family" { "name": "dome_models_rates", "arguments": { "filter": "claude" } } ``` ### dome_models_rate_history [#dome_models_rate_history] Show the pricing timeline one **requested-model string** resolves through for the active organization: every span of time, the era that won it (org override or Dome's book), its rates, `source`, and provenance (`origin`). Answers "what did this model cost us in June". | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------------------------------------------------ | | `model` | string | Yes | Requested-model value (for example `claude-sonnet-4-5`), not a match substring | > **Note**: Requires organization-scoped `modelrates.manage`. Returns `{ "segments": [ … ] }`. Each segment is a half-open window (`from` unset = since forever; `until` unset = current). `source` is `customer` or `dome_default`. `origin` is `seed`, `litellm`, `openrouter`, `merged`, or `customer`. `price_id` is set only when `source` is `customer`. `priced_as` is set when the winning customer era is an alias. ```json title="Timeline for one model string" { "name": "dome_models_rate_history", "arguments": { "model": "claude-sonnet-4-5" } } ``` ### dome_models_rate_suggest [#dome_models_rate_suggest] Suggest which Dome-owned pricing rows a **custom** model string most plausibly prices like (normalized fuzzy match over the imported book) — for models Dome cannot price directly, such as fine-tunes. Suggest only: a price is never silently bound. To bind one, confirm with `dome_models_rate_set` using `priced_as`. | Parameter | Type | Required | Description | | --------- | ------ | -------- | -------------------------------------------------- | | `model` | string | Yes | Custom model string to find pricing candidates for | > **Note**: Authenticated only — no organization permission. Binding requires `modelrates.manage` on `dome_models_rate_set`. Returns `{ "candidates": [ … ] }`. Each candidate has `model_match` (the `priced_as` value to confirm), similarity `score` in `(0, 1]`, current rates, and `origin`. ```json title="Candidates for a fine-tune" { "name": "dome_models_rate_suggest", "arguments": { "model": "ft:gpt-4o-mini:acme:support:abc123" } } ``` ### dome_models_rate_set [#dome_models_rate_set] Set the organization's own rate for a model match — a **new era**. The match's open era is closed at `effective_from` (default now) and the new one opened; historical usage keeps pricing at the eras that covered it. Give literal micro-USD-per-Mtok rates, **or** `priced_as` to bind the match to a Dome-owned row (the custom-model association — it tracks upstream price changes). The two are mutually exclusive. | Parameter | Type | Required | Description | | ----------------------------- | ------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model_match` | string | Yes | Lowercased substring matched against requested-model strings (`claude-opus-5`, or a family like `claude`) | | `name` | string | No | Optional label (`Anthropic EA contract, 2026 H2`) | | `input_micros_per_mtok` | number | Conditional | Micro-USD per 1M input tokens. Omit when using `priced_as`. Omitted literal rates are sent as `0` (that token class prices as free). | | `cache_read_micros_per_mtok` | number | Conditional | Micro-USD per 1M cache-read tokens. Omit when using `priced_as`. Omitted literal rates are sent as `0`. | | `cache_write_micros_per_mtok` | number | Conditional | Micro-USD per 1M cache-write tokens. Omit when using `priced_as`. Omitted literal rates are sent as `0`. | | `output_micros_per_mtok` | number | Conditional | Micro-USD per 1M output tokens. Omit when using `priced_as`. Omitted literal rates are sent as `0`. | | `sort_order` | number | No | Precedence hint; lower wins over longer-match (default `0`) | | `priced_as` | string | Conditional | Dome-owned match to price this match as. Mutually exclusive with literal rates. | | `effective_from` | string | No | RFC3339 time the new era takes effect (default now; backdating allowed when the contract actually changed) | | `effective_until` | string | No | RFC3339 end of a **closed** historical window. With `effective_from`, asserts the rate for `[from, until)` only — current pricing is left untouched. Must not overlap existing eras. | > **Note**: Requires organization-scoped `modelrates.manage`. `effective_from` and `effective_until` must be RFC3339 (for example `2026-08-01T00:00:00Z`). ```json title="Open a contract era" { "name": "dome_models_rate_set", "arguments": { "model_match": "claude-opus-5", "name": "Anthropic EA contract, 2026 H2", "input_micros_per_mtok": 3000000, "cache_read_micros_per_mtok": 300000, "cache_write_micros_per_mtok": 3750000, "output_micros_per_mtok": 15000000, "effective_from": "2026-07-01T00:00:00Z" } } ``` ```json title="Bind a custom model (after suggest)" { "name": "dome_models_rate_set", "arguments": { "model_match": "ft:gpt-4o-mini:acme:support:abc123", "priced_as": "gpt-4o-mini" } } ``` ```json title="Record what was paid for a closed window" { "name": "dome_models_rate_set", "arguments": { "model_match": "claude-sonnet-4-5", "input_micros_per_mtok": 3000000, "output_micros_per_mtok": 15000000, "effective_from": "2026-01-01T00:00:00Z", "effective_until": "2026-07-01T00:00:00Z" } } ``` ### dome_models_rate_era_update [#dome_models_rate_era_update] Edit **one** existing rate era in place — rates, alias, label, or window boundaries. This is the audited correction path for recorded pricing history: every provider-cost surface re-prices the affected span at read time the moment it lands (Dome's own bill is unaffected — it meters raw usage). Get era ids (`price_id`) from customer segments of `dome_models_rate_history`. Omitted fields keep their current values. A closed era cannot be reopened here. | Parameter | Type | Required | Description | | ----------------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------- | | `price_id` | string | Yes | The era to edit (an `org_model_prices` row id) | | `name` | string | No | New label. Omit to keep. | | `input_micros_per_mtok` | number | No | Corrected micro-USD per 1M input tokens. Omit to keep. | | `cache_read_micros_per_mtok` | number | No | Corrected micro-USD per 1M cache-read tokens. Omit to keep. | | `cache_write_micros_per_mtok` | number | No | Corrected micro-USD per 1M cache-write tokens. Omit to keep. | | `output_micros_per_mtok` | number | No | Corrected micro-USD per 1M output tokens. Omit to keep. | | `priced_as` | string | No | Rebind as an alias of this Dome-owned match; empty string clears the alias (then supply all four rates). Omit to keep. | | `valid_from` | string | No | RFC3339 corrected era start. Omit to keep. | | `valid_until` | string | No | RFC3339 corrected era end. Omit to keep. | | `adjust_adjacent` | boolean | No | Trim/extend the neighbor era abutting a moved boundary instead of rejecting the overlap (default `false`) | > **Note**: Requires organization-scoped `modelrates.manage`. Boundary moves that collide with the abutting neighbor are rejected unless `adjust_adjacent` is `true`. A move that would erase the neighbor entirely is still rejected. Setting any literal rate on an alias era is rejected — clear `priced_as` and supply all four rates in the same call. ```json title="Correct rates and slide a boundary" { "name": "dome_models_rate_era_update", "arguments": { "price_id": "omp_01HZX…", "output_micros_per_mtok": 15000000, "valid_until": "2026-08-01T00:00:00Z", "adjust_adjacent": true } } ``` ### dome_models_rate_remove [#dome_models_rate_remove] Remove the organization's rate for a model match by **closing** its open era. Removal is not a delete: by default the closed era is **retained**, so the period it covered keeps pricing at the customer's rate and only the future reverts to Dome's book. | Parameter | Type | Required | Description | | ----------------- | ------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model_match` | string | Conditional | The match whose open era to close/delete. Required unless `price_id` is set. | | `discard_history` | boolean | No | Delete the open era instead of retaining it (default `false` = retain). Irreversible: that period then falls back to the Dome-owned rate for the same window. | | `price_id` | string | Conditional | Delete one specific era by id instead of operating on the open era (admin correction). Either `model_match` or `price_id` is required. | > **Note**: Requires organization-scoped `modelrates.manage`. > **Warning**: `discard_history` is irreversible. The discarded period is re-priced using Dome's rate book. When `price_id` is set, that one era is deleted outright (the retain/discard mode does not apply). ```json title="Close the open era and keep its history" { "name": "dome_models_rate_remove", "arguments": { "model_match": "claude-opus-5" } } ``` ```json title="Discard the open era (re-price that window at Dome's book)" { "name": "dome_models_rate_remove", "arguments": { "model_match": "claude-opus-5", "discard_history": true } } ``` ```json title="Delete one historical era by id" { "name": "dome_models_rate_remove", "arguments": { "price_id": "omp_01HZX…" } } ``` ## Next steps [#next-steps] * [Pools](/reference/mcp/pools) to route and fail over across model connections * [Quotas](/reference/mcp/quotas) to cap USD spend * [Models](/connect/models) how-to for the full workflow * [`dome models rates`](/cli/connect/models#model-rates) CLI for the same rate-card surface # Platform (/reference/mcp/platform)

{platformApiKey}

Refer to [Access](/manage/access) for platform API keys and permissions. Refer to [Environments](/manage/environments) for tenants. Refer to [Settings](/manage/settings) for workspace configuration. These tools require an active context. `dome_status_get`, `dome_config_get`, and `dome_platform_keys_available_permissions` are visible to any role; the API key tools require `apikeys.manage` at the active scope; and the tenant tools require the org-level `tenants.manage` permission. ## Status [#status] ### dome_status_get [#dome_status_get] Get platform status and statistics for the current workspace. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | > **Note**: Authenticated only — visible to any caller with an active context, regardless of role. Returns workspace statistics including agent counts by status, active rule bundle info, and gateway backend count. ```json title="Example tool call" { "name": "dome_status_get" } ``` ## API keys [#api-keys] Platform API keys authenticate service-to-service integrations with the Dome Platform API. ### dome_platform_keys_list [#dome_platform_keys_list] List platform API keys. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | > **Note**: Requires `apikeys.manage`. Returns key metadata (name, created date, last used, status) but not the key secret. ### dome_platform_keys_available_permissions [#dome_platform_keys_available_permissions] List the permissions you can grant to a new platform API key at the current context's scope. Read-only. Call this before `dome_platform_keys_create` to discover the valid `permissions` values for your role. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | > **Note**: Authenticated only — the server filters the returned set against the caller's effective role. Returns an array of `{ id, label }` entries. The `id` is the value to pass to `dome_platform_keys_create`; the `label` is a human-readable name for display. The set is scope-aware: a workspace context returns workspace permissions only, a tenant context adds tenant permissions, and an org context adds org permissions. ```json title="Example tool call" { "name": "dome_platform_keys_available_permissions" } ``` ### dome_platform_keys_create [#dome_platform_keys_create] Create a new platform API key for programmatic access. The key is scoped to the current context level (workspace, tenant, or org). The secret is returned once. Call `dome_platform_keys_available_permissions` first to discover valid permission strings for your role. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------- | | `name` | string | Yes | Key name | | `permissions` | array | No | Permissions to grant (e.g., `agents.register`, `audit.view`). Use `dome_platform_keys_available_permissions` to enumerate valid values. | | `expires_at` | string | No | Expiration time (RFC3339) | > **Note**: Requires `apikeys.manage`. > **Tip**: Call `dome_platform_keys_available_permissions` first to discover valid permission strings for your role at the current scope. ```json title="Example tool call" { "name": "dome_platform_keys_create", "arguments": { "name": "ci-pipeline", "permissions": ["agent.view", "audit.view"] } } ``` > **Note**: Store the returned key secret securely. It cannot be retrieved after creation — only revoked. ### dome_platform_keys_revoke [#dome_platform_keys_revoke] Revoke a platform API key permanently. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ---------------- | | `key_id` | string | Yes | Key ID to revoke | > **Note**: Requires `apikeys.manage`. > **Warning**: Revocation is immediate. Any integrations using this key lose access immediately. ## Config [#config] ### dome_config_get [#dome_config_get] Get a configuration value from the platform. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------- | | `key` | string | Yes | Configuration key | > **Note**: Authenticated only — visible to any caller with an active context, regardless of role. ## Tenants [#tenants] Tools for listing, inspecting, and creating tenants in your active organization. The org is sourced from the active context — switch contexts first if you need to target a different org. All three tools return "No active org context" if the caller has not selected an org context; run `dome_context_use` to switch. ### dome_tenants_list [#dome_tenants_list] List tenants under your active organization. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | > **Note**: Requires org-level `tenants.manage` (held by org `owner` or `admin`). Returns the array of tenants visible to the caller, including id, name, plan, org id, default gateway, and creation timestamp. ```json title="Example tool call" { "name": "dome_tenants_list" } ``` ### dome_tenants_get [#dome_tenants_get] Get a single tenant by id from your active organization. The caller is admitted if either the active context is scoped to the requested tenant, or the caller holds org `admin` or `owner` on the active org. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ----------- | | `tenant_id` | string | Yes | Tenant UUID | > **Note**: Requires tenant-scoped session for the requested tenant **or** org-level `tenants.manage` on the active org. The MCP tool listing surfaces this tool when org `tenants.manage` is held; tenant-scoped callers can still invoke the underlying RPC directly via the API. ```json title="Example tool call" { "name": "dome_tenants_get", "arguments": { "tenant_id": "5b1e…" } } ``` ### dome_tenants_create [#dome_tenants_create] Create a new tenant under your active organization. The caller becomes the initial tenant admin. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------- | | `name` | string | Yes | Tenant display name | | `plan` | string | No | Tenant plan: `essential` (default), `managed`, `enterprise`, `complete` | | `join_policy` | string | No | How non-members join: `open`, `request`, or `invite_only`. Omit to take the server default (`invite_only`). | > **Note**: Requires org-level `tenants.manage` (held by org `owner` or `admin`). > **Note**: Creating a new organization is operator-only. Contact Dome to provision a new org. ```json title="Example tool call" { "name": "dome_tenants_create", "arguments": { "name": "acme-prod", "plan": "managed", "join_policy": "request" } } ``` Unknown `join_policy` values return `InvalidArgument`. See [Join policies](/manage/environments#join-policies). If no active org context is set, the tool returns `No active org context. Use dome_context_use first.` ### dome_tenants_rename [#dome_tenants_rename] Rename a tenant's display name. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------- | | `tenant_id` | string | Yes | Tenant UUID | | `name` | string | Yes | New display name | ### dome_orgs_rename [#dome_orgs_rename] Rename the active organization's display name. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ---------------- | | `name` | string | Yes | New display name | ## Usage allowances [#usage-allowances] ### dome_usage_caps [#dome_usage_caps] Show the active workspace's free-plan monthly tool-call and model-token allowances. The result is empty for paid plans, which meter usage instead. ## Integrations [#integrations] ### dome_integrations_list [#dome_integrations_list] List configured integration instances and their observed connection status. `connected` is the only status that confirms provider credentials; `invalid_credentials`, `unreachable`, `connection_failed`, `checking`, and `unverifiable` each need different handling. ## Organization settings [#organization-settings] ### dome_org_previews_get / dome_org_previews_set [#dome_org_previews_get--dome_org_previews_set] Read or change the organization-wide public-preview switch. `dome_org_previews_set` requires `enabled`; it applies every preview feature currently offered to the organization. | Parameter | Type | Required | Description | | --------- | ------ | -------- | -------------------------------------------------------------- | | `enabled` | bool | Set only | Enable or disable public-preview features | | `org_id` | string | No | Organization ID; defaults to the active context's organization | ### dome_org_mcp_sign_in_get / dome_org_mcp_sign_in_set [#dome_org_mcp_sign_in_get--dome_org_mcp_sign_in_set] Read or change whether members can sign in to the hosted Dome MCP server for an organization. Turning the setting off ends access in that organization on each member's next request. | Parameter | Type | Required | Description | | --------- | ------ | -------- | -------------------------------------------------------------- | | `enabled` | bool | Set only | Enable or disable hosted-MCP sign-in | | `org_id` | string | No | Organization ID; defaults to the active context's organization | ## Next steps [#next-steps] Members, keys, and workspace defaults have how-tos under Manage: * [Manage Access](/manage/access) * [Configure Platform](/manage/settings) * [Permissions](/concepts/platform/permissions) concept # Pools (/reference/mcp/pools)

{modelPool}

Refer to [Pools](/connect/pools) for routing strategies and membership. Add [model connections](/reference/mcp/models) first, then group them here. All tools require workspace context. ## Pools [#pools] ### dome_models_pool_list [#dome_models_pool_list] List LLM pools in the active workspace. > **Note**: Requires `gateways.view`. ### dome_models_pool_get [#dome_models_pool_get] Get a pool with its members. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `name` | string | Yes | Pool name | > **Note**: Requires `gateways.view`. ### dome_models_pool_create [#dome_models_pool_create] Create an LLM pool. | Parameter | Type | Required | Description | | ------------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `name` | string | Yes | Pool name (unique within workspace) | | `description` | string | No | Free-form description | | `match_when` | object | No | Predicate selecting this pool by request shape (e.g. `{"prompt_tokens":{"gt":100000}}`). Refer to [match\_when predicates](/reference/resources/model-pools#pool-resolution) reference for the full grammar — operators (`gt`/`lt`/`eq`, `in`, `prefix`, `suffix`, `regex`) and composition (`any`, `all`, `not`). | | `is_default` | bool | No | Mark as the workspace default pool | | `cache_ttl_secs` | int32 | No | Exact-match cache TTL (`0` disables cache) | | `cache_scope` | string | No | `workspace` or `caller` (default: `workspace`) | | `routing_strategy` | string | No | `priority_weighted`, `round_robin`, `least_loaded`, `most_quota_remaining` (default: `priority_weighted`). Refer to [Routing strategies](/reference/resources/model-pools#routing-strategies) reference. | | `strategy_scope` | string | No | Scope of stateful routing counters: `workspace` (default) or `caller`. Ignored by `priority_weighted`. Scopes only the tiebreak for `most_quota_remaining`. | | `failover_max` | string | No | Failover ceiling. `"all"` walks every member; integer `N` gives primary + N retries (`0` disables failover). Defaults to `"all"`. | | `gateways` | array | No | [Gateway](/build/gateways) names to attach the pool to at create time. Without it the pool is unreachable until attached (`dome_gateways_model_pool_add`). | > **Note**: Requires `gateways.manage`. ### dome_models_pool_update [#dome_models_pool_update] Update a pool. Only provided fields change. When `new_name` renames a pool, managed agents configured to run on it follow the new name. | Parameter | Type | Required | Description | | ------------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `name` | string | Yes | Pool name | | `new_name` | string | No | Rename | | `description` | string | No | Update description | | `match_when` | object | No | Replace match predicate (pass `{}` to clear). Refer to [match\_when predicates](/reference/resources/model-pools#pool-resolution) reference for the grammar. | | `cache_ttl_secs` | int32 | No | Update cache TTL (`0` disables) | | `cache_scope` | string | No | Update cache scope | | `routing_strategy` | string | No | `priority_weighted`, `round_robin`, `least_loaded`, or `most_quota_remaining` | | `strategy_scope` | string | No | `workspace` or `caller` | | `failover_max` | string | No | `"all"` (walk every member) or non-negative integer `N`. Omit to leave unchanged. | > **Note**: Requires `gateways.manage`. ### dome_models_pool_usage [#dome_models_pool_usage] Show what depends on a pool before deleting or renaming it: managed agents configured to run on it, agents granted it, and gateways that expose it. The response can omit names you are not allowed to view. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `name` | string | Yes | Pool name | > **Note**: Requires `gateways.view`. ### dome_models_pool_set_default [#dome_models_pool_set_default] Set the workspace's default pool. Replaces any prior default. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `name` | string | Yes | Pool name | | `reassign_to` | string | No | Replacement model connection or pool. Moves managed agents configured for this pool and grants the replacement to agents that held it. | > **Note**: Requires `gateways.manage`. Without `reassign_to`, managed agents configured to run on the pool cannot run and agents with no other model grant lose model access. ### dome_models_pool_move [#dome_models_pool_move] Reposition a pool in its workspace's `match_when` evaluation order. Pools with non-empty predicates evaluate in ascending `sort_key`; the first match wins. Exactly one of `before` or `after` is required. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------------------------------ | | `name` | string | Yes | Pool to move | | `before` | string | No | Anchor pool name; the moved pool lands immediately before it | | `after` | string | No | Anchor pool name; the moved pool lands immediately after it | > **Note**: Requires `gateways.manage`. ### dome_models_pool_remove [#dome_models_pool_remove] Remove an LLM pool. Marked destructive. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `name` | string | Yes | Pool name | > **Note**: Requires `gateways.manage`. ## Pool members [#pool-members] Members are model connections inside a pool, each with a priority and weight. Failover walks ascending priority; within a priority bucket, requests distribute by weight. ### dome_models_pool_member_list [#dome_models_pool_member_list] List members of a pool. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `pool` | string | Yes | Pool name | > **Note**: Requires `gateways.view`. ### dome_models_pool_member_add [#dome_models_pool_member_add] Add a model to a pool. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ----------------------------------------------------------- | | `pool` | string | Yes | Pool name | | `model` | string | Yes | model connection name | | `priority` | int32 | No | Priority bucket (`0` = primary, ascending fails over) | | `weight` | int32 | No | Weight within the priority bucket (default: `1`) | | `enabled` | bool | No | Whether the member is included in routing (default: `true`) | > **Note**: Requires `gateways.manage`. ```json title="Add a member with failover" { "name": "dome_models_pool_member_add", "arguments": { "pool": "default", "model": "claude-sonnet", "priority": 0, "weight": 1 } } ``` ### dome_models_pool_member_update [#dome_models_pool_member_update] Update a pool member's priority, weight, or enabled flag. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | --------------------- | | `pool` | string | Yes | Pool name | | `model` | string | Yes | model connection name | | `priority` | int32 | No | New priority | | `weight` | int32 | No | New weight | | `enabled` | bool | No | New enabled flag | > **Note**: Requires `gateways.manage`. ### dome_models_pool_member_remove [#dome_models_pool_member_remove] Remove a model from a pool. Marked destructive. | Parameter | Type | Required | Description | | --------- | ------ | -------- | --------------------- | | `pool` | string | Yes | Pool name | | `model` | string | Yes | model connection name | > **Note**: Requires `gateways.manage`. ## Next steps [#next-steps] * [Models](/reference/mcp/models) to add the connections a pool routes across * [Quotas](/reference/mcp/quotas) to cap spend and drive spillover * [Pools](/connect/pools) how-to for the full workflow # Prompts (/reference/mcp/prompts) MCP prompts are guided flows that ship inside the Dome MCP server. Invoke a prompt from your client and the assistant runs the playbook end to end with `dome_*` tools — registering agents, importing model connections, deploying rules, and proving the path with audit events. Prompts are always registered. They are visible as soon as your client connects — you do not need an active context to list them. ## Available prompts [#available-prompts] | Prompt | When to use it | | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `quickstart` | First-time setup. Role-aware bootstrapping that routes you to the matching quickstart for developer, operator, or security. | | `tutorial` | Guided end-to-end walkthrough. Builds a governed Python agent from scratch through the gateway with Cedar rules, field classifications, and audit. | | `adopt` | Onboard an **existing** codebase. Reads your agent's source, routes its LLM calls through the Dome gateway via egress, and proves it — without changing the agent's logic. | ## Invoking a prompt [#invoking-a-prompt] In Claude Code, type `/` and select a Dome prompt from the menu: ``` /dome:quickstart /dome:tutorial /dome:adopt ``` Other MCP clients expose prompts through their own UI — see your client's documentation for the invocation syntax. The prompt text is `//go:embed`'d into the `dome` binary, so prompts come along automatically whenever you add the Dome MCP server. ## Adopt [#adopt] `/dome:adopt` Route an existing agent's LLM traffic through the Dome gateway without touching its logic. Use this when you already have working code — a Python script, a Node app, an n8n workflow — that calls an LLM provider directly and you want it under Dome governance fast. ### When to use adopt [#when-to-use-adopt] Use `adopt` for **brownfield** onboarding. It is the counterpart to `quickstart`, which scaffolds a greenfield project. | You have… | Run… | | -------------------------------------------------------------------------------- | ------------------ | | Nothing yet — you want a starter project | `/dome:quickstart` | | A working agent that calls OpenAI/Anthropic/an OpenAI-compatible vendor directly | `/dome:adopt` | | A blank workspace and time to learn the platform end-to-end | `/dome:tutorial` | ### What it does [#what-it-does] Adopt uses **gateway egress** only. Your agent keeps its existing LLM SDK; the prompt repoints the SDK's base URL at the Dome gateway and swaps its API key for a Dome agent key. The gateway then authorizes every call with Cedar, injects the real provider credential, records the call in audit, and forwards it upstream. The provider never knows Dome is in front of it. The prompt orchestrates an entire linear flow: 1. Verifies authentication and selects a context. 2. Lands you in a workspace — or provisions a new one. 3. Reads your codebase to detect which providers, models, and capabilities (`llm:invoke`, `llm:embed`, `llm:list-models`) it uses. 4. Presents the plan and stops for **explicit consent** to read each real provider key from the app's environment and store it on the Dome platform. 5. Imports each provider as a model connection via `dome_models_add`. 6. Registers an agent and mints its key. 7. Authors a least-privilege Cedar rule, validates and simulates it before and after deploy, then deploys. 8. Proposes the exact configuration changes — `OPENAI_BASE_URL`/`ANTHROPIC_BASE_URL` and the new agent key — without editing your source. 9. Runs a smoke test through the gateway and shows the resulting `model.call` audit event. You are asked to confirm before secrets are imported, before rules are deployed, and before a real billable call is made. ### Provider-secret consent [#provider-secret-consent] Adopt stops at the plan and waits for your **explicit consent** before it touches any secret. The prompt states plainly that completing adoption means: * Dome **reads each real provider key** (e.g. `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`) from the app's environment. * Dome **stores that key on the Dome platform** — on hosted Dome, that is Dome-managed infrastructure — in the Dome secret store. * The secret is **injected at the gateway on egress** to upstream providers. The prompt never displays the secret value back to you in chat or in files — it references each key by where it lives (`OPENAI_API_KEY` in `.env`). You must approve both the plan **and** the import-and-store of those specific provider secrets before any mutation runs. After adoption, the real provider key lives in Dome's secret store and the app holds only a scoped, revocable Dome agent key. Refer to [Security upgrade](#security-upgrade) below. ### Configuration changes adopt proposes [#configuration-changes-adopt-proposes] Adopt only changes configuration, never code logic. The exact settings depend on the wire protocol your SDK uses. Below, `{gateway}` is the complete selected gateway URL returned by `dome_agents_create_key`, and `{dome-agent-key}` is the minted key. > **Note**: Every line in `.env.dome` is written as an `export` statement. A bare `KEY=value` line sourced without `set -a` sets a *shell* variable that the app's child process never inherits — the overlay silently no-ops, and the app keeps calling the provider directly while *appearing* to work. `export` makes `source .env.dome` self-sufficient. **OpenAI / OpenAI-compatible** ```bash # Append to .env.dome — do not overwrite your real provider key. # Every line is an `export` so `source .env.dome` puts the values in the # environment for the app's child process. export OPENAI_BASE_URL={gateway}/v1 export OPENAI_API_KEY={dome-agent-key} ``` Source the overlay before launching the app: ```bash source .env.dome && python agent.py ``` `python-dotenv`'s `load_dotenv()` does not override variables already in the environment, so the Dome values win over the originals in `.env`. No `set -a` needed. **Anthropic** ```bash # The Anthropic SDK appends /v1/messages itself export ANTHROPIC_BASE_URL={gateway} export ANTHROPIC_API_KEY={dome-agent-key} ``` Source the overlay before launching the app: ```bash source .env.dome && python agent.py ``` The Anthropic SDK sends the key as its native `x-api-key` header; the gateway authenticates it the same way it authenticates an OpenAI `Bearer` token. **Hosted platform (n8n, Zapier)** Set the credential's **base URL** to `{gateway}/v1` (OpenAI) or `{gateway}` (Anthropic) and the **API key** to `{dome-agent-key}` in the platform's credential UI. No file changes. ### Starter rule [#starter-rule] Adopt deploys a deny-by-default Cedar rule that lets the new agent invoke this workspace's models: ```cedar // Dome Adopt — starter LLM authorization for {agent-name} // Deny-by-default: this agent may invoke only this workspace's models. permit ( principal == Dome::Agent::"{agent-id}", action == Dome::Action::"llm:invoke", resource is Dome::LLMModel ); permit ( principal == Dome::Agent::"{agent-id}", action == Dome::Action::"llm:count-tokens", resource is Dome::LLMModel ); ``` `resource is Dome::LLMModel` scopes the permit to this workspace's model connections. Pin to a single connection with `resource == Dome::LLMModel::"{connection-name}"`. Add `"llm:embed"` or `"llm:list-models"` permits if your codebase uses them. > **Warning**: Deploying a rule bundle **replaces** the active workspace bundle — it does not append. For an existing workspace that already has rules (e.g. a baseline `mcp:discover` / `mcp:call` permit), adopt reads the active bundle first with `dome_rules_get_active` and deploys a bundle that includes the existing files plus the new LLM rule. Otherwise unrelated permits silently drop. ### Security upgrade [#security-upgrade] After adoption, the real provider key (`sk-...`) lives in Dome's secret store. The app holds only a scoped, revocable Dome agent key. Rotate or revoke without touching the app, and remove the redundant copies from your local `.env` as a hardening follow-up. ### Limits [#limits] * **Base-URL override required.** Adopt works wherever the SDK's base URL is configurable — raw scripts, n8n, most LLM SDKs. Fully-hosted runtimes that hardcode the upstream URL cannot be reached by gateway egress; the prompt detects this and stops rather than half-finishing. * **No source edits.** Adopt will not insert authorization calls, wrap functions, or add SDK dependencies. If your agent's value requires editing its logic to govern, that is out of scope for this flow. * **Real, billable smoke test.** The final step makes an actual call upstream to prove the gateway path end-to-end. Adopt uses a small `max_tokens` value. ## Quickstart [#quickstart] `/dome:quickstart` Role-aware bootstrapping. Detects your context's role (developer, operator, security) and routes the assistant to the matching `dome://quickstart/-` resource. Use it the first time you connect the MCP server. ## Tutorial [#tutorial] `/dome:tutorial` Guided end-to-end walkthrough that builds a governed Python agent from scratch. The assistant creates a workspace, registers an agent, deploys Cedar rules with field classifications, writes a Python script that calls MCP servers through the Dome gateway, and shows the resulting audit trail. Use it when you have a blank workspace and want to see every Dome capability exercised once. ## Next steps [#next-steps] * [MCP server reference](/reference/mcp): Every `dome_*` tool the prompts orchestrate, with parameter schemas. * [LLM gateway](/connect/pools): How gateway egress authorizes, injects credentials, and audits LLM calls. * [Setup AI assistant](/setup-ai-assistant): Install the Dome MCP server in Claude Code, Claude Desktop, or any MCP client. * [Authorization rules](/reference/mcp/rules): Author, simulate, and deploy Cedar rules through MCP tools. # Quotas (/reference/mcp/quotas)

{quota}

Refer to [Quotas](/govern/quotas) for the enforcement model and subjects. All quota operations use this tool family. All tools require workspace context. ## Quotas [#quotas] ### dome_quotas_list [#dome_quotas_list] List quotas in the active workspace. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ------------------------------------------------------- | | `dimension` | string | No | Only list one dimension: `all`, `llm`, `tool`, or `run` | | `gateway` | string | No | Only list the caps on one gateway (name) | > **Note**: Requires `gateways.view`. ### dome_quotas_set [#dome_quotas_set] Create a spend, token, or call cap. The `subject` decides what the cap covers; `dimension` is usually implied by the subject. | Parameter | Type | Required | Description | | -------------- | ------ | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `subject` | string | Yes | `workspace`, `agent`, `act-as`, `pool`, `model`, `gateway`, `tool`, `tool-connection`, or `trigger` | | `dimension` | string | No | Traffic or queue activity metered: `all`, `llm`, `tool`, or `run` — usually implied by `subject` | | `unit` | string | No | `dome_usd` (what you spend with Dome — exact, default), `provider_usd` (an estimate of the upstream model bill), `tokens`, `calls`, or `runs` for a run quota. The two dollar units are different money. | | `limit_usd` | number | Conditional | Dollar cap (e.g. `500` or `12.50`) — required for `dome_usd` or `provider_usd` | | `limit_tokens` | number | Conditional | Token cap (whole number) — required for `unit=tokens` | | `limit_calls` | number | Conditional | Call-count cap (whole number) — required for `unit=calls` | | `limit_runs` | number | Conditional | Queued-run cap — required for `dimension=run` | | `window` | string | No | Reset window: `daily`, `monthly`, or `per_run` (managed-agent agent quota only; default `monthly`) | | `name` | string | No | Optional human-readable label | | `model` | string | Conditional | model connection name (`subject=model`) | | `pool` | string | Conditional | Pool name (`subject=pool`, or to scope a model quota to one pool) | | `agent` | string | Conditional | agent name or id (`subject=agent`) | | `act_as` | string | Conditional | Verified end-user OIDC subject (`subject=act-as`) | | `gateway` | string | Conditional | gateway name (`subject=gateway`) | | `tool` | string | Conditional | One MCP tool as `/`, e.g. `github/create_issue` (`subject=tool`) | | `connection` | string | Conditional | MCP server connection name (`subject=tool-connection`) | | `trigger` | string | Conditional | Trigger name or ID (`subject=trigger`) | | `per_caller` | bool | No | `subject=model` only: apply the limit independently per agent and per verified end user | | `disabled` | bool | No | Create disabled; no enforcement until enabled | > **Note**: Requires `gateways.manage`. ```json title="Per-model in-pool budget (drives spill-over)" { "name": "dome_quotas_set", "arguments": { "subject": "model", "model": "claude-sonnet", "pool": "production", "limit_usd": 1000, "window": "monthly" } } ``` ```json title="Gateway monthly cap" { "name": "dome_quotas_set", "arguments": { "subject": "gateway", "gateway": "prod-tools", "limit_usd": 500, "window": "monthly", "name": "prod-monthly" } } ``` ```json title="Monthly run limit for one trigger" { "name": "dome_quotas_set", "arguments": { "subject": "trigger", "trigger": "nightly-triage", "limit_runs": 30, "window": "monthly" } } ``` ```json title="Per-run token budget for a managed agent" { "name": "dome_quotas_set", "arguments": { "subject": "agent", "agent": "nightly-triage", "unit": "tokens", "limit_tokens": 2000000, "window": "per_run" } } ``` Run quotas count managed-agent runs when Dome queues them. They apply to a workspace, agent, or trigger, and a full quota refuses a new run before it enters the queue. A per-run quota is an LLM budget for one managed agent run; it accepts only `tokens` or `provider_usd`. ### dome_quotas_update [#dome_quotas_update] Update a quota's name, limit, window, or enforcement state. Omitted fields stay unchanged. Subject and unit cannot change. | Parameter | Type | Required | Description | | -------------- | ------ | -------- | ------------------------------------------------ | | `quota_id` | string | Yes | quota id (from `dome_quotas_list`) | | `name` | string | No | New human-readable label | | `limit_usd` | number | No | New spend cap in US dollars (dollar quotas only) | | `limit_tokens` | number | No | New token cap (tokens quotas only) | | `limit_calls` | number | No | New call-count cap (calls quotas only) | | `window` | string | No | New reset window: `daily` or `monthly` | | `enabled` | bool | No | Enable or disable enforcement | > **Note**: Requires `gateways.manage`. ### dome_quotas_remove [#dome_quotas_remove] Remove a quota by id. Marked destructive. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ---------------------------------- | | `quota_id` | string | Yes | quota id (from `dome_quotas_list`) | > **Note**: Requires `gateways.manage`. ## Next steps [#next-steps] * [Set Usage Limits](/govern/quotas) how-to for the full workflow * [Pools](/reference/mcp/pools) when per-model budgets should spill to the next member * [Models](/reference/mcp/models) for the connections quotas cover # Roles (/reference/mcp/roles) Custom roles are named permission sets at an organization, tenant, or workspace scope. Their permissions cascade to child scopes. All role tools require the matching scope context and permissions. ## Roles [#roles] ### dome_roles_list [#dome_roles_list] List built-in and custom roles assignable at a scope. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------------------------------------------------------- | | `scope_kind` | string | No | `workspace`, `tenant`, or `org`; defaults to the active workspace | | `scope_id` | string | No | Scope ID; defaults to the active context | ### dome_roles_get [#dome_roles_get] Show one custom role's definition and current holders. | Parameter | Type | Required | Description | | ------------------------ | ------ | -------- | ---------------- | | `name` | string | Yes | Custom role name | | `scope_kind`, `scope_id` | string | No | Scope to inspect | ### dome_roles_create [#dome_roles_create] Create a custom role with the supplied permission IDs. | Parameter | Type | Required | Description | | ------------------------ | --------------- | -------- | ---------------------------------- | | `name` | string | Yes | Role name | | `permissions` | array of string | Yes | Permission IDs granted by the role | | `description` | string | No | Role description | | `scope_kind`, `scope_id` | string | No | Scope for the role | ### dome_roles_update [#dome_roles_update] Change a custom role's name, description, or complete permission set. Renaming keeps its existing holders assigned. | Parameter | Type | Required | Description | | ------------------------- | --------------- | -------- | -------------------------- | | `name` | string | Yes | Current role name | | `new_name`, `description` | string | No | Replacement metadata | | `permissions` | array of string | No | Replacement permission IDs | | `scope_kind`, `scope_id` | string | No | Scope for the role | ### dome_roles_delete [#dome_roles_delete] Delete a custom role. If it has holders, choose how to handle them by reassigning or removing their memberships. The tool refuses an unsafe deletion. | Parameter | Type | Required | Description | | ------------------------ | ------ | -------- | ------------------------------- | | `name` | string | Yes | Role name | | `reassign_to` | string | No | Role that receives every holder | | `remove_members` | bool | No | Remove every holder instead | | `scope_kind`, `scope_id` | string | No | Scope for the role | ## Next steps [#next-steps] * [Manage Access](/manage/access) for memberships, roles, and platform API keys * [`dome roles`](/cli/settings/roles) for the CLI reference # Rules (/reference/mcp/rules)

{rule}

Refer to [Rules](/govern/rules) for how to write, validate, simulate, and apply Cedar bundles. All tools require workspace context. ## Rules [#rules] ### dome_rules_deploy [#dome_rules_deploy] Deploy a bundle of Cedar authorization rules. Each file has a name and Cedar policy content. Defaults to workspace scope if `scope_kind`/`scope_id` are omitted. Use `dome_agents_assign_policy` for agent-scoped rules. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------------------------------------------------------------------------------------------- | | `files` | array | Yes | Array of `{name, content}` objects — Cedar rule files | | `name` | string | No | Optional friendly display name for this rule bundle | | `scope_kind` | string | No | Scope kind: `tenant`, `workspace`, `agent` (defaults to `workspace` if a workspace context is active) | | `scope_id` | string | No | Scope ID (workspace or agent UUID) | > **Note**: Requires `rules.deploy`. ```json title="Example tool call" { "name": "dome_rules_deploy", "arguments": { "files": [ { "name": "allow-code-search.cedar", "content": "permit(\n principal,\n action == Dome::Action::\"mcp:call\",\n resource == Dome::MCPTool::\"code-search\"\n);" } ], "name": "allow-code-search" } } ``` > **Note**: Cedar policies use a declarative syntax. Use `dome_rules_validate` to check syntax before deploying. The response includes an advisory `warnings` array. After a successful deploy, the control plane walks every policy for `Dome::MCPTool` references and cross-checks each `(connection, tool)` pair against the workspace's persisted MCP tool catalog. Mismatches surface as `ValidationWarning` entries (file + message) — a typo or rename is flagged, but the deploy still succeeds. Warnings are only emitted for `workspace`- and `agent`-scoped bundles; `tenant`-scoped deploys skip this check because the catalog is workspace-keyed. ### dome_rules_get_active [#dome_rules_get_active] Get the currently active rule bundle at the specified scope. Defaults to workspace scope. For agent-specific rules, use `scope_kind="agent"` and `scope_id=`, or use `dome_agents_get_policies`. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------ | | `scope_kind` | string | No | Scope kind: `tenant`, `workspace`, `agent` | | `scope_id` | string | No | Scope ID | > **Note**: Requires `rules.view`. ### dome_rules_validate [#dome_rules_validate] Validate Cedar rule files without deploying. Returns errors and warnings. | Parameter | Type | Required | Description | | --------- | ----- | -------- | ----------------------------------------------------- | | `files` | array | Yes | Array of `{name, content}` objects — Cedar rule files | > **Note**: Requires `rules.view`. ```json title="Example tool call" { "name": "dome_rules_validate", "arguments": { "files": [ { "name": "draft.cedar", "content": "permit(\n principal,\n action == Dome::Action::\"mcp:call\",\n resource\n);" } ] } } ``` ### dome_rules_generate [#dome_rules_generate] Generate starter Cedar authorization rules. Returns a Cedar policy with blanket `mcp:discover` permit and comments explaining how backend tool availability works. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | > **Note**: Requires `rules.view`. ## Simulate [#simulate] ### dome_rules_simulate [#dome_rules_simulate] Simulate an authorization decision against the active rules without actually performing the action. | Parameter | Type | Required | Description | | --------------- | ------ | -------- | ---------------------------------------------------------------- | | `agent_id` | string | Yes | agent ID (or name — resolved to UUID) to simulate as the caller | | `action` | string | Yes | Action to evaluate (e.g., `mcp:call`, `mcp:discover`) | | `resource` | string | Yes | Resource identifier | | `resource_type` | string | Yes | Resource type: `mcp_tool`, `llm_model`, `resource` | | `context` | object | No | Additional context key-value pairs | | `actas_sub` | string | No | Act-as subject identifier (end-user the agent acts on behalf of) | | `actas_email` | string | No | Act-as email | | `actas_roles` | string | No | Act-as roles (comma-separated) | | `actas_groups` | string | No | Act-as groups (comma-separated) | > **Note**: Requires `rules.view`. ```json title="Example tool call" { "name": "dome_rules_simulate", "arguments": { "agent_id": "code-reviewer", "action": "mcp:call", "resource": "mcp_tool/code-search", "resource_type": "mcp_tool" } } ``` ### dome_rules_simulate_result [#dome_rules_simulate_result] Get the result of a rule simulation run. If the simulation is still running, the status is `pending` or `running` — call again after a moment to check for completion. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------- | | `id` | string | Yes | Simulation ID | > **Note**: Requires `rules.view`. ## Versions [#versions] ### dome_rules_list_versions [#dome_rules_list_versions] List historical rule bundle versions at the specified scope. Defaults to workspace scope. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------ | | `scope_kind` | string | No | Scope kind: `tenant`, `workspace`, `agent` | | `scope_id` | string | No | Scope ID | | `limit` | number | No | Maximum results (default: 20) | > **Note**: Requires `rules.view`. Returns each version with its bundle ID, name, deploy timestamp, and deployer. ### dome_rules_rollback [#dome_rules_rollback] Rollback to a previously deployed rule bundle by its ID. The server reads the bundle's scope from the stored row — no `scope_kind`/`scope_id` needed. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ------------------------------------------------ | | `bundle_id` | string | Yes | Bundle ID (UUID) from `dome_rules_list_versions` | > **Note**: Requires `rules.rollback`. > **Warning**: Rollback immediately changes the active rules. All subsequent authorization decisions use the rolled-back bundle. ## Agent policies [#agent-policies] ### dome_agents_assign_policy [#dome_agents_assign_policy] Deploy Cedar rules scoped to a specific agent. These rules are evaluated in addition to workspace-level rules. Cedar `forbid` at workspace scope overrides `permit` at agent scope. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ----------------------------------------------------- | | `agent_id` | string | Yes | agent ID to assign rules to | | `files` | array | Yes | Array of `{name, content}` objects — Cedar rule files | > **Note**: Requires `rules.deploy`. ```json title="Example tool call" { "name": "dome_agents_assign_policy", "arguments": { "agent_id": "code-reviewer", "files": [ { "name": "agent-policy.cedar", "content": "permit(\n principal,\n action == Dome::Action::\"mcp:call\",\n resource == Dome::MCPTool::\"code-search\"\n);" } ] } } ``` ### dome_agents_get_policies [#dome_agents_get_policies] Get the Cedar rules currently assigned to a specific agent (agent-scope only; does not include inherited workspace/tenant/org rules). To see workspace rules, use `dome_rules_get_active`. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ----------- | | `agent_id` | string | Yes | agent ID | > **Note**: Requires `rules.view`. ## Next steps [#next-steps] Write and simulate from Govern. Evaluation semantics and Cedar catalogs sit under Concepts and Reference: * [Authorize Access](/govern/rules) * [Authorization Model](/concepts/architecture/authorization-model) concept * [Rules](/reference/controls/rules) reference # Sessions (/reference/mcp/sessions) Sessions belong to the signed-in person, not to a workspace. Platform API keys cannot use these tools. ## dome_sessions_list [#dome_sessions_list] List Dashboard, CLI, and hosted Dome MCP sessions, newest first. The session used by this MCP conversation is marked current. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------- | | `page_size` | number | No | Sessions per page; default 100, maximum 500 | | `page_token` | string | No | Cursor from the prior response | ## dome_sessions_revoke [#dome_sessions_revoke] Sign out of one session, or every session other than the one this MCP conversation uses. Revoking the current session ends this conversation's access. | Parameter | Type | Required | Description | | ------------ | ------ | ----------- | ---------------------------------- | | `session_id` | string | Conditional | Session to revoke | | `others` | bool | Conditional | Revoke every other session instead | Pass exactly one of `session_id` or `others=true`. ## Next steps [#next-steps] * [Configure Dome via MCP](/manage/mcp#manage-your-sessions) * [`dome sessions`](/cli/session/sessions) # Tools (/reference/mcp/tools)

{tool}

Refer to [Tools](/connect/tools) for how to attach MCP servers and configure upstream authentication. For gateway membership and access grants, refer to [Gateways](/reference/mcp/gateway). All tools require workspace context. ## Tools [#tools] ### dome_tools_list [#dome_tools_list] List MCP server connections in the active workspace. Returns name, URL, protocol, auth method, outbound headers, and field classifications for each. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | > **Note**: Requires `gateways.view`. ```json title="Example tool call" { "name": "dome_tools_list" } ``` ### dome_tools_get [#dome_tools_get] Get an MCP server connection by name. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `name` | string | Yes | tool name | > **Note**: Requires `gateways.view`. ### dome_tools_add [#dome_tools_add] Add a new MCP server connection. Connections route the gateway to external MCP servers agents reach through Dome. | Parameter | Type | Required | Description | | ----------------------- | ------ | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | string | Yes | tool name (unique within workspace) | | `url` | string | Yes (streamable-http) | tool URL | | `command` | string | Yes (stdio) | Command to exec | | `args` | array | No | Command args for `stdio` | | `protocol` | string | No | `streamable-http`, `stdio` (default: `streamable-http`) | | `headers` | array | No | Outbound headers. Each entry: `{name, source, value, secret}`. `source` is `literal` (with `value`), `secret` (with `secret` key name), or `actas` (no value/secret — reinjects the verified `X-Dome-Act-As`). `stdio` rejects headers. `Authorization` is reserved for the managed auth flow. | | `authorization` | string | No | `Authorization` HTTP header value. REQUIRED when `auth_method=api-key` and `credential_type=shared`. Forbidden otherwise. The server auto-injects the matching managed `Authorization` header — do not declare it manually. | | `secret_values` | object | No | Advanced: per-tool credential bundle for custom secret-source headers. `Authorization` is reserved. | | `auth_method` | string | No | `none`, `api-key`, `oauth` | | `credential_type` | string | No | `shared`, `per-user` | | `oauth` | object | No | OAuth client config (required when `auth_method=oauth`) | | `field_classifications` | object | No | Field sensitivity classifications (e.g. `{"email": "PII"}`) | | `write_tools` | array | No | tool names classified as write operations | | `gateways` | array | No | [Gateway](/build/gateways) names to attach the connection to as a tool source at create time. Without it the connection is unreachable until attached (`dome_gateways_tool_source_add`). | > **Note**: Requires `gateways.manage`. The `oauth` object accepts: | Field | Description | | ---------------------------- | -------------------------------------------------------- | | `authorize_url` | Authorization endpoint URL | | `token_url` | Token endpoint URL | | `revoke_url` | Revocation endpoint URL | | `registration_url` | RFC 7591 registration endpoint (for `client_origin=dcr`) | | `client_id` | OAuth client ID | | `client_secret` | OAuth client secret | | `default_scopes` | Array of default scopes | | `client_origin` | `dcr` or `manual` | | `token_endpoint_auth_method` | `auto`, `client_secret_basic`, or `client_secret_post` | When `auth_method=oauth` and `credential_type=shared`, the response includes `oauth_connect_url` — open it in a browser to complete consent. ```json title="Shared OAuth tool" { "name": "dome_tools_add", "arguments": { "name": "notion", "url": "https://mcp.notion.com/mcp", "auth_method": "oauth", "credential_type": "shared", "oauth": { "authorize_url": "https://api.notion.com/v1/oauth/authorize", "token_url": "https://api.notion.com/v1/oauth/token", "client_id": "...", "client_secret": "...", "client_origin": "manual", "default_scopes": ["read_content", "update_content"] } } } ``` ### dome_tools_update [#dome_tools_update] Update an existing MCP server connection. Only provided fields are changed. | Parameter | Type | Required | Description | | ------------------------------ | ------ | -------- | ------------------------------------------------------------------ | | `name` | string | Yes | tool name to update | | `url` | string | No | New URL | | `protocol` | string | No | New protocol | | `headers` | array | No | Replace the full outbound header list. Omit to keep current. | | `authorization` | string | No | Rotate an `api-key`+`shared` tool's token | | `secret_values` | object | No | Advanced: replace per-tool credential bundle. Empty `{}` wipes it. | | `auth_method` | string | No | New auth method | | `credential_type` | string | No | New credential scope | | `oauth` | object | No | OAuth client config patch. Empty `client_secret` keeps existing. | | `field_classifications` | object | No | Add or update field classifications | | `remove_field_classifications` | array | No | Remove field classifications by name | | `write_tools` | array | No | Replace write-tools list | > **Note**: Requires `gateways.manage`. Switching `auth_method` between `api-key` and `oauth` clears the previously stored credential bundle. ### dome_tools_remove [#dome_tools_remove] Remove an MCP server connection from the active workspace. Marked destructive. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------- | | `name` | string | Yes | tool name to remove | > **Note**: Requires `gateways.manage`. > **Warning**: Removing a tool disconnects all agents currently routing through it. Update or re-route agents first. ## OAuth [#oauth] ### dome_tools_oauth_connect [#dome_tools_oauth_connect] Begin the shared-OAuth admin consent flow for a tool. Returns a one-shot URL the operator opens in a browser to consent at the upstream's authorization server. Only valid for `auth_method=oauth`, `credential_type=shared`. Per-user OAuth tools trigger consent automatically on each end user's first call. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `name` | string | Yes | tool name | > **Note**: Requires `gateways.manage`. The response includes `oauth_connect_url` and `oauth_connect_expires_at`. Open the URL within \~10 minutes. ### dome_tools_oauth_disconnect [#dome_tools_oauth_disconnect] Disconnect (revoke) shared OAuth credentials. The OAuth client configuration is preserved, so re-running connect reuses the same client. Idempotent. Marked destructive. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `name` | string | Yes | tool name | > **Note**: Requires `gateways.manage`. ## Catalog [#catalog] ### dome_tools_for_connection [#dome_tools_for_connection] List the operations Dome has discovered on one MCP server connection. This reads the stored catalog and does not apply gateway membership or agent rules. | Parameter | Type | Required | Description | | ------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------- | | `name` | string | Yes | tool name | | `seen_since` | string | No | Include operations seen within this duration, such as `30d` or `24h`. Pass `0` for all recorded operations | | `with_schema` | boolean | No | Include each operation's input schema. Defaults to `true` | > **Note**: Requires `gateways.view`. ```json title="List discovered operations" { "name": "dome_tools_for_connection", "arguments": { "name": "notion", "with_schema": false } } ``` ## Lifecycle [#lifecycle] Transition individual MCP tools (the items inside a connection's catalog) through `active` → `deprecated` → `blocked`. Status persists across re-observation — once set, only an explicit restore returns the tool to `active`. ### dome_tools_block [#dome_tools_block] Hide an MCP tool from agents. The gateway filters it out of `tools/list` and denies any `tools/call` against it; blocked-call attempts emit a `tool.blocked_call_denied` audit event. A block takes precedence over ordinary connection-level access. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------------------------------------------------- | | `connection` | string | Yes | MCP connection name | | `tool` | string | Yes | tool name as observed in the catalog (e.g. `delete_page`) | | `message` | string | No | Operator note shown in dashboards | > **Note**: Requires `gateways.manage`. ```json title="Block a dangerous tool" { "name": "dome_tools_block", "arguments": { "connection": "notion", "tool": "delete_page", "message": "dangerous mass-delete; use archive_page" } } ``` ### dome_tools_deprecate [#dome_tools_deprecate] Mark a tool as deprecated. The tool stays callable and visible to agents — the dashboard surfaces a warning chip and the status flows through the catalog. Use when an upstream supersedes a tool and you want to soft-signal callers. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------- | | `connection` | string | Yes | MCP connection name | | `tool` | string | Yes | tool name as observed in the catalog | | `message` | string | No | Operator note (e.g. `"use create_page_v2"`) | > **Note**: Requires `gateways.manage`. ### dome_tools_restore [#dome_tools_restore] Restore a tool to `active`, clearing any prior block or deprecation. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------ | | `connection` | string | Yes | MCP connection name | | `tool` | string | Yes | tool name as observed in the catalog | > **Note**: Requires `gateways.manage`. ## Next steps [#next-steps] Attach backends under Connect. Named gateways and grants are a separate tool group: * [Tools](/connect/tools) * [Models](/connect/models) * [Gateways](/reference/mcp/gateway) # Triggers (/reference/mcp/triggers) A trigger starts managed-agent runs manually, on a schedule, or from a signed webhook. | tool | Permission | Description | | ---------------------------------------------------------------------- | ---------------------- | ------------------------------------ | | `dome_triggers_list`, `dome_triggers_get`, `dome_triggers_runs` | `managedagents.view` | Read triggers and their runs | | `dome_triggers_create`, `dome_triggers_update`, `dome_triggers_delete` | `managedagents.manage` | Manage schedule and webhook triggers | | `dome_triggers_target_set_enabled` | `managedagents.manage` | Enable or disable one target edge | | `dome_triggers_fire` | `managedagents.invoke` | Queue a run for each enabled target | `dome_triggers_create` requires `name` and `kind` (`schedule` or `webhook`). A schedule accepts `cron` and `timezone`; a webhook returns its signing secret once. Targets accept managed-agent names or IDs. The only target kind today is `managed_agent`. Refer to [Managed agents](/build/agents/managed) for retry, concurrency, and catch-up behavior. # Verification (/reference/mcp/verification)

{verificationProvider}

Refer to [Delegated agents](/build/agents/delegated) for how provider hierarchy and Act-As enforcement resolve. Reads target workspace, tenant, or organization scope. Provider writes currently target the active workspace. ## Providers [#providers] ### dome_verification_providers_list [#dome_verification_providers_list] List verification providers at a scope. The default is the active workspace. | Parameter | Type | Required | Description | | --------------- | ------- | -------- | ------------------------------------------------------------ | | `scope_kind` | string | No | `workspace` (default), `tenant`, or `org` | | `org_id` | string | No | Organization ID for org scope; defaults to active context | | `include_chain` | boolean | No | At workspace scope, include visible tenant and org providers | > **Note**: tool visibility requires `config.manage` at the target scope. Returns each provider with its ID, name, verification method, and configuration details. ```json title="Example tool call" { "name": "dome_verification_providers_list" } ``` ### dome_verification_providers_get [#dome_verification_providers_get] Get one provider at its owning scope. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | --------------------------------------------------------- | | `provider_id` | string | Yes | Provider ID | | `scope_kind` | string | No | `workspace` (default), `tenant`, or `org` | | `org_id` | string | No | Organization ID for org scope; defaults to active context | ### dome_verification_providers_create [#dome_verification_providers_create] Create a new provider in the active workspace. | Parameter | Type | Required | Description | | -------------------- | ------ | ----------- | --------------------------------------------------------------------------------------- | | `name` | string | Yes | Provider name | | `method` | string | Yes | Verification method: `oidc` or `hmac` | | `oidc_discovery_url` | string | Conditional | OIDC issuer base URL (required when method is `oidc`; Dome appends the well-known path) | | `hmac_secret` | string | Conditional | HMAC shared secret (required when method is `hmac`) | > **Note**: Requires `config.manage`. ```json title="Example — OIDC provider" { "name": "dome_verification_providers_create", "arguments": { "name": "google-workspace", "method": "oidc", "oidc_discovery_url": "https://accounts.google.com" } } ``` ```json title="Example — HMAC provider" { "name": "dome_verification_providers_create", "arguments": { "name": "internal-signer", "method": "hmac", "hmac_secret": "your-shared-secret" } } ``` > **Note**: After creating a provider, reference it in agent registration with the `actas_method` and provider ID to enable act-as verification for that agent. ### dome_verification_providers_delete [#dome_verification_providers_delete] Delete a provider from the active workspace. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | --------------------- | | `provider_id` | string | Yes | Provider ID to delete | > **Note**: Requires `config.manage`. > **Warning**: Deleting a provider breaks act-as verification for any agents referencing it. Update or remove agent verification configs before deleting the provider. ## Provider selections [#provider-selections] Default providers fill missing verifier material. The nearest scope wins: workspace, tenant, then organization. Required providers pin every non-bound agent to that provider and force Act-As. The broadest scope wins: organization, tenant, then workspace. ### dome_tenant_actas_get [#dome_tenant_actas_get] Get tenant default and required provider selections. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------------------------------- | | `tenant_id` | string | No | Tenant ID; defaults to the active tenant | Requires tenant `config.manage`. ### dome_tenant_actas_update [#dome_tenant_actas_update] Replace tenant provider selections. Omitted values clear their fields. | Parameter | Type | Required | Description | | ---------------------------- | ------ | -------- | ---------------------------------------- | | `tenant_id` | string | No | Tenant ID; defaults to the active tenant | | `actas_default_provider_id` | string | No | Tenant- or org-scoped default provider | | `actas_required_provider_id` | string | No | Tenant- or org-scoped required provider | Requires tenant `config.manage`. ### dome_orgs_actas_get [#dome_orgs_actas_get] Get organization default and required provider selections. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------------------------------------- | | `org_id` | string | No | Organization ID; defaults to the active context | Requires organization `config.manage`. ### dome_orgs_actas_update [#dome_orgs_actas_update] Replace organization provider selections. Omitted values clear their fields. | Parameter | Type | Required | Description | | ---------------------------- | ------ | -------- | ----------------------------------------------- | | `org_id` | string | No | Organization ID; defaults to the active context | | `actas_default_provider_id` | string | No | Organization-scoped default provider | | `actas_required_provider_id` | string | No | Organization-scoped required provider | Requires organization `config.manage`. > **Warning**: MCP provider writes are workspace-only. Manage organization providers from Settings → Single Sign-On. Tenant provider writes are not exposed yet. ## Next steps [#next-steps] Configure providers on delegated agents, then pass Act-As from the app: * [Delegated agents](/build/agents/delegated) * [Identity Patterns](/concepts/identity-patterns) concept * [Pass identity for delegated agents](/develop#pass-identity-for-delegated-agents) # Webhooks (/reference/mcp/webhooks) Webhook `event_types` use the same names as Audit schema-v4 operations (`agent.suspend`, `tool.call`, `guard.filter.evaluate`). There is no `access.denied` type; filter on `result=denied` instead.

{webhook}

Refer to [Webhooks](/operate/webhooks) for setup, signature verification, and the event catalog. Refer to [Webhooks](/concepts/audit/webhooks) concept for how signed delivery works. The surface is subscription-first: creating a subscription creates its delivery destination in the same call, and the destination's URL, headers, secret, and credentials are managed through the subscription tools. There are no standalone destination tools. All tools require workspace context. ## Permissions [#permissions] | Permission | tools | | ----------------- | ----------------------------------------------------------------------------------------------------- | | `eventing.view` | `subscription_list`, `subscription_get`, `delivery_list`, `delivery_get`, `provider_list` | | `eventing.manage` | `subscription_create`, `_update`, `_disable`, `_rotate_secret`, `_test`, `_delete`; `delivery_cancel` | | `eventing.replay` | `delivery_replay`, `delivery_replay_failed` | Replay sends new outbound requests to your destinations and may trigger downstream automation — it carries its own permission, separate from `manage`. ## Subscriptions [#subscriptions] ### dome_webhooks_subscription_list [#dome_webhooks_subscription_list] List event subscriptions in the active workspace, each with its delivery destination. No parameters. > **Note**: Requires `eventing.view`. ### dome_webhooks_subscription_get [#dome_webhooks_subscription_get] Get an event subscription by name. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------- | | `name` | string | Yes | Subscription name | > **Note**: Requires `eventing.view`. ### dome_webhooks_subscription_create [#dome_webhooks_subscription_create] Create a subscription with its delivery destination and event selection, atomically. A failed request leaves neither record behind. The response includes the destination's signing secret **once** — it is only rotatable afterward, never readable. | Parameter | Type | Required | Description | | ---------------- | --------- | -------- | ----------------------------------------------------------------------------------------------------------------------- | | `name` | string | Yes | Subscription name (unique within workspace) | | `event_types` | string\[] | Yes | Event types to subscribe to (e.g. `["agent.suspend"]`) | | `endpoint_url` | string | One of | Custom HTTPS delivery endpoint. Set this or `provider`. | | `provider` | string | One of | Provider key from `dome_webhooks_provider_list`. Set this or `endpoint_url`. | | `settings` | object | No | Provider non-secret settings (key → value) | | `credentials` | object | No | Provider credentials (key → value). Stored write-only. | | `filters` | object | No | Per-key predicates — refer to [filters](#filters) | | `headers` | array | No | Custom-URL headers: `[{"name", "source": "literal"\|"secret", "value"}]`. Secret values are write-only, masked on read. | | `content_format` | string | No | Custom-URL body shape: `object` (default) or `array` | `endpoint_url`, `headers`, and `content_format` are custom-URL only — combining them with `provider` errors before any state change. > **Note**: Requires `eventing.manage`. ```json title="Example tool call" { "name": "dome_webhooks_subscription_create", "arguments": { "name": "security-alerts", "endpoint_url": "https://ops.example.com/hooks/dome", "event_types": ["agent.suspend", "agent.revoke"], "filters": { "result": "denied", "agent_name": ["checkout-worker", "billing-worker"] } } } ``` #### Filters [#filters] The `filters` object keys on a field name — envelope keys `stage`, `result`, `denial.reason`, and `error`; payload keys `agent_name`, `connection_name` (resolved from IDs at delivery time), `agent_id`, `tool_name`; or any filterable payload field. Values: | Value form | Meaning | | -------------------- | -------------------------------------------------------------------------------------- | | scalar | Exact match | | array | OR across alternatives | | `{"like": ""}` | Glob — `*` any run, `?` one char, `\` escapes. Matches the full value, case-sensitive. | An event delivers only if it satisfies every filter that applies to its type. ### dome_webhooks_subscription_update [#dome_webhooks_subscription_update] Update a subscription's events, filters, state, or delivery destination. Only supplied fields change. | Parameter | Type | Required | Description | | ----------------- | --------- | -------- | ------------------------------------------------------------------------------------- | | `name` | string | Yes | Current subscription name | | `new_name` | string | No | New name | | `event_types` | string\[] | No | Replace the full event-type set | | `filters` | object | No | Replace the full filter set; pass `{}` to clear | | `active` | boolean | No | Enable or pause fanout. No backfill on resume. | | `endpoint_url` | string | No | New custom HTTPS endpoint URL | | `endpoint_active` | boolean | No | Enable or disable the destination itself | | `headers` | array | No | Replace custom headers; `[]` clears them. Blank secret values keep the stored secret. | | `remove_headers` | string\[] | No | Header names to remove | | `content_format` | string | No | `object` or `array`. Custom URL only. | | `settings` | object | No | Replace the full provider settings set | | `credentials` | object | No | Merge write-only provider credentials | > **Note**: Requires `eventing.manage`. ### dome_webhooks_subscription_disable [#dome_webhooks_subscription_disable] Stop new fanout. Delivery history is preserved. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------- | | `name` | string | Yes | Subscription name | > **Note**: Requires `eventing.manage`. ### dome_webhooks_subscription_rotate_secret [#dome_webhooks_subscription_rotate_secret] Rotate the signing secret for the subscription's destination. The new secret is revealed once. During the grace window the `webhook-signature` header carries a signature per active key. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------- | | `name` | string | Yes | Subscription name | > **Note**: Requires `eventing.manage`. ### dome_webhooks_subscription_test [#dome_webhooks_subscription_test] Send a fixed `eventing.test` event through the subscription's destination. Verifies signing, headers, and the destination's own routing end-to-end. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------- | | `name` | string | Yes | Subscription name | > **Note**: Requires `eventing.manage`. ### dome_webhooks_subscription_delete [#dome_webhooks_subscription_delete] Delete the subscription: new routing stops and pending deliveries are canceled. Delivery history is preserved. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------- | | `name` | string | Yes | Subscription name | > **Note**: Requires `eventing.manage`. Destructive. ## Deliveries [#deliveries] ### dome_webhooks_delivery_list [#dome_webhooks_delivery_list] List deliveries in the active workspace, optionally filtered. | Parameter | Type | Required | Description | | ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------ | | `subscription_id` | string | No | Narrow to one subscription | | `destination_id` | string | No | Narrow to one destination | | `event_type` | string | No | Narrow to one event type | | `status` | string | No | One of `created`, `enqueued`, `delivering`, `retry_scheduled`, `succeeded`, `failed`, `canceled`, `expired`, `dlq` | | `event_id` | string | No | Every delivery for one source event | | `start_time` | string | No | Inclusive RFC3339 lower bound | | `end_time` | string | No | Inclusive RFC3339 upper bound | | `limit` | number | No | Page size (0 = server default) | | `page_token` | string | No | Cursor from a previous call | > **Note**: Requires `eventing.view`. ### dome_webhooks_delivery_get [#dome_webhooks_delivery_get] Get a delivery with its attempt history. | Parameter | Type | Required | Description | | -------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------- | | `delivery_id` | string | Yes | Delivery ID (UUID) | | `include_body` | boolean | No | Include the delivered webhook body while retained — up to 30 days, or 24 hours after a successful delivery. | > **Note**: Requires `eventing.view`. ### dome_webhooks_delivery_replay [#dome_webhooks_delivery_replay] Replay a delivery. Creates a **new** delivery from the retained body — fresh `webhook-id`, same `Dome-Event-Id` — and sends another request to the destination. It may trigger downstream automation. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ---------------------------- | | `delivery_id` | string | Yes | Delivery ID (UUID) to replay | > **Note**: Requires `eventing.replay`. ### dome_webhooks_delivery_replay_failed [#dome_webhooks_delivery_replay_failed] Bulk-replay terminally-failed deliveries in a time window — the outage-recovery counterpart to `delivery_replay`. Safe to re-run: a delivery with a live or succeeded replay is not matched again, and canceled deliveries are never recovered. | Parameter | Type | Required | Description | | -------------- | --------- | -------- | ---------------------------------------------------------------------------------------------------------------- | | `since` | string | Yes | Duration back from now (`24h`, `7d`) or RFC3339 timestamp. Within the last 30 days — the body-retention horizon. | | `subscription` | string | No | Narrow to one subscription name. Omit for all. | | `until` | string | No | RFC3339 upper bound. Defaults to now. | | `statuses` | string\[] | No | Subset of `failed`, `expired`, `dlq`. Default all three. | | `max` | number | No | Deliveries per call, up to 500. Repeat to continue. | > **Note**: Requires `eventing.replay`. ```json title="Example tool call" { "name": "dome_webhooks_delivery_replay_failed", "arguments": { "since": "24h", "subscription": "security-alerts", "statuses": ["failed", "dlq"] } } ``` Returns `matched`, `replayed`, `skipped (body expired)`, and `failed` counts. ### dome_webhooks_delivery_cancel [#dome_webhooks_delivery_cancel] Cancel a delivery's pending retry so no further outbound request is sent. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ---------------------------- | | `delivery_id` | string | Yes | Delivery ID (UUID) to cancel | > **Note**: Requires `eventing.manage`. Destructive. ## Providers [#providers] ### dome_webhooks_provider_list [#dome_webhooks_provider_list] List the off-the-shelf provider catalog: each provider's setting and credential fields, recommended event bundle, and authentication style. Call before `dome_webhooks_subscription_create` with `provider` to discover the required `settings` and `credentials`. No parameters. > **Note**: Requires `eventing.view`. > **Note**: **Dashboard-only views.** Delivery statistics live in the dashboard's Webhooks page. The event catalog is also available via [`dome audit catalog`](/operate/audit#browse-the-event-catalog) and MCP `dome_audit_catalog_*`. Agents list, inspect, and replay deliveries through the tools above. ## Next steps [#next-steps] Create destinations and subscriptions from Operate: * [Subscribe to Events](/operate/webhooks) * [Webhooks](/concepts/audit/webhooks) concept * [Event catalog](/reference/events/catalog) reference for the types you can subscribe to * [Event contracts](/reference/events/contracts#webhooks) reference for the webhook envelope and headers # Workspaces (/reference/mcp/workspaces)

{workspace}

Refer to [Environments](/manage/environments) for workspace setup. Refer to [Access](/manage/access) for members. These tools span three permission tiers: list and get are visible to any caller with an active context; member, act-as, freshness, and delete require workspace `workspaces.manage` or `config.manage`; creation requires tenant-level `tenants.manage`. ## Workspaces [#workspaces] ### dome_workspaces_list [#dome_workspaces_list] List all workspaces in the current tenant. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | > **Note**: Authenticated only — visible to any caller with an active context. The server returns only the workspaces the caller actually has access to. ```json title="Example tool call" { "name": "dome_workspaces_list" } ``` ### dome_workspaces_create [#dome_workspaces_create] Create a new workspace in the current tenant. The server auto-generates a URL-safe slug from the display name. | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------- | | `name` | string | Yes | Workspace display name | | `join_policy` | string | No | How non-members join: `open`, `request`, or `invite_only`. Omit to take the server default (`invite_only`). | > **Note**: Requires tenant-level `tenants.manage` (held by tenant `admin`, or by org `owner` / `admin` via cascade). Workspace-only roles cannot create workspaces. ```json title="Example tool call" { "name": "dome_workspaces_create", "arguments": { "name": "staging", "join_policy": "request" } } ``` Unknown `join_policy` values return `InvalidArgument`. See [Join policies](/manage/environments#join-policies). ### dome_workspaces_get [#dome_workspaces_get] Get a single workspace in the current tenant. Accepts a UUID or a slug; defaults to the active workspace when omitted. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | -------------------------------------------------------------- | | `workspace` | string | No | Workspace ID (UUID) or slug. Defaults to the active workspace. | > **Note**: Authenticated only — visible to any caller with an active context. The server enforces that the caller can read the requested workspace. ### dome_workspaces_delete [#dome_workspaces_delete] Delete a workspace from the current tenant. Accepts a UUID or a slug. Marked destructive. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | --------------------------- | | `workspace` | string | Yes | Workspace ID (UUID) or slug | > **Note**: Requires `workspaces.manage`. ### dome_workspaces_rename [#dome_workspaces_rename] Rename a workspace display name. Its slug does not change. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------------- | | `workspace` | string | Yes | Workspace UUID or slug | | `name` | string | Yes | New display name | > **Warning**: Workspace deletion is permanent and cannot be undone. ## Act-as [#act-as] Act-as enforcement controls whether agents must present verified end-user identity on every request. ### dome_workspaces_actas_get [#dome_workspaces_actas_get] Get the current act-as enforcement policy for the active workspace. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | > **Note**: Requires `config.manage`. Returns whether act-as is required and which verification methods are allowed. ### dome_workspaces_actas_update [#dome_workspaces_actas_update] Update the act-as enforcement policy for the active workspace. | Parameter | Type | Required | Description | | ----------------------- | ----- | -------- | ---------------------------------------------------------------------------- | | `actas_required` | bool | No | Require act-as header on all requests | | `actas_allowed_methods` | array | No | Allowed verification methods (e.g., `["oidc", "hmac"]`). Empty = any method. | > **Note**: Requires `config.manage`. ```json title="Example tool call" { "name": "dome_workspaces_actas_update", "arguments": { "actas_required": true, "actas_allowed_methods": ["oidc"] } } ``` > **Warning**: Enabling act-as enforcement affects all agents in the workspace. Agents without a configured act-as method are rejected. ## Freshness [#freshness] Each workspace has a configurable freshness window that bounds how long the gateway may serve cached authorization policy before failing closed. Default is 90 seconds; range is 30–86400 seconds. Enforcement is per-workspace — one workspace failing closed does not affect others. ### dome_workspaces_set_freshness_window [#dome_workspaces_set_freshness_window] Set the freshness window for the active workspace. | Parameter | Type | Required | Description | | --------- | ------ | -------- | -------------------------------------- | | `seconds` | number | Yes | Freshness window in seconds (30–86400) | > **Note**: Requires `config.manage`. ```json title="Example tool call" { "name": "dome_workspaces_set_freshness_window", "arguments": { "seconds": 120 } } ``` > **Warning**: Once the window elapses, the gateway denies governed requests until policy is fresh. The affected `tool.call` or `model.call` completes with `result=denied` and `denial.reason=stale_policy`; there is no separate staleness-denied event. ## Members [#members] ### dome_workspaces_members_list [#dome_workspaces_members_list] List all members of the active workspace with their roles. | Parameter | Type | Required | Description | | --------- | ---- | -------- | ------------- | | — | — | — | No parameters | > **Note**: Requires `workspaces.manage`. Returns each member with their email, role, and join date. ### dome_workspaces_members_set [#dome_workspaces_members_set] Grant or update a user's role in the active workspace. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------------------------------------- | | `user_email` | string | Yes | User email address | | `role` | string | Yes | Role: `admin`, `operator`, `security`, `viewer` | > **Note**: Requires `workspaces.manage`. ```json title="Example tool call" { "name": "dome_workspaces_members_set", "arguments": { "user_email": "alice@example.com", "role": "operator" } } ``` ### dome_workspaces_members_remove [#dome_workspaces_members_remove] Remove a user from the active workspace. Optionally revoke their API keys at the same time by passing `revoke_key_ids` (specific IDs) or `revoke_all_keys=true`. If neither is passed and the user has active keys, the response lists them so the caller can decide which to revoke. Marked destructive. | Parameter | Type | Required | Description | | ----------------- | ------ | -------- | --------------------------------------------------------------------------------------- | | `user_email` | string | Yes | User email address | | `revoke_key_ids` | array | No | API key IDs to revoke alongside the removal. Mutually exclusive with `revoke_all_keys`. | | `revoke_all_keys` | bool | No | Revoke all API keys created by the user. Mutually exclusive with `revoke_key_ids`. | > **Note**: Requires `workspaces.manage`. ### dome_members_removal_preview [#dome_members_removal_preview] Preview the memberships, API keys, and possible orphaned workspaces affected by removing people at an organization, tenant, or workspace scope. Use this before a removal that can cascade. | Parameter | Type | Required | Description | | ------------- | --------------- | -------- | ------------------------------------------ | | `user_emails` | array of string | Yes | People to remove | | `scope_kind` | string | No | `org`, `tenant`, or `workspace` (default) | | `scope_id` | string | No | Scope ID; defaults to the active workspace | ## Verification providers [#verification-providers] ### dome_verification_providers_generate_secret [#dome_verification_providers_generate_secret] Create an HMAC secret for a new workspace-scoped verification provider. The plaintext secret is returned once; retain the returned `secret_ref` for `dome_verification_providers_create`. ### dome_verification_providers_update [#dome_verification_providers_update] Update a workspace-scoped verification provider. You can change its name, OIDC configuration, required claims, claim mappings, or HMAC secret. Replacing an HMAC secret invalidates assertions signed by the old one immediately. | Parameter | Type | Required | Description | | ------------------------------------------------------ | ------------- | -------- | ---------------------------------- | | `provider_id` | string | Yes | Provider UUID | | `name`, `oidc_discovery_url`, `oidc_expected_audience` | string | No | Updated provider fields | | `oidc_required_claims`, `oidc_claim_mappings` | object, array | No | Replacement OIDC configuration | | `hmac_secret` | string | No | Replacement write-only HMAC secret | ## Next steps [#next-steps] Tenancy and membership how-tos live under Manage: * [Prepare Environments](/manage/environments) * [Manage Access](/manage/access) * [Scopes](/concepts/platform/scopes) concept # Adapters (/sdks/python/adapters) Adapters wrap `dome.Client` for a specific AI framework so tool execution and LLM calls flow through Dome with no extra glue. Install the adapter alongside the core `dome-sdk` package — adapters version and release independently. ## Available adapters [#available-adapters] | Package | Install | Framework | | --------------------------- | ----------------------------------------- | ---------------------------- | | `dome-langchain` | `pip install dome-langchain` | LangChain (`langchain-core`) | | `dome-langchain[openai]` | `pip install 'dome-langchain[openai]'` | + `DomeChatOpenAI` | | `dome-langchain[anthropic]` | `pip install 'dome-langchain[anthropic]'` | + `DomeChatAnthropic` | ## LangChain [#langchain] `dome-langchain` exposes three surfaces over `dome.Client`: * **Gateway tools** — `DomeGatewayTool` / `gateway_tool` invoke MCP tools through the Dome gateway as native LangChain tools. * **Governed local tools** — `DomeGovernedTool` / `govern_tools` wrap existing LangChain tools so every call passes through a local `client.check()` before execution. Requires `client.start_policy_sync()`. * **Governed chat models** — `DomeChatOpenAI` and `DomeChatAnthropic` are provider subclasses that route every LLM call through the Dome gateway under an agent identity, with per-call `act_as`. ### Install [#install] ```bash pip install dome-langchain ``` The core package depends on `dome-sdk` and `langchain-core`. Install `dome-langchain[openai]` or `dome-langchain[anthropic]` to enable the chat-model classes. ### Gateway tools [#gateway-tools] Use `DomeGatewayTool` when the tool already lives behind the Dome gateway. The adapter calls `client.gateway.tools.call()` — authorization, credential resolution, and audit all happen server-side. `gateway_url` must include the `/gateways/{id}` segment naming the agent's [Gateway](/sdks/python/reference#gateways). A bare-root URL fails at `connect()` with `DomeGatewayConfigurationError`. ```python import dome from dome_langchain import DomeGatewayTool client = dome.Client( token="{{AGENT_TOKEN}}", gateway_url="https://gateway.domesystems.ai/gateways/{{GATEWAY_ID}}", act_as_method="none", ) client.connect() search = DomeGatewayTool( dome_client=client, name="github/list_issues", description="List GitHub issues", act_as=dome.PlainActAs(email="alice@corp.com"), ) ``` Build a list from the gateway catalog with `gateway_tools_from_catalog`: ```python from dome_langchain import gateway_tools_from_catalog catalog = client.gateway.tools.list(act_as=user) tools = gateway_tools_from_catalog(client, catalog.tools, act_as=user) ``` | Symbol | Signature | Purpose | | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | | `DomeGatewayTool` | `DomeGatewayTool(*, dome_client, name, description="", gateway_tool_name=None, act_as=None, raise_on_tool_error=True)` | Wrap one gateway MCP tool as a LangChain `BaseTool` | | `gateway_tool` | Factory returning a `DomeGatewayTool` | Same args as the constructor | | `gateway_tools_from_catalog` | `(client, tools, *, act_as=None, raise_on_tool_error=True)` | Build a list from `client.gateway.tools.list()` results | Bind a per-user default with `tool.with_act_as(user)`. Pass `dome_act_as=` on a single invocation to override for that call. ### Governed local tools [#governed-local-tools] Use `govern_tools` to wrap LangChain tools that run in-process. The wrapper calls `client.check()` (local Cedar) and either runs the inner tool or returns a denial string the agent sees as the tool's output. ```python import dome from dome_langchain import govern_tools from langchain.agents import create_agent client = dome.Client( token="{{AGENT_TOKEN}}", control_plane_url="https://api.domesystems.ai", ) client.connect() client.start_policy_sync() governed = govern_tools(client, [search_tool, db_tool]) agent = create_agent(model, tools=governed) ``` | Symbol | Signature | Purpose | | ------------------ | ------------------------------------------------------------------------------------- | ---------------------------------------------- | | `DomeGovernedTool` | `DomeGovernedTool(*, tool, dome_client, action="mcp:call", resource_type="mcp_tool")` | Wrap one LangChain tool with a local pre-check | | `govern_tools` | `(dome_client, tools, *, action="mcp:call", resource_type="mcp_tool")` | Wrap a list of tools | For non-MCP tools, override `action` and `resource_type` to match the Cedar entity types in your rules. ### Governed chat models [#governed-chat-models] `DomeChatOpenAI` and `DomeChatAnthropic` are subclasses of `ChatOpenAI` and `ChatAnthropic` whose requests flow through the Dome gateway. They `isinstance`-check, compose in LCEL, stream, tool-call, and produce structured output exactly like the upstream class. ```python from dome_langchain import AgentIdentity, DomeChatOpenAI llm = DomeChatOpenAI.for_agent( agent, # any object with .token and .gateway_url model="prod-gpt", act_as=dome.PlainActAs(email="alice@corp.com"), ) llm.invoke("Summarize the open incidents") # default act_as llm.invoke("Hello", act_as=other_user) # per-call override per_user = llm.with_act_as(other_user) # bind once, reuse ``` The construction-time `act_as` is a default; any `invoke` / `stream` / `batch` call may override it. The header rides on that one request only. The agent's `gateway_url` must be the complete `/gateways/{id}` URL returned by key creation or token exchange. A chat model's `base_url` is fixed for the life of the instance, so one chat instance maps to one gateway. A missing or unscoped value raises `DomeGatewayConfigurationError` at construction. ```python import dome from dome_langchain import AgentIdentity, DomeChatOpenAI identity = AgentIdentity( token="{{AGENT_TOKEN}}", gateway_url="https://gateway.domesystems.ai/gateways/{{GATEWAY_ID}}", ) llm = DomeChatOpenAI.for_agent(identity, model="prod-gpt") ``` | Symbol | Purpose | | --------------------------------------------- | ------------------------------------------------------------ | | `DomeChatOpenAI` | `ChatOpenAI` subclass routed through the Dome LLM gateway | | `DomeChatAnthropic` | `ChatAnthropic` subclass routed through the Dome LLM gateway | | `broker_chat(...)` / `broker_chat_for(agent)` | Factory equivalents that return a `DomeChatOpenAI` | | `broker_chat_anthropic(...)` | Factory for `DomeChatAnthropic` | ### Compose primitives [#compose-primitives] `dome-langchain` also ships chain primitives for building governed topologies on top of Dome identity: | Symbol | Purpose | | ------------------------------------------- | ------------------------------------------------------- | | `Gate` | A `Runnable` that runs a Cedar check at a node boundary | | `mint_ephemeral` / `session` | Spawn short-lived agent identities for fan-out runs | | `causal` / `current_causal_run_id` | Bind a causal run ID to a chain | | `gate_edge` / `gate_command` / `fleet_send` | LangGraph shims that gate transitions between nodes | ```python from dome_langchain import gate_edge g.add_conditional_edges( "classifier", gate_edge( dome_client=client, from_node="classifier", to_node="retriever", resource="chain.hop_allowed", ), ) ``` #### Scope spawned children to a Gateway [#scope-spawned-children-to-a-gateway] `mint_ephemeral`, `session`, and `FleetSession.spawn` accept `gateway_id`. Key creation selects that gateway and returns its complete URL, so every child carries a call-ready `gateway_url` for `broker_chat_for(child)`. ```python from dome_langchain import session with session( platform=admin, parent_agent_id=parent.id, gateway_id="{{GATEWAY_ID}}", ) as fleet: children = fleet.spawn(count=4, template="analyst") # Each child.gateway_url is complete and call-ready. ``` If a returned gateway ID or endpoint conflicts with the requested selection, the adapter fails closed with `DomeGatewayConfigurationError`. Refer to [Gateways](/sdks/python/reference#gateways). ## Build a new adapter [#build-a-new-adapter] Adapters live alongside the core SDK in `packages/dome-/` within `sdk-dome-python`. Each is its own PyPI package depending on `dome-sdk` and the target framework. Use `packages/dome-langchain/` as the reference implementation. ## Next steps [#next-steps] * [Python reference](/sdks/python/reference) for Client, act-as, and gateway calls * [SDKs](/sdks) for when to use the SDK versus raw gateway calls * [Gateways](/build/gateways) to attach membership and grants * [Examples](/tutorials/examples) for working agents you can clone # Quickstart (/sdks/python/quickstart) Call MCP tools and LLM models through the Dome gateway from a Python application. The SDK handles authentication, act-as encoding, audit correlation, and typed error decoding — your code talks to one client. > **Note**: **Prerequisites:** > > * Python 3.12+ > * A registered agent and an agent API key (`dome_...`) — refer to [Developer Quickstart](/tutorials/role/developer) > * The gateway URL for the [Gateway](/sdks/python/reference#gateways) the agent is granted (`https://gateway.../gateways/{id}`) ## Install [#install] ```bash pip install dome-sdk ``` Provider SDKs are optional. `client.gateway.openai_client()` lazy-imports `openai`; `client.gateway.anthropic_client()` lazy-imports `anthropic`. Install those packages only in agents that use the provider-native factories. ## Initialize [#initialize] Construct a `Client` with the agent token and gateway URL. The SDK does not read environment variables — pass values directly. ```python import dome client = dome.Client( token="{{AGENT_TOKEN}}", gateway_url="https://gateway.domesystems.ai/gateways/{{GATEWAY_ID}}", act_as_method="none", ) client.connect() ``` The `/gateways/{id}` segment names the gateway the agent is granted. Pass the complete URL returned by agent-key creation or token exchange. Bare roots and URLs ending in `/mcp` or `/v1` raise `DomeGatewayConfigurationError` at `connect()` — the SDK does not compose a customer URL from an infrastructure endpoint. `connect()` prepares token and transport state. It does not block on local policy sync — call `start_policy_sync()` only when you want in-process Cedar checks. ## Call a tool [#call-a-tool] `client.gateway.tools.call()` runs an MCP tool through the gateway. Authorization, credential resolution, and audit happen server-side. ```python result = client.gateway.tools.call( "github/list_issues", {"repo": "dome"}, act_as=dome.PlainActAs(email="alice@corp.com"), ) print(result.structured_content or result.content) ``` `result.content` is the raw tuple of MCP content blocks. By default, an upstream `isError=true` result raises `DomeToolExecutionError`. Pass `raise_on_tool_error=False` when you need the failed `ToolCallResult` and its partial content. ## Call an LLM [#call-an-llm] `client.gateway.llm.chat()` posts OpenAI-shaped chat requests through the gateway. The response is the provider-shaped dict. ```python response = client.gateway.llm.chat( model="prod-gpt", messages=[{"role": "user", "content": "Summarize the open incidents"}], act_as=dome.PlainActAs(email="alice@corp.com"), ) ``` For Anthropic shapes, use `client.gateway.llm.messages(model=..., messages=..., max_tokens=...)`. For provider-native clients, refer to [Reference](/sdks/python/reference#provider-native-clients). ## Correlate work with an activity [#correlate-work-with-an-activity] Wrap a run in `client.activity(...)` to stamp every gateway call and audit event with the same opaque activity ID. ```python with client.activity(metadata={"case": "incident-123"}) as activity: client.gateway.tools.call("github/list_issues", {"repo": "dome"}) print("activity_id:", activity.activity_id) ``` Direct calls outside an activity carry no activity ID. The SDK never mints one implicitly. ## Shut down [#shut-down] Always close the client to release transports. ```python client.close() ``` Or use the context manager form: ```python with dome.Client(token=..., gateway_url=...) as client: client.gateway.tools.call("github/list_issues", {"repo": "dome"}) ``` ## Next steps [#next-steps] * [Reference](/sdks/python/reference): Full client configuration, act-as methods, errors, and audit reads. * [Tutorial](/sdks/python/tutorial): Wire the SDK into a service and verify in audit. * [LangChain adapter](/sdks/python/adapters): Use gateway tools and governed chat models inside LangChain agents. * [Data plane concepts](/concepts/architecture/dataplane): How the gateway authorizes, resolves credentials, and audits every call. # Reference (/sdks/python/reference) Complete reference for the `dome-sdk` package on PyPI (imported as `dome`). All configuration is explicit — the SDK does not read environment variables. ## Client construction [#client-construction] The SDK ships two clients with identical surfaces: `dome.Client` (sync) and `dome.AsyncClient` (async). Both accept keyword arguments only. | Argument | Type | Default | Description | | ---------------------- | ----------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | `token` | `str` | required | agent API key (`dome_...`) or exchanged JWT | | `control_plane_url` | `str \| None` | `None` | Dome control-plane URL. Required for token exchange, audit reads, local policy sync | | `gateway_url` | `str \| None` | `None` | Complete gateway URL, including `/gateways/{id}`. Bare roots and protocol-suffixed URLs fail at `connect()` with `DomeGatewayConfigurationError` | | `gateway_id` | `str \| None` | `None` | gateway UUID to select during token exchange. Omission succeeds only when the agent can access exactly one gateway | | `gateway_auth_mode` | `"auto" \| "raw" \| "exchange"` | `"auto"` | gateway bearer source. `auto` uses the raw `dome_*` key when `gateway_url` is set | | `act_as_method` | `"none" \| "hmac" \| "oidc" \| "bound" \| None` | `None` | gateway act-as method. Required when the SDK cannot discover it from the control plane | | `request_timeout` | `float` | `30.0` | Per-request HTTP timeout | | `tools_list_cache_ttl` | `float` | `30.0` | In-memory `tools/list` cache TTL | | `rule_sync_interval` | `float` | `30.0` | Local policy sync interval (only used when `start_policy_sync()` runs) | | `audit_batch_size` | `int` | `100` | Legacy local audit buffer size | | `audit_flush_interval` | `float` | `5.0` | Legacy local audit drain interval | ```python import dome client = dome.Client( token="{{AGENT_TOKEN}}", gateway_url="https://gateway.domesystems.ai/gateways/{{GATEWAY_ID}}", control_plane_url="https://api.domesystems.ai", act_as_method="none", ) client.connect() ``` `gateway_url` names the [gateway](#gateways) this client uses (`/gateways/{uuid}`). A client maps to one gateway; there is no implicit global endpoint. `connect()` validates the URL and verifies that `gateway_id`, when supplied, names the same gateway. `connect()` prepares credentials and transport. It performs a token exchange when needed for control-plane discovery, but never blocks on local Cedar sync. ## Gateways [#gateways] A gateway is a workspace-scoped grouping of MCP tools and LLM models with its own access grants and protocol endpoints. The SDK accepts only a complete scoped URL: | Surface | URL | | ---------------------- | ------------------------------------------------------- | | SDK and Anthropic base | `https://gateway.example.com/gateways/{gateway-id}` | | MCP | `https://gateway.example.com/gateways/{gateway-id}/mcp` | | OpenAI-compatible base | `https://gateway.example.com/gateways/{gateway-id}/v1` | Agent-key creation and token exchange return a `GatewayEndpoints` object containing all four call-ready values. Use `gateway_url` as returned; do not derive it from a bare data-plane host. If the client has `control_plane_url`, pass `gateway_id` to select a gateway during exchange. Omission succeeds only when the agent can access exactly one gateway; the workspace default marker does not resolve ambiguity. The tools-list cache is keyed by the complete gateway URL, agent, workspace, and act-as identity, so clients pointed at different gateways never share entries. Find IDs with `dome gateways list`, the dashboard, or the [admin surface](#gateway-admin). ## Client surface [#client-surface] | Member | Description | | ---------------------------- | ----------------------------------------------------------------------------- | | `client.gateway` | gateway data-plane API. Tools, models, LLM helpers, provider client factories | | `client.audit` | Control-plane audit reads. Requires `control_plane_url` | | `client.activity(...)` | Open an [activity context](#activity-correlation) for correlated calls | | `client.evaluate(...)` | Run a local Cedar evaluation. Requires `start_policy_sync()` | | `client.check(...)` | Callback-based local Cedar check. Requires `start_policy_sync()` | | `client.start_policy_sync()` | Start background Cedar bundle sync for in-process checks | | `client.connect()` | Prepare credentials. Idempotent | | `client.close()` | Release transports, stop background sync, drain pending audit | | `client.gateway_url` | Complete selected gateway URL, or `""` before discovery | `AsyncClient` exposes the same members; methods marked synchronous below have async counterparts on `AsyncClient`. ## Gateway tools [#gateway-tools] `client.gateway.tools` is the MCP tool client. | Method | Description | | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | `list(*, act_as=None, refresh=False, ttl_seconds=None) -> ToolsListResult` | List MCP tools. Real gateway call unless served from the in-memory cache | | `list_cached(*, act_as=None, ttl_seconds=None) -> ToolsListResult` | Cache-preferred read (calls `list` with `refresh=False`; refreshes when the entry is missing or expired) | | `invalidate_cache(*, act_as=None)` | Drop one cache entry or all entries | | `call(name, arguments=None, *, act_as=None, activity_id=None, raise_on_tool_error=True) -> ToolCallResult` | Invoke an MCP tool | `tools/list` can do real work: upstream discovery, per-user authorization, audit emission, and credential-link generation. The SDK never does an implicit list-before-call. ```python catalog = client.gateway.tools.list(refresh=True, act_as=user) for tool in catalog.tools: print(tool.name, tool.description) ``` A per-user connection the end user hasn't connected is listed by its published tools. Calling one raises `DomeCredentialRequired`, whose `provision_url` is the sign-in link to give that user. The cache is in-memory, bounded, and keyed by gateway root URL, agent fingerprint, workspace, act-as method, and an act-as header hash. Cache hits do not call the gateway and do not emit gateway audit. ### Calling a tool [#calling-a-tool] ```python result = client.gateway.tools.call( "github/list_issues", {"repo": "dome"}, act_as=dome.PlainActAs(email="alice@corp.com"), ) if result.is_error: print("upstream tool error:", result.structured_content or result.content) else: print(result.structured_content or result.content) ``` `call()` distinguishes JSON-RPC errors from MCP tool errors. JSON-RPC errors raise typed `DomeGatewayError` subclasses. If the upstream tool returns `isError=true`, the SDK raises `DomeToolExecutionError` by default. Pass `raise_on_tool_error=False` to receive `ToolCallResult(is_error=True)` instead. ### Reading tool results [#reading-tool-results] `ToolCallResult` exposes convenience accessors so you do not have to walk the MCP content array by hand. | Accessor | Description | | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | `result.text` | Concatenate every `type=text` content block, newline-separated | | `result.first_text(default="")` | First `type=text` block, or `default` when there is none | | `result.json()` | Return `structured_content` when set; otherwise parse `text` as JSON. Raises `DomeToolExecutionError` when neither is available | | `result.require_success()` | Raise `DomeToolExecutionError` when `is_error=True`; otherwise return the result for chaining | ```python result = client.gateway.tools.call( "github/list_issues", {"repo": "dome"}, act_as=user, ).require_success() issues = result.json() summary = result.first_text("no summary returned") ``` ## Gateway LLM [#gateway-llm] `client.gateway.llm` posts OpenAI- and Anthropic-shaped requests through the Dome LLM ingress and decodes structured Dome errors. | Method | Description | | -------------------------------------------------------------------------------------- | ----------------------------- | | `chat(*, model, messages, act_as=None, **kwargs) -> Mapping[str, Any]` | OpenAI `/v1/chat/completions` | | `messages(*, model, messages, max_tokens, act_as=None, **kwargs) -> Mapping[str, Any]` | Anthropic `/v1/messages` | ```python response = client.gateway.llm.chat( model="prod-gpt", messages=[{"role": "user", "content": "Summarize the open incidents"}], act_as=dome.PlainActAs(email="alice@corp.com"), ) ``` For a typed handle around one model, use `client.gateway.model(...)`: ```python model = client.gateway.model("prod-claude", provider="anthropic", act_as=user) message = model.messages.create( messages=[{"role": "user", "content": "Draft a status update"}], max_tokens=512, ) ``` ### Provider-native clients [#provider-native-clients] For teams that want provider-native APIs, the gateway hands back a configured `openai`/`anthropic` client pointed at the Dome ingress: ```python openai_client = client.gateway.openai_client(act_as=user) completion = openai_client.chat.completions.create( model="prod-gpt", messages=[{"role": "user", "content": "Hello"}], ) ``` Provider factories return provider-shaped clients and do not promise typed Dome exceptions unless Dome owns the transport for that path. Use `client.gateway.llm.*` or `client.gateway.model(...)` when you want SDK-owned typed error decoding. ## Gateway readiness [#gateway-readiness] `client.gateway.wait_ready()` polls unauthenticated `GET /ready` and is an explicit diagnostic helper — not a startup requirement. ```python client.gateway.wait_ready(timeout=30) ``` For freshly created agent keys, use `dome.wait_for_agent_key(...)` or `dome.bootstrap.ensure_agent(..., wait_gateway=True)` in setup scripts to wait for the gateway's synced API-key snapshot. ## Act-as [#act-as] The gateway act-as trust model is driven by Dome configuration, not by the client choosing a header shape. Pass the SDK value that matches the gateway method: | SDK value | gateway method | Header behavior | | ---------------------------------------- | -------------- | ------------------------------------------------------ | | `PlainActAs(...)` or legacy `ActAs(...)` | `none` | Canonical JSON, standard-base64 encoded | | `HMACActAs(secret=..., ...)` | `hmac` | Signed, timestamped, base64 encoded | | `OIDCActAs(jwt=...)` or raw JWT string | `oidc` | Raw JWT evidence | | `BoundActAs()` or no `act_as` | `bound` | No client act-as header; server-bound identity is used | ```python # Plain caller-asserted identity user = dome.PlainActAs(email="alice@corp.com", roles=("admin",)) # Verified OIDC delegation user = dome.OIDCActAs(jwt="eyJ...") # HMAC-signed identity user = dome.HMACActAs(secret=hmac_secret, email="alice@corp.com") ``` For `bound`, the SDK fails closed if caller code tries to send an act-as header. ## Activity correlation [#activity-correlation] Wrap a run in an activity context to stamp every gateway call and audit event with the same opaque activity ID. ```python with client.activity(metadata={"case": "incident-123"}) as activity: client.gateway.tools.call("github/list_issues", {"repo": "dome"}) page = client.audit.query(event_types=("tool.call",)) print(activity.activity_id) ``` Direct calls outside an activity carry no activity ID — the SDK never mints one implicitly. To thread an ID across processes, mint an opaque ID and put human-readable labels in metadata: ```python activity_id = dome.new_activity_id() with client.activity(activity_id, metadata={"job": "nightly-batch"}) as activity: ... ``` `AuditEventV1.correlation.activity_id` and `activity_trust` surface the stamp on each event. ### `dome.new_activity_id() -> str` [#domenew_activity_id---str] Mint a fresh UUIDv4 activity ID. Use when persisting an ID for later correlation. Equivalent to the ID `client.activity()` mints when none is passed. ## Audit reads [#audit-reads] `client.audit` queries the hosted Audit v1 read APIs through the configured control plane. The SDK does not write hosted audit events — gateway and control-plane services do that. | Method | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- | | `client.audit.query(query \| **filters) -> AuditQueryResponse` | Cursor-paginated query with time-range, actor, producer/surface, operation, resource, and payload filters | | `client.audit.get(event_id) -> AuditEventV1` | Fetch a single normalized event by ID | | `client.audit.stream(query \| **filters) -> Iterator[AuditEventV1]` | Server-stream events using the Connect JSON streaming protocol | | `client.audit.find_gateway_events(*, activity_id="", workspace_id=None, event_types=(), type_prefix="", page_size=50) -> tuple[AuditEventV1, ...]` | One-shot query scoped to gateway events, optionally filtered by activity and event-type prefix | | `client.audit.wait_for_activity(activity_id, *, timeout=30.0, interval=0.5, event_types=(), type_prefix="", page_size=50) -> tuple[AuditEventV1, ...]` | Poll until at least one matching event lands, or raise `TimeoutError` | ```python from dome import AuditPayloadFilter, AuditQuery page = client.audit.query( AuditQuery( event_types=("model.call",), results=("RESULT_ALLOWED",), producer_service="gateway", request_surface="INITIATOR_SURFACE_GATEWAY_LLM", start_time="2026-06-23T00:00:00Z", end_time="2026-06-24T00:00:00Z", payload_filters=( AuditPayloadFilter(field="model", values=("prod-gpt",)), ), page_size=50, ) ) for event in page.events: print(event.type, event.correlation.activity_id, event.payload) ``` `AuditQuery` enum fields use the proto JSON enum names (for example `RESULT_ALLOWED`, `ACTOR_KIND_AGENT`, `INITIATOR_SURFACE_GATEWAY_MCP`). `stream` rejects query-only filters (`agent_ids`, `primary_resource_id`, `primary_resource_kind`, `trace_id`, `activity_id`, `workspace_id`, `start_time`, `end_time`, `page_size`) at call time instead of silently dropping them. > **Warning**: The current Python SDK does not expose the Audit schema-v4 `stages`, `deny_reasons`, or `has_error` query filters. Use the [CLI](/cli/operate/audit), [MCP tools](/reference/mcp/audit), or Audit API when a query depends on those filters. They will be documented here after the SDK adds them. ### Waiting on activity events [#waiting-on-activity-events] Gateway audit lands asynchronously. Use `wait_for_activity` in tests and post-run verification to block until the events you correlated under an activity ID are visible. ```python with client.activity() as run: client.gateway.tools.call("github/list_issues", {"repo": "dome"}, act_as=user) events = client.audit.wait_for_activity( run.activity_id, type_prefix="tool.", timeout=10.0, ) assert any(event.type == "tool.call" for event in events) ``` `find_gateway_events` is the non-blocking form — it issues one query and returns whatever is already visible. Both helpers default the workspace to the client's authenticated workspace; pass `workspace_id=` to scope a platform-key reader explicitly. ### Audit envelope [#audit-envelope] `AuditEventV1` is the normalized read-side envelope returned by every audit read method. | Sub-block | Fields | | --------------------- | --------------------------------------------------------------------------------------------------------------- | | `AuditScope` | `kind`, `org_id` (alias `organization_id`), `tenant_id`, `workspace_id`, `agent_id` | | `AuditActor` | `kind`, `id`, `email`, `display` | | `AuditResourceRef` | `kind`, `id`, `name`, `tenant_id`, `workspace_id` | | `AuditProducer` | `service`, `instance_id`, `version`, `region` | | `AuditRequestSurface` | `surface`, `rpc_service`, `rpc_method`, `http_route`, `user_agent_class` | | `AuditCorrelation` | `trace_id`, `request_id`, `operation_id`, `parent_event_id`, `idempotency_key`, `activity_id`, `activity_trust` | | `AuditDataHandling` | `omitted`, `summarized`, `truncated`, `redacted`, `hashed`, `encrypted`, `content_ref_used` | ## Local policy checks [#local-policy-checks] In-process Cedar evaluation is still available when an agent needs a fast, self-enforced decision. Local checks are opt-in — they require `start_policy_sync()` and a `control_plane_url`. ```python client = dome.Client( token="{{AGENT_TOKEN}}", control_plane_url="https://api.domesystems.ai", ) client.start_policy_sync() decision = client.evaluate(tool="database/query", action="mcp:call") if decision.allowed: run_query() ``` For the two most common MCP decisions, use the typed shortcuts. Both wrap `evaluate()` with `resource_type="mcp_tool"` and the right action verb. | Method | Action | Use when | | -------------------------------------------------------------------- | -------------- | --------------------------------------------------- | | `client.evaluate_tool_call(tool, *, context=None, act_as=None)` | `mcp:call` | Gating an `invoke`/`call` before running it | | `client.evaluate_tool_discovery(tool, *, context=None, act_as=None)` | `mcp:discover` | Filtering a `tools/list` response before showing it | ```python decision = client.evaluate_tool_call("database/query", act_as=user) if not decision.allowed: raise PermissionError(decision.reason) visible = [ tool for tool in catalog.tools if client.evaluate_tool_discovery(tool.name, act_as=user).allowed ] ``` The callback form mirrors the Go SDK: ```python client.check( tool="database/query", action="mcp:call", on_allow=lambda result: run_query(), on_deny=lambda req, reason: log.warning("denied: %s", reason), ) ``` | Argument | Type | Default | Description | | --------------- | ------------------------------------ | ------------ | ---------------------------------------- | | `tool` | `str` | required | Resource being accessed | | `on_allow` | `Callable[[CheckResult], Any]` | required | Invoked on allow | | `on_deny` | `Callable[[CheckRequest, str], Any]` | required | Invoked with `(request, reason)` on deny | | `action` | `str` | `""` | Defaults to `mcp:call` if empty | | `context` | `dict[str, str] \| None` | `None` | Cedar attributes | | `act_as` | `ActAs \| str \| None` | `None` | End-user identity | | `resource_type` | `str` | `"mcp_tool"` | Cedar resource entity type | ## Admin client [#admin-client] `DomeAdminClient` is the workspace-scoped provisioning surface. Use it from orchestrator code or setup scripts to register agents, issue keys, deploy Cedar bundles, and configure gateway MCP and LLM connections. It authenticates with a workspace platform key (`dome_pk_...`) — not an agent token — and every call hits the control plane. `Client` and `DomeAdminClient` are separate on purpose: `Client` is the runtime agent surface (authorization, audit reads, gateway calls); `DomeAdminClient` is the admin surface that *creates* the agents `Client` runs as. ```python from dome import DomeAdminClient, AgentActAsConfig with DomeAdminClient( base_url="https://api.domesystems.ai", platform_key="{{PLATFORM_KEY}}", workspace_id="{{WORKSPACE_ID}}", ) as admin: agent = admin.register_agent( name="incident-bot", act_as_config=AgentActAsConfig(method="oidc", required=True), allowed_tools=["github/list_issues"], allowed_gateway_ids=["{{GATEWAY_ID}}"], ) key = admin.ensure_agent_key( agent_id=agent.id, name="default", gateway_id="{{GATEWAY_ID}}", ) print(key.token, key.gateway_url) ``` ### Constructor [#constructor] | Argument | Type | Default | Description | | -------------- | ------- | -------- | -------------------------------------- | | `base_url` | `str` | required | Control-plane URL | | `platform_key` | `str` | required | Workspace platform key (`dome_pk_...`) | | `workspace_id` | `str` | required | Workspace UUID the key is scoped to | | `timeout` | `float` | `30.0` | Per-request HTTP timeout | ### Agent registry [#agent-registry] | Method | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `register_agent(*, name, parent_id=None, metadata=None, act_as_config=None, allowed_pool_names=None, allowed_direct_model_names=None, allowed_tools=None, allowed_gateway_ids=None, actas_allowed_groups=None, actas_allowed_emails=None, actas_allowed_subjects=None) -> AgentRecord` | Create an agent record | | `list_agents(*, name_prefix="", ...) -> list[AgentRecord]` | List agents in the workspace | | `get_agent(*, agent_id) -> AgentRecord \| None` | Fetch a single agent | | `revoke_agent(*, agent_id, reason="")` | Revoke an agent without deleting it | | `delete_agent(*, agent_id, cascade=False, reason="")` | Hard-delete an agent | | `create_agent_key(*, agent_id, name="default", gateway_id=None) -> AgentKeyMaterial` | Issue a new bearer token and return the selected gateway endpoints | | `ensure_agent_key(*, agent_id, name="default", gateway_id=None) -> AgentKeyMaterial` | Create the named key, or rotate it if it already exists. Idempotent | | `rotate_agent_key(*, agent_id, key_name, gateway_id=None) -> AgentKeyMaterial` | Rotate an existing key and return the selected gateway endpoints | | `revoke_agent_key(*, agent_id, key_name)` | Revoke a single key | | `list_agent_keys(*, agent_id) -> list[dict]` | List key metadata. The bearer is never returned after issuance | | `exchange_token(*, api_key, gateway_id=None) -> TokenExchangeResult` | Exchange a `dome_*` key for a short-lived JWT and complete gateway endpoints | `AgentKeyMaterial.token` is the only place the bearer is ever returned. Persist it before discarding the response. ### Workspace and gateway setup [#workspace-and-gateway-setup] | Method | Description | | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | | `current_identity() -> AdminIdentity` | Resolve the authenticated platform identity | | `list_workspaces(*, tenant_id=None) -> list[Workspace]` | List workspaces the key can see | | `get_workspace_runtime_capabilities(*, workspace_id=None) -> WorkspaceRuntimeCapabilities` | Customer-safe hosting and runtime capability traits | | `create_mcp_connection(*, name, transport, ...) -> MCPConnection` | Attach an MCP server to the workspace gateway | | `delete_mcp_connection(*, connection_id, workspace_id=None)` | Detach an MCP server | | `create_gateway(*, name, description="") -> Gateway` | Create a workspace-scoped [gateway](#gateways). Requires `gateways.manage` | | `list_gateways() -> list[Gateway]` | List workspace gateways and their complete endpoints | | `get_gateway(*, gateway_id) -> Gateway` | Get one gateway and all resource memberships | | `update_gateway(*, gateway_id, name, description="") -> Gateway` | Update gateway metadata | | `set_gateway_state(*, gateway_id, state) -> Gateway` | Set `active` or `disabled` | | `set_gateway_default(*, gateway_id) -> Gateway` | Set the non-enforcing workspace default marker | | `add_gateway_tool(*, gateway_id, tool_id)` | Add one discovered MCP tool | | `add_gateway_tool_source(*, gateway_id, connection_id)` | Expose every tool from an MCP connection through the gateway. Requires `gateways.manage` | | `add_gateway_llm_pool(*, gateway_id, llm_pool_id)` | Add an LLM pool | | `add_gateway_llm_model(*, gateway_id, llm_model_connection_id)` | Add a direct model connection | | `set_agent_gateway_access(*, agent_id, gateway_id, granted)` | Add or remove one agent's explicit gateway grant | | `set_gateway_all_agents_grant(*, gateway_id, granted)` | Toggle the gateway's grant for all workspace agents. Requires `gateways.manage` **and** `rules.deploy` | | `delete_gateway(*, gateway_id)` | Delete a gateway and remove its memberships; the underlying connections and pools are unchanged. Requires `gateways.manage` | | `deploy_bundle(*, scope_kind="workspace", scope_id=None, cedar_source, ...) -> BundleRecord` | Deploy a Cedar policy bundle | | `list_bundles(*, scope_kind="workspace", scope_id=None) -> list[BundleRecord]` | List deployed bundles | | `delete_rules(*, scope_kind="workspace", scope_id=None)` | Remove rules at a scope | | `create_llm_connection(*, name, provider, ...) -> LLMConnection` | Register an LLM provider connection | | `list_llm_connections() -> list[LLMConnection]` | List LLM provider connections | | `create_llm_pool(*, name, ...) -> LLMPool` | Create a model pool | | `list_llm_pools() -> list[LLMPool]` | List model pools | | `create_llm_pool_member(*, pool_id, ...) -> LLMPoolMember` | Add a model to a pool | | `list_llm_pool_members(*, pool_id) -> list[LLMPoolMember]` | List models in a pool | ### Gateway admin [#gateway-admin] Create a gateway, add tool sources, grant admission, and hand the resulting `/gateways/{id}` URL to agents. The admin client covers gateway CRUD, state/default selection, resource membership, per-agent access, and the all-agents grant. Gateway cost quotas live in the [CLI](/cli/build/gateway), dashboard, and [MCP tools](/reference/mcp/gateway). ```python from dome import DomeAdminClient with DomeAdminClient( base_url="https://api.domesystems.ai", platform_key="{{PLATFORM_KEY}}", workspace_id="{{WORKSPACE_ID}}", ) as admin: gateway = admin.create_gateway( name="incident-response", description="Tools + models for the incident-response agents", ) # Expose every tool this MCP connection publishes through the Gateway. admin.add_gateway_tool_source( gateway_id=gateway.id, connection_id="{{MCP_CONNECTION_ID}}", ) # Admit every agent in the workspace. admin.set_gateway_all_agents_grant( gateway_id=gateway.id, granted=True, ) # The control plane returns complete call-ready endpoints. print(gateway.gateway_url) print(gateway.endpoints.mcp_url) ``` Deleting a gateway (`delete_gateway`) removes its memberships but leaves the underlying connections and pools unchanged. Callers still pointed at the deleted gateway's URL fail closed; repoint them first. ### Admin errors [#admin-errors] Every admin RPC raises `AdminAPIError` on non-2xx responses. The exception carries `path`, `status_code`, and the full response `body`. `body` is truncated in the exception message so a verbose HTML error page does not produce an unreadable `str()`. ```python from dome import AdminAPIError try: admin.register_agent(name="incident-bot") except AdminAPIError as exc: if exc.status_code == 409: print("agent already exists") else: raise ``` ## Bootstrap helpers [#bootstrap-helpers] Setup scripts can provision a development agent and issue a fresh gateway key with one call. ```python agent = await dome.bootstrap.ensure_agent( name="incident-bot-dev", control_plane_url="https://api.domesystems.ai", platform_key="dome_pk_...", workspace_id="{{WORKSPACE_ID}}", allowed_tools=["github/list_issues"], gateway_id="{{GATEWAY_ID}}", wait_gateway=True, ) print(agent.gateway_url) ``` | Helper | Description | | ----------------------------------------------------------------- | --------------------------------------------------------------------------- | | `dome.bootstrap.ensure_agent(...)` | Async: find or create an agent and (optionally) issue a key | | `dome.bootstrap.ensure_agent_sync(...)` | Synchronous form | | `dome.wait_for_agent_key(gateway_url=..., token=..., timeout=30)` | Block until a freshly issued key shows up in the gateway's API-key snapshot | Pass an existing `DomeAdminClient` as `admin_client=`, or pass `control_plane_url`, `platform_key`, and `workspace_id` and let the helper construct one. The returned `BootstrapAgent` exposes `agent_id`, `token`, `gateway_id`, and the complete `gateway_url`, plus the underlying `AgentRecord` and `AgentKeyMaterial`. `ensure_agent` is idempotent. If an agent with the exact name exists, it is reused; if `create_key=True`, the named key is created or rotated and fresh key material is returned. Pass `wait_gateway=True` to block until the gateway has synced the new key. Select it with `gateway_id=`; `gateway_url=` is only an optional complete-URL override for the readiness probe and must name the same gateway. ## Errors [#errors] All error classes inherit from `dome.DomeError`. ### Control-plane / lifecycle [#control-plane--lifecycle] | Class | Raised When | | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `DomeConfigurationError` | SDK configuration cannot support the requested operation | | `DomeGatewayConfigurationError` | `gateway_url` is missing, malformed, unscoped, protocol-suffixed, or conflicts with `gateway_id`. Subclass of `DomeConfigurationError`; carries `gateway_url` | | `NotInitializedError` | Method called before `start_policy_sync()` for local checks | | `AlreadyStartedError` | Lifecycle double-start | | `ShutdownError` | Methods called after `close()` | | `NoBundleLoadedError` | Local `check()` called with no Cedar bundle synced | | `DeniedError` | Typed deny used by callers who prefer exceptions from `on_deny` | | `GatewayNotReadyError` | `wait_ready()` did not observe a ready gateway in time | | `DomeMissingProviderDependency` | A lazy provider factory needs an uninstalled package | ### Gateway data-plane [#gateway-data-plane] All gateway errors inherit from `DomeGatewayError` and carry `status_code` plus the raw response when available. `request_id` and `activity_id` are populated when the gateway response exposes them. `gateway_id` is stamped from the client's configured endpoint, so every gateway error names the gateway the failing call was routed through. | Class | Raised When | | ------------------------- | ----------------------------------------------------------------------------------------------- | | `DomeGatewayError` | Generic gateway-side failure not matched by a typed subclass | | `DomeGatewayUnavailable` | gateway is unreachable or reports a transient outage | | `DomeAuthorizationDenied` | Dome policy denies the operation. Carries `reason`, `reason_code`, `determining_policy` | | `DomeCredentialRequired` | Per-user credential must be connected. Carries `connection_name`, `provision_url`, `expires_at` | | `DomePolicyStale` | gateway reports stale policy state | | `DomeToolNotFound` | Requested MCP tool does not exist | | `DomeToolExecutionError` | JSON-RPC error or `isError=true` (when `raise_on_tool_error=True`) | | `DomeActAsRequired` | gateway requires a verified act-as identity | | `DomeRateLimited` | gateway or upstream provider rate-limits the request | | `DomeModelNotFound` | model or pool cannot be found | ```python try: client.gateway.tools.call("github/list_issues", {"repo": "dome"}, act_as=user) except dome.DomeCredentialRequired as exc: print("connect", exc.connection_name, "at", exc.provision_url) except dome.DomeAuthorizationDenied as exc: print("denied:", exc.reason_code, exc.determining_policy) ``` ## Async client [#async-client] `dome.AsyncClient` has the same constructor and exposes the same surfaces with `await`-able methods. ```python import asyncio import dome async def main() -> None: async with dome.AsyncClient( token="{{AGENT_TOKEN}}", gateway_url="https://gateway.domesystems.ai/gateways/{{GATEWAY_ID}}", act_as_method="none", ) as client: result = await client.gateway.tools.call( "github/list_issues", {"repo": "dome"}, act_as=dome.PlainActAs(email="alice@corp.com"), ) print(result.structured_content or result.content) asyncio.run(main()) ``` `client.audit.stream(...)` returns an async iterator on `AsyncClient`. `client.activity(...)` returns an `AsyncActivity` and supports `async with`. ## Framework adapters [#framework-adapters] Adapters are separate PyPI packages that wrap `Client` for a specific framework. Refer to [Adapters](/sdks/python/adapters) for the catalog and integration details. ## Next steps [#next-steps] Wrap the client for a framework, or wire credentials and Act-As from Develop: * [Adapters](/sdks/python/adapters) for framework wrappers * [Develop](/develop) for credentials, endpoints, and Act-As envelopes * [Delegated agents](/build/agents/delegated) when access depends on the person * [Examples](/tutorials/examples) for a governed agent pattern # Tutorial (/sdks/python/tutorial) Take a registered agent from the developer quickstart and embed the Python SDK in a real service. Tool calls route through the gateway, end-user identity flows on every request, and the audit trail correlates the run. > **Note**: **Prerequisites:** > > * Completed [Developer Quickstart](/tutorials/role/developer) — agent registered, API key minted, rules deployed > * agent token saved as `$DOME_AGENT_TOKEN` > * gateway URL saved as `$DOME_GATEWAY_URL` — must include the `/gateways/{id}` [Gateway](/sdks/python/reference#gateways) prefix (`https://gateway.../gateways/{id}`); a bare base URL fails closed > * Control-plane URL saved as `$DOME_CONTROL_PLANE_URL` > * Python 3.12+ ## 1\. Add the SDK [#1-add-the-sdk] ```bash pip install dome-sdk ``` ## 2\. Initialize once at startup [#2-initialize-once-at-startup] Construct the client during application startup. Share one `Client` across threads — the gateway clients are thread-safe. ```python # governance.py import logging import os import dome log = logging.getLogger("agent") def build_client() -> dome.Client: client = dome.Client( token=os.environ["DOME_AGENT_TOKEN"], gateway_url=os.environ["DOME_GATEWAY_URL"], control_plane_url=os.environ["DOME_CONTROL_PLANE_URL"], act_as_method="none", ) client.connect() return client ``` `connect()` prepares credentials and transport state. It does not block on local Cedar sync — only call `client.start_policy_sync()` if you also want in-process checks. ## 3\. Route tool calls through the gateway [#3-route-tool-calls-through-the-gateway] Replace direct tool invocations with `client.gateway.tools.call()`. The gateway evaluates authorization, resolves credentials, and audits the call before the upstream backend ever runs. ```python # tools/database.py from typing import Any import dome class DatabaseTool: def __init__(self, client: dome.Client) -> None: self.client = client def query(self, sql: str, user_email: str) -> dict[str, Any]: result = self.client.gateway.tools.call( "database/query", {"sql": sql}, act_as=dome.PlainActAs(email=user_email), ) if result.is_error: return {"error": result.structured_content or result.content} return {"rows": result.structured_content or result.content} ``` `act_as` carries the end user the agent is acting on behalf of. Cedar rules read `principal.act_as.email`, `principal.act_as.sub`, and so on — refer to [Authorization model](/concepts/architecture/authorization-model). ## 4\. Correlate a run with an activity [#4-correlate-a-run-with-an-activity] Wrap each agent run in `client.activity(...)` so every gateway call and audit event shares an opaque activity ID. ```python def handle_incident(client: dome.Client, case_id: str, user_email: str) -> str: user = dome.PlainActAs(email=user_email) with client.activity(metadata={"case": case_id}) as activity: issues = client.gateway.tools.call( "github/list_issues", {"repo": "dome"}, act_as=user, ) issue_payload = issues.structured_content or issues.content summary = client.gateway.llm.chat( model="prod-gpt", messages=[{"role": "user", "content": f"Summarize: {issue_payload}"}], act_as=user, ) return f"{summary['choices'][0]['message']['content']} (run={activity.activity_id})" ``` Outside an activity context, calls carry no activity ID — the SDK never mints one implicitly. ## 5\. Shut down cleanly [#5-shut-down-cleanly] Call `close()` on shutdown to release transports. ```python import atexit client = build_client() atexit.register(client.close) ``` Or use the context-manager form for short-lived scripts: ```python with dome.Client(token=..., gateway_url=...) as client: ... ``` ## 6\. Verify in audit [#6-verify-in-audit] Pull the run back with `client.audit.query(...)` (or the CLI): ```python page = client.audit.query( event_types=("tool.call", "model.call"), results=("RESULT_ALLOWED",), page_size=50, ) for event in page.events: print(event.type, event.correlation.activity_id) ``` Or from the CLI: ```bash dome audit query --activity-id {{ACTIVITY_ID}} --limit 20 ``` Each gateway call appears with the rule decision, the act-as identity, the upstream latency, and the activity ID. ## Next steps [#next-steps] * [Adapters](/sdks/python/adapters): Skip manual wrapping — use the LangChain adapter for gateway tools and governed chat models. * [Reference](/sdks/python/reference): Full configuration, act-as methods, errors, and audit reads. # Examples (/tutorials/examples) Complete applications rather than walkthroughs. Clone one, point it at your own workspace, and change the parts you need. * [Interactive app](/tutorials/examples/interactive-agent): A chess coach that acts for each signed-in player, beside a standing opponent. * [Scheduled agent](/tutorials/examples/noninteractive-agent): A nightly GitHub report that cannot merge, comment, or file. Python, TypeScript, or Go. # Build an interactive app with two identities (/tutorials/examples/interactive-agent) An interactive agent trades messages with a person, so somebody is always on the other end of what it does. The app in this tutorial has two of them. The coach agent answers questions about the position on the board, which a player asked for. The opponent agent plays black, which is its own move to make. Set up the chess demo from `dome-systems/examples` in a workspace. Start the app and an HTTPS tunnel, create gitignored `.env` and `.env.local` files, add the Stockfish tool, claude-sonnet, and four pools to Default, register `chess-coach` (act-as required) and `opponent-stockfish`, apply `policies/chess-coach.cedar` and `policies/opponent-stockfish.cedar`, then mint one key per agent. Never print provider, agent-key, session, or HMAC secrets. Simulate a coach call to `pool/chess-strong` and show me the DENY without weakening the rules. In this tutorial, you will register both agents in Dome, allow each one only the tool and pools it needs, and confirm that advice is recorded against the player who asked for it while moves are recorded against the opponent itself. To do this, you will: 1. **Create a workspace**: Create a tutorial workspace for this tutorial alone. 2. **Start the app and tunnel**: Run the app locally and expose the engine it publishes. 3. **Set environment variables**: Put the model key, signing secret, and tunnel URL where Dome and the app can read them. 4. **Register in Dome**: Attach the engine, model, and pools, then register both agents. 5. **Deploy access rules**: Deploy each agent's Cedar file. 6. **Create an agent key**: Mint one credential per identity. 7. **Wire the application**: Point the app at the gateway and keep both keys on the server. 8. **Verify agents**: Confirm the coach cannot play and the opponent cannot coach. ## Tutorial scenario [#tutorial-scenario] This tutorial uses [demo-chess](https://github.com/dome-systems/examples/tree/main/demo-chess), a chess app with two AI features: 1. a coach that answers questions about the position on the board. Dome authorizes and records what it does as the player who asked for it, which is **delegated identity**. 2. an opponent that plays black at one of three strengths. Dome authorizes and records what it does as the agent itself, which is **standing identity**. Refer to [Identity patterns](/concepts/identity-patterns) for the full comparison. You do not give either agent a model key, and neither one calls the engine directly. Both reach every tool and model through a [Gateway](/build/gateways), so what each can do is decided by what you register in Dome. The chess engine both agents call is served by the app itself, at `/mcp`, and Dome calls back into it. So this one project is both the host the agents run in and a tool they reach through the gateway. Both agents reach that engine, and all four model pools resolve to the same `claude-sonnet`, so nothing in the model itself separates coaching from play. The pool each agent may use is the separation. Select an agent to see the split. ## Prerequisites [#prerequisites] For this tutorial, you will need: * The Dome CLI. Refer to [Install](/install) for Homebrew and direct-download instructions. * A role that can manage gateway resources, agents, and rules. Refer to [Permissions](/concepts/platform/permissions) concept. * Node.js 22 or later. * An Anthropic API key. * `cloudflared`, or any equivalent that gives your local dev server a public HTTPS URL, so the gateway can reach the app's engine. > **Note**: This tutorial signs player assertions with a shared HMAC secret, which keeps the whole flow inside your workspace. In production, the assertion is a JWT your identity provider issues and Dome verifies over OIDC, so no application holds a signing secret. ## Create a workspace [#create-a-workspace] Create a standard [workspace](/concepts/platform/scopes) for this tutorial rather than reusing one you already work in. This tutorial registers two agents and creates shared gateway resources. Delete the workspace only when you no longer need those resources. ```bash dome workspaces create --name studio-chess ``` The command creates `studio-chess` and selects it as the active context. Confirm it: ```bash dome context sync dome context current ``` Confirm the workspace before you continue, since everything after this point creates or changes resources: ```bash dome context current ``` The workspace should read `studio-chess`. ## Start the app and tunnel [#start-the-app-and-tunnel] Clone the examples repository, change into the chess demo, create its local environment file, then install the dependencies. ```bash git clone https://github.com/dome-systems/examples.git cd examples/demo-chess cp .env.example .env.local npm install ``` Start the app. It serves the board, and it also serves the Stockfish engine as an MCP tool at `/mcp`. ```bash npm run dev ``` The coach answers with a placeholder until you give the app its gateway in [Wire the application](#wire-the-application). The engine needs a public address, because the gateway is the one calling it. When an agent uses the engine, the gateway makes a request out from Dome's servers to whatever URL you registered, so `http://127.0.0.1:3000` would point it at its own machine rather than your laptop. A tunnel gives your dev server a public HTTPS address and forwards what arrives there to your machine. In a second terminal, start one: ```bash cloudflared tunnel --url http://127.0.0.1:3000 ``` Copy the `https://….trycloudflare.com` address it prints, since you need it in [Set environment variables](#set-environment-variables). Leave both the app and the tunnel running for the rest of the tutorial. Any tunnel works, and a deployed app needs none of this because it already has a public URL. ## Set environment variables [#set-environment-variables] Create `.env` in the project root. * `ANTHROPIC_API_KEY` — the workspace has no model. You pass this once to `dome models add`. After that, Dome holds the secret and neither agent ever sees it. * `STOCKFISH_MCP_URL` — the tunnel address from the previous step, with `/mcp` on the end. This is how the gateway reaches the engine. * `ACTAS_SECRET` — the signing secret for player assertions. You generate this one rather than obtain it. ```bash title=".env" ANTHROPIC_API_KEY=sk-ant-your-key STOCKFISH_MCP_URL=https://your-tunnel.trycloudflare.com/mcp ``` The app signs player assertions with the same secret the gateway verifies them against, so a mismatch fails every coach call. Generate it once and write it to both files that read it: ```bash ACTAS=$(openssl rand -hex 32) echo "ACTAS_SECRET=$ACTAS" >> .env echo "DOME_ACTAS_SECRET=$ACTAS" >> .env.local ``` Every `.env` file is gitignored. Source `.env` in the shell that runs the Dome commands below, so `$ANTHROPIC_API_KEY`, `$STOCKFISH_MCP_URL`, and `$ACTAS_SECRET` are set. ```bash set -a && source .env && set +a ``` ## Register in Dome [#register-in-dome] Everything the two agents reach has to exist in the workspace first: the engine they call, the model behind their answers, the pools that separate coaching from play, and the provider that verifies who a coaching call is for. Once you register these resources, Dome holds the secrets and neither agent ever sees them. ### Register tool connection [#register-tool-connection] The app publishes Stockfish at `/mcp`, and the gateway calls it there. Register that address as a tool connection on the [Default gateway](/build/gateways). ```bash dome tools add \ --name stockfish \ --url "$STOCKFISH_MCP_URL" \ --protocol streamable-http \ --auth-method none \ --gateway Default ``` Verify that the gateway published the connection's catalog. You should see `chess_engine` in the list. ```bash dome tools catalog list stockfish ``` ### Register model [#register-model] Both features answer with the same model, so register one connection and attach it to the same gateway. The API key stays in Dome from here on. ```bash dome models add claude-sonnet \ --provider anthropic \ --model claude-sonnet-4-6 \ --api-key "$ANTHROPIC_API_KEY" \ --gateway Default ``` Verify that the model is registered. You should see `claude-sonnet` in the list. ```bash dome models list ``` ### Create model pools [#create-model-pools] Create four pools, all resolving to that one `claude-sonnet`: one for coaching and three for the opponent's skill levels. Nothing in the model itself separates coaching from play — the pool each agent may use is the separation, which is why each agent is entitled to pools rather than to the model directly. ```bash for pool in pool/coach pool/chess-fast pool/chess-balanced pool/chess-strong; do dome models pool create "$pool" --gateway Default dome models pool member add "$pool" claude-sonnet done ``` Verify that all four pools are registered. ```bash dome models pool list ``` ### Create verification provider [#create-verification-provider] The coach acts for a signed-in player, and the gateway will only believe that claim if it can check the signature. Create the HMAC provider that holds the secret the app signs with. ```bash dome verification-providers create \ --name demo-chess-hmac \ --method hmac \ --hmac-secret "$ACTAS_SECRET" ``` Copy the provider ID from that output, then select it as the workspace default so act-as traffic is verified against it. ```bash dome workspaces actas update \ --allowed-methods hmac \ --default-provider PROVIDER_ID ``` ### Register coach agent [#register-coach-agent] Register the coach with the engine, the coaching pool, and act-as required. `--tool` and `--pool` name what it may reach, `--gateway` admits it at Default, and `--actas-required` makes the gateway refuse the call outright when the player assertion is missing or unsigned — so a signing bug cannot quietly downgrade the coach into coaching on its own authority. ```bash dome agents register \ --name chess-coach \ --if-not-exists \ --gateway Default \ --tool stockfish/chess_engine \ --pool pool/coach \ --actas-required \ --actas-method hmac \ --actas-provider PROVIDER_ID \ --actas-allowed-group players ``` ### Register opponent agent [#register-opponent-agent] Register the opponent with the same engine and the three play pools. It takes no act-as flags, because playing its own move is not something it does for a player. ```bash dome agents register \ --name opponent-stockfish \ --if-not-exists \ --gateway Default \ --tool stockfish/chess_engine \ --pool pool/chess-fast \ --pool pool/chess-balanced \ --pool pool/chess-strong ``` Verify that both agents are registered. You should see `chess-coach` and `opponent-stockfish` in the list. ```bash dome agents list ``` ## Deploy access rules [#deploy-access-rules] The example ships a Cedar file per agent, each one holding its agent to the engine and to its own pools. Deploy them scoped to the agent they belong to, so a coaching call to an opponent pool is refused by policy rather than trusted to the app's routing. ```bash dome rules apply policies/chess-coach.cedar \ --agent chess-coach \ --name chess-coach dome rules apply policies/opponent-stockfish.cedar \ --agent opponent-stockfish \ --name opponent-stockfish ``` Verify that each bundle landed on its agent. ```bash dome agents get-policies chess-coach dome agents get-policies opponent-stockfish ``` > **Note**: A new tunnel URL will not take effect on its own. Update the `stockfish` connection with `dome tools update stockfish --url "$STOCKFISH_MCP_URL"`, or use a stable URL. ## Create an agent key [#create-an-agent-key] Two identities need two credentials: the app presents the coach's on coaching calls and the opponent's on moves, which is what keeps them distinct in policy and in audit. Mint one key per agent. Each token is shown once. ```bash dome agents create-key chess-coach --name local-app dome agents create-key opponent-stockfish --name local-app ``` `create-key` also prints the gateway URL the app will call. You can look it up again with: ```bash dome gateways get Default ``` ## Wire the application [#wire-the-application] Write the gateway URL, both tokens, and the pool names into the gitignored `.env.local`. The pool names are the ones you created above, so append them as they are: ```bash cat >> .env.local <<'EOF' DOME_COACH_POOL=pool/coach DOME_OPPONENT_POOL_BEGINNER=pool/chess-fast DOME_OPPONENT_POOL_CLUB=pool/chess-balanced DOME_OPPONENT_POOL_MASTER=pool/chess-strong EOF ``` Add the gateway URL and both tokens to the same file, taking the host and ID from `create-key` or `gateway get`. Do not paste the tokens into chat or commit them. ```bash title=".env.local" DOME_GATEWAY_URL=https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID DOME_COACH_TOKEN=dome_... DOME_OPPONENT_TOKEN=dome_... ``` The act-as secret is already in this file from the previous step, and `.env.example` supplies the rest of what the app needs. Restart the dev server so the app picks up the new values: ```bash npm run dev ``` The browser receives none of them. Only the app's server routes call Dome. ## Verify agents [#verify-agents] The coach should coach and the opponent should play, and neither should be able to do the other's job. Simulation runs the same evaluator as the gateway with no side effects, so you can confirm that without making either call. Start with the coach's own pool, which should be allowed. ```bash dome rules simulate --agent chess-coach --action llm:invoke \ --resource pool/coach --resource-type llm_pool ``` Expect `ALLOW`. Now ask for a pool that belongs to the opponent. ```bash dome rules simulate --agent chess-coach --action llm:invoke \ --resource pool/chess-strong --resource-type llm_pool ``` Expect `DENY`. Run the inverse pair against the opponent, which should reach a play pool and be refused the coach's. ```bash dome rules simulate --agent opponent-stockfish --action llm:invoke \ --resource pool/chess-fast --resource-type llm_pool dome rules simulate --agent opponent-stockfish --action llm:invoke \ --resource pool/coach --resource-type llm_pool ``` Each agent asserts the boundary from its own side, so loosening one set of rules does not loosen the other. Now exercise the app at [http://localhost:3000](http://localhost:3000): | In the app | Who acts | What to notice | | -------------------------------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | Sign in as `alex` / `alex` and ask the coach | `chess-coach` acting as Alex | Terse, tactical advice. The voice comes from the agent's `prompt.club` metadata because Alex is in the `club` group. | | Sign in as `sam` / `sam` and ask the coach | `chess-coach` acting as Sam | Plain language, same agent and same pool. Only the person changed. | | Play a move at any skill | `opponent-stockfish`, no act-as | The move is the agent's own action, so no player is named on it. | Finally, confirm the record separates them: ```bash dome audit query --limit 30 ``` Coach events carry `chess-coach` with an act-as subject. Opponent events carry `opponent-stockfish` with none. That difference is what lets you attribute a coaching call to a person and hold the opponent to its own limits, without the application deciding either. ## How delegation works [#how-delegation-works] Acting for a person takes one extra header, and acting as itself takes none. The browser never calls Dome and never sees the signing secret, because both agent tokens and the signing secret are bearer credentials: anything holding them can act as that agent, or claim to be any person. 1. **The player asks the coach a question.** The request goes to your server, never to the gateway. 2. **Your backend decides who the person is.** Dome has no copy of your user directory, so your session is the authority. You reduce the signed-in user to a subject, an email, and a set of groups, then sign that. 3. **Your backend calls the gateway with two credentials.** The agent token in `Authorization` says which workload is calling. `X-Dome-Act-As` says who it is calling for. 4. **Dome authorizes both together.** Cedar evaluates agent and person as one principal, so the tool list, the decision, the quota, and the audit event all follow the person rather than the service account. A standing call omits that header. Same client, same gateway, one principal instead of two. ### In the application [#in-the-application] `src/lib/dome-client.ts` builds every request's headers in one place, and signs the assertion when an identity is present. Model calls and tool calls carry it identically, which is why one `actAs` argument governs both. ```ts title="src/lib/dome-client.ts" function authHeaders( token: string, actAs?: ActAsIdentity | null, ): Record { const headers: Record = { Authorization: `Bearer ${token}`, "Content-Type": "application/json", }; if (actAs) { const secret = process.env.DOME_ACTAS_SECRET?.trim(); if (!secret) { throw new Error("DOME_ACTAS_SECRET required for act-as calls"); } headers["X-Dome-Act-As"] = signHMACActAs(secret, actAs); } return headers; } ``` The coach route refuses to run without a session, then passes the player's identity into the model call with the coach's token. ```ts title="src/app/api/coach/route.ts" const user = await getCurrentUser(); if (!user) { return NextResponse.json({ error: "Not signed in" }, { status: 401 }); } const actAs = identityFromUser(toPublicUser(user)); // ... const chat = await domeChat({ token: coachToken(), model: coachPool(), actAs, // ... }); ``` The opponent route is the same call with two things changed: the other token, and no identity. ```ts title="src/app/api/opponent/move/route.ts" const chat = await domeChat({ token: opponentToken(), model: pool, // standing — no actAs // ... }); ``` The app also finds the engine through `tools/list` rather than hard-coding its name, so what it can see follows whoever is on the call. > **Note**: Because the person is on the request, a spend cap can be set per player. When one trips, the gateway answers 429 and names the subject that tripped it, which is why the coach route reports the gateway's answer instead of keeping its own counter. **Troubleshooting** These are remediation steps if you get stuck: * The engine tool never appears, or `tools/list` comes back empty. The gateway can only publish a tool it can reach. Confirm both the dev server and the tunnel are still running, then inspect what the gateway observed: ```bash dome tools catalog list stockfish ``` An empty catalog usually means the tunnel URL changed. Update the connection: ```bash dome tools update stockfish --url "$STOCKFISH_MCP_URL" ``` * Every coach call fails act-as verification. The app is signing with a different secret than the gateway verifies with. Confirm `ACTAS_SECRET` in `.env` and `DOME_ACTAS_SECRET` in `.env.local` are the same value, then restart the dev server so Next.js reloads it. * A pool call is denied that you expected to be allowed. Check the decision before changing any rules. Simulation runs the same evaluator as the gateway with no side effects: ```bash dome rules simulate --agent chess-coach --action llm:invoke \ --resource pool/coach --resource-type llm_pool ``` ## Clean up [#clean-up] Stop the dev server and the tunnel. Deleting the workspace removes both agents, their rules, the model pools, and the tool connection together: ```bash dome workspaces delete studio-chess ``` Rotate the act-as secret anywhere you copied it. It signs identity assertions, so treat it like the credential it is. ## Next steps [#next-steps] You learned how to declare two agents for one application, give one of them delegated authority over a signed-in person's identity, and separate their model access with pools rather than application logic. Continue with: * [Govern per end user](/tutorials/get-started/govern-per-end-user) to authorize from the person in more depth Refer to the following docs for topics covered in this lab: * [Agents](/cli/build/agents) to register identities, require act-as, and mint keys * [Identity patterns](/concepts/identity-patterns) to choose between standing and delegated identity * [Set Usage Limits](/govern/quotas) to cap spend per agent or per person * [Scheduled agent](/tutorials/examples/noninteractive-agent) for the same workflow without a person in the loop # Govern an agent nobody is watching (/tutorials/examples/noninteractive-agent) An interactive agent trades messages with a person, the way a support bot does. A non-interactive agent has no back and forth. Nothing prompts it, nobody reads its output while it works, and there is no one to ask mid-run, so everything it may use has to be decided before it starts. The agent in this tutorial summarizes a developer's recent GitHub activity on a schedule by reading two GitHub tools and calling one model, and it cannot do anything else. Set up the GitHub activity report from `dome-systems/examples` in a workspace. Confirm the context, create a gitignored `.env`, add a GitHub tool and a claude-sonnet model to Default, register `github-activity-report` with only `GitHub/list_issues`, `GitHub/search_pull_requests`, and that model, mint a key, then run the report. Never print credentials. Simulate `GitHub/merge_pull_request` and show me the DENY without weakening the rules. In this tutorial, you will register that agent in Dome, allow it only the two tools and the one model it needs, and confirm that everything else on the same GitHub connection is refused. You can set up this agent with Python, TypeScript, or Go. To do this, you will: 1. **Create a workspace**: Create a tutorial workspace for this tutorial alone. 2. **Set up the project**: Clone the example, fill `.env`, and install your runtime. 3. **Register in Dome**: Attach GitHub and a model, then register the agent. 4. **Deploy access rules**: Limit the agent to the two reads and the summarizer. 5. **Create an agent key**: Mint the credential the process authenticates with. 6. **Run the report**: Point the process at the gateway and print the summary. 7. **Verify agent**: Confirm the write tools are denied without attempting one. 8. **Put it on a schedule**: Move the same process to cron. ## Tutorial scenario [#tutorial-scenario] This tutorial uses [github-activity-report](https://github.com/dome-systems/examples/tree/main/github-activity-report), an agent that lists a developer's recent issues and pull requests, then asks a model to summarize them. You do not give it a GitHub token or a model key. The agent reaches both through a [Gateway](/build/gateways), so what it can do is decided by what you register in Dome. Even though GitHub publishes its whole catalog on the connection, including tools that merge pull requests and open issues, this agent can only access the `list_issues`, `search_pull_requests` calls due to the Dome rules you set. The agent acts only as itself, which Dome calls **standing identity** and is the usual choice for work that is not a person's. Refer to [Identity patterns](/concepts/identity-patterns) for the full comparison. ## Prerequisites [#prerequisites] You will need the following. * The Dome CLI. Refer to [Install](/install) for Homebrew and direct-download instructions. * A role that can manage gateway resources, agents, and rules. Refer to [Permissions](/concepts/platform/permissions) concept. * Python 3.12+, Node.js 22+, or Go 1.23+. Any one of the three is enough. * A [fine-grained GitHub token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) with read access to Contents, Issues, Pull requests, and Metadata on the repositories you want reported. * An Anthropic API key. ## Create a workspace [#create-a-workspace] Create a standard [workspace](/concepts/platform/scopes) for this tutorial rather than reusing one you already work in. This tutorial registers an agent and creates the connections it reads through. Delete the workspace only when you no longer need those resources. ```bash dome workspaces create --name studio-activity-report ``` The command creates `studio-activity-report` and selects it as the active context. Confirm it: ```bash dome context sync dome context current ``` Confirm the workspace before you continue, since everything after this point creates or changes resources. ```bash dome context current ``` The workspace should read `studio-activity-report`. ## Set up the project [#set-up-the-project] Clone the examples repository and change into the report. ```bash git clone https://github.com/dome-systems/examples.git cd examples/github-activity-report ``` ### Set environment variables [#set-environment-variables] Create `.env` in the project root with the following values. * `GITHUB_USERNAME` — the developer the report is about. Required to start. * `GITHUB_REPOS` — the repositories to read, as `owner/repo`. Set this to that developer's own repos. ```bash title=".env" export GITHUB_USERNAME=octocat export GITHUB_REPOS=octocat/hello-world ``` Every `.env` file is gitignored. Refer to `.env.prod.example` for every variable the project understands, including the Slack ones for later. Do not set `DOME_AGENT_API_KEY`, `DOME_GATEWAY_URL`, or `DOME_API_URL` yet — the register step writes those. Leave `OUTPUT_MODE` unset so the report prints to stdout. Hold the GitHub token and Anthropic key for the next step. They go into Dome, not into this file. `GITHUB_MCP_TOKEN` is a complete `Authorization` header (`Bearer github_pat_...`), not the token by itself. ### Pick runtime [#pick-runtime] Pick a runtime and install what it needs. The agent you register in Dome is the same in all three; only the process you start later changes. **Python** ```bash python -m venv .venv source .venv/bin/activate python -m pip install -r python/requirements.txt ``` **TypeScript** ```bash npm --prefix typescript install ``` **Go** Go uses only the standard library. Nothing to install beyond the Go toolchain from [Prerequisites](#prerequisites). ## Register in Dome [#register-in-dome] Everything the report touches has to exist in the workspace first: the GitHub server it reads, the model that summarizes, and the agent identity that carries both. Once you register these resources, Dome holds the secrets and the agent never sees them. ### Register tool connection [#register-tool-connection] The report reads GitHub through its hosted MCP server, and the gateway is what calls it. Register that server as a tool on the [Default gateway](/build/gateways), passing the token you set aside. ```bash dome tools add \ --name GitHub \ --url https://api.githubcopilot.com/mcp/ \ --protocol streamable-http \ --auth-method api-key \ --credential-type shared \ --authorization "$GITHUB_MCP_TOKEN" \ --gateway Default ``` Verify that the gateway published the connection's catalog. You should see `list_issues` and `search_pull_requests` in the list, alongside every other tool GitHub publishes. ```bash dome tools catalog list GitHub ``` ### Register model [#register-model] The report asks a model to turn what it read into prose. Register one connection and attach it to the same gateway. ```bash dome models add claude-sonnet \ --provider anthropic \ --model claude-sonnet-4-6 \ --api-key "$ANTHROPIC_API_KEY" \ --gateway Default ``` Verify that the model is registered. You should see `claude-sonnet` in the list. ```bash dome models list ``` ### Register agent [#register-agent] Register the agent with only the two reads and the summarizer. `--tool` and `--model` name what it may reach, and `--gateway` admits it at Default. ```bash dome agents register \ --name github-activity-report \ --if-not-exists \ --gateway Default \ --tool GitHub/list_issues \ --tool GitHub/search_pull_requests \ --model claude-sonnet ``` ## Deploy access rules [#deploy-access-rules] The gateway still publishes GitHub's whole catalog, so tighten invocation the same way [Govern your first agent](/tutorials/get-started/govern-your-first-agent) does. These rules keep discovery open, name the two reads, and forbid every other `mcp:call` this agent could make — including on a tool GitHub adds months from now. ```cedar title="github-activity-report.cedar" permit( principal is Dome::Agent, action == Dome::Action::"mcp:discover", resource ); permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) when { resource in [ Dome::MCPTool::"GitHub/list_issues", Dome::MCPTool::"GitHub/search_pull_requests" ] }; forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) unless { resource in [ Dome::MCPTool::"GitHub/list_issues", Dome::MCPTool::"GitHub/search_pull_requests" ] }; permit( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource == Dome::LLMModel::"claude-sonnet" ); ``` Deploy the file scoped to the agent, which is what limits `principal is Dome::Agent` to this one. ```bash dome rules apply github-activity-report.cedar \ --agent github-activity-report \ --name github-activity-report ``` ## Create an agent key [#create-an-agent-key] The process authenticates as the agent, so mint it a key. The token is shown once, and `create-key` also prints the gateway URL the report calls. ```bash dome agents create-key github-activity-report --name local-report ``` The report also needs the control-plane URL, which is `Server` in your auth status. ```bash dome auth status ``` Append all three values to `.env`, taking the host and ID from the `create-key` output. Do not paste the token into chat. ```bash title=".env" export DOME_AGENT_API_KEY=dome_... export DOME_GATEWAY_URL=https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID export DOME_API_URL=https://app.domesystems.ai ``` `DOME_AGENT_API_KEY` is an envelope the process exchanges at `DOME_API_URL` for a short-lived gateway token. `DOME_GATEWAY_URL` is the scoped gateway the report calls. ## Run the report [#run-the-report] Source `.env` and start the runtime you installed. **Python** ```bash source .env python python/main.py ``` **TypeScript** ```bash source .env typescript/node_modules/.bin/tsx typescript/main.ts ``` **Go** ```bash source .env go -C go run . ``` You should see the agent read both GitHub tools, call `claude-sonnet` once, and print a three-section report — what the developer finished, what is still moving, and what issues the team opened. ## Verify agent [#verify-agent] The agent should read GitHub and summarize, not write. Confirm that with simulation. Do not try a write. ```bash dome rules simulate --agent github-activity-report --action mcp:call \ --resource GitHub/merge_pull_request --resource-type mcp_tool ``` Expect `DENY`. Repeat for `GitHub/issue_write` and `GitHub/create_pull_request` if you want the same proof for the other writes. Those tools sit on the same GitHub connection as the reads. If any of them showed as allowed, this agent could merge code while nobody is watching. If the simulation cannot name the tool, the gateway has not published it. Inspect the catalog rather than weakening policy. ```bash dome tools catalog list GitHub ``` Then read the decisions the run actually produced, each attributed to the agent rather than to your shell. ```bash dome audit query --limit 20 ``` ## Put it on a schedule [#put-it-on-a-schedule] The CLI does not supervise this process. A cron entry sources the same `.env` and runs the same command you used above. ```bash 0 13 * * * cd /srv/github-activity-report && . .venv/bin/activate && set -a && . .env && set +a && python python/main.py >> /var/log/activity-report.log 2>&1 ``` TypeScript and Go swap the last command for the one in [Run the report](#run-the-report). Once you are happy with what stdout shows, switch the report to Slack by setting `OUTPUT_MODE=slack` in `.env`, along with either `SLACK_WEBHOOK_URL`, or `SLACK_BOT_TOKEN` with `SLACK_CHANNEL`. Every runtime rejects `OUTPUT_MODE=slack` by name when those are missing, so a misconfigured schedule fails loudly instead of reporting into nothing. **Troubleshooting** These are remediation steps if you get stuck. * A tool name is missing from the catalog. The gateway has not published that tool, usually because the connection is new or the token cannot see it. ```bash dome tools catalog list GitHub ``` Tool names are case-sensitive and qualified as `connection/tool`. * The report runs but finds no activity. The lookback window or the repository list is too narrow, not a policy problem. Widen either in `.env`. ```bash LOOKBACK_HOURS=720 GITHUB_REPOS=owner/repo,owner/other-repo ``` * The run fails before making any call, complaining about the credential. `DOME_AGENT_API_KEY` is an envelope the process exchanges at `DOME_API_URL` for a short-lived token. Mint another key and rewrite the three `DOME_*` values. ```bash dome agents create-key github-activity-report --name local-report dome auth status ``` * `OUTPUT_MODE=slack` exits immediately. The Slack credentials are missing. Set `SLACK_WEBHOOK_URL`, or `SLACK_BOT_TOKEN` with `SLACK_CHANNEL`, in `.env`. ## Clean up [#clean-up] Remove the cron entry first, so it does not keep firing against a workspace that no longer exists. Deleting the workspace then removes the agent, its rules, and the connections together. ```bash dome workspaces delete studio-activity-report ``` ## Next steps [#next-steps] You fixed a scheduled agent's entire permitted surface before its first run, confirmed the write tools were refused without making a write call, and read the decisions back attributed to the agent rather than to your shell. * [Deploy an event-driven agent](/tutorials/production/deploy-your-agent/event-driven) to move this off cron and onto a managed trigger Refer to the following docs for topics covered in this lab. * [Agents](/cli/build/agents) to register identities and mint keys * [Identity patterns](/concepts/identity-patterns) to see where standing identity is and is not appropriate * [Authorize Access](/govern/rules) to write and deploy Cedar rules directly * [Audit and Export](/operate/audit) to stream these decisions to your own tooling * [Interactive app](/tutorials/examples/interactive-agent) for the same workflow with a person in the loop # Build a governed app (/tutorials/get-started/build-a-governed-app) Tool calls and inference are what an agent actually does. The application puts both on one path: the model names the `employee-summary` pool, may call tools through the same gateway, and every step stays governed, including allow, redact, and deny. Build a small governed HR application that runs a model + tool agent loop through Dome, then hand me the Chat and tools walks that prove it. Use the Vite + Hono reference app at [https://github.com/dome-systems/demo-hr-desk](https://github.com/dome-systems/demo-hr-desk). First, show me this plan and ask me to confirm before running anything: 1. Confirm the workspace from Govern + Call a model through a pool is still active (demo-hr, hr-assistant, employee-summary pool, llm rule) 2. Mint a second API key for the app, separate from my editor's key 3. Clone the demo app and wire env: token, gateway URL, and DOME\_POOL=employee-summary 4. Walk me through the generic agent flow, then the app files that implement each step (with the relevant code) 5. Run Chat and walk me through a Try asking prompt so I see model + tool steps 6. On tools, click through allow, redact, and deny 7. Show me the same decisions in the audit trail Follow the commands at [https://docs.domesystems.ai/agent/tutorials/get-started/build-a-governed-app.md](https://docs.domesystems.ai/agent/tutorials/get-started/build-a-governed-app.md) exactly. Non-negotiable rules: * Narrate as you go. Before each step, tell me in one or two sentences what you are about to do and why it matters. Do not silently run the whole flow. * Confirm the active context. Run `dome context current` and confirm the workspace name starts with `studio-`. If it does not, stop and ask me. Never modify a workspace you did not provision in this session. * Never print the `dome_...` agent token in chat. Write it into `.env` and confirm that file is gitignored. * `dome auth login` opens a browser. Run it, then wait for me before continuing. After a successful sign-in, run `dome context sync` so stale workspaces drop out of the local cache. * Do not weaken the rules to make a call succeed. The denial is the point of the exercise. If a call fails that should have worked, tell me instead of editing the Cedar bundle. * Keep the app small. Prefer the reference app as-is. Do not add auth UI or expand the product. * Chat runs the model via the pool and tools via MCP, both through Dome from the **backend**. The browser never holds the agent token and never calls the gateway. * After each create step, give me a markdown link into the Dome console for that resource. Derive the base URL from `dome auth status` → `Server`. * Expect re-runs. Check for existing resources before creating them and use `--if-not-exists` where available. * Never report a step as done without showing the command output. When the app runs, walk me through Chat first (model + tool steps, View gateway call), then the three tools outcomes and which control produced each: Cedar allowlist, response filter, and the forbid rule. Then offer to run `dome audit query --results denied --limit 10` so I can see the denial attributed to the agent. In this tutorial, you will run a small HR application against the gateway you already set up. The model calls `employee-summary` and may invoke tools. Dome governs every allow, redact, and deny, and records each step in the audit trail. The walkthrough uses the Vite + Hono [demo-hr-desk](https://github.com/dome-systems/demo-hr-desk) reference app. To do this, you will: 1. **Mint a credential for the app**: Issue a second key on the existing agent identity. 2. **Set up the project**: Clone the reference app and fill `.env`. 3. **Understand the agent flow**: See the generic loop, then the app files that implement it. 4. **Run the agent loop**: Chat through the pool and watch model and tool steps. 5. **Show allow, redact, and deny**: Click the three tool actions on the tools tab. 6. **Verify the results**: Match what you saw against the audit trail. ## Prerequisites [#prerequisites] For this tutorial, you will need: * The Dome CLI. Refer to [Install](/install) for Homebrew and direct-download instructions. * [Govern your first agent](/tutorials/get-started/govern-your-first-agent) completed, with its workspace still active. That tutorial created the `demo-hr` connection, the `redact-contact` filter, the `hr-assistant` agent, and the tool rule bundle. * [Call a model through a pool](/tutorials/get-started/call-a-model-through-a-pool) completed. This application needs the `employee-summary` pool and the `hr-assistant-llm` rule so Chat can invoke the model. * Node.js 18 or later. Confirm you are still on the workspace before you start: ```bash dome context current ``` The workspace should read `studio-get-started`. If it does not, switch back: ```bash dome context current ``` > This tutorial runs entirely in a workspace. In a production workspace, minting agent credentials is a developer action, while the rules this app runs under are owned by security. ## Mint a credential for the app [#mint-a-credential-for-the-app] An agent identity can hold several credentials. Your editor already has one. The app needs its own, so you can revoke either without disturbing the other. ```bash dome agents create-key hr-assistant --name service ``` The token is shown once. Copy the `Token: dome_…` value. Both keys resolve to `hr-assistant`, so both are governed by the same rules and both appear in audit under the same agent. ## Set up the project [#set-up-the-project] Clone the reference HR application, change into the directory, create a new `.env` file, then install the dependencies. ```bash git clone https://github.com/dome-systems/demo-hr-desk.git cd demo-hr-desk cp .env.example .env npm install ``` Fill `.env` from the CLI. The gateway URL must include the `/gateways/` segment and must **not** include `/mcp` or `/v1`. The Hono proxy appends those itself: ```bash title=".env" DOME_TOKEN=dome_... DOME_GATEWAY_URL=https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID DOME_POOL=employee-summary ``` ```bash dome context current dome gateways list ``` This tutorial uses plain HTTP so the wire shape stays visible. However, you can use any OpenAI-compatible client, AI SDK, or MCP client at the gateway URL with the agent token. Chat completions go to `…/gateways//v1`, and tools go to `…/gateways//mcp`. ## How a governed agent works [#how-a-governed-agent-works] Any app that puts a model and tools behind Dome follows the same shape. **The frontend never calls Dome.** The agent token is a bearer credential for the gateway. If it lives in the browser, anyone who opens DevTools can call tools and models as that agent. Keep the token on your backend and have the UI talk only to your server. 1. **UI → your backend.** The client posts a user message (or a direct tool click) to your server, never to the gateway. 2. **Backend → model (pool).** The server `POST`s OpenAI-shaped chat completions to `…/gateways//v1/chat/completions`, with `model` set to the **pool name** (`employee-summary`), not a vendor model id. The agent token stays in server env. 3. **Model may request tools.** If the completion includes `tool_calls`, the server maps each short name to a qualified MCP tool and `POST`s JSON-RPC `tools/call` to `…/gateways//mcp`. 4. **Tools return through Dome.** Allow, redact, and deny happen on that MCP path before your code sees the result. Denied calls become structured errors you feed back to the model. 5. **Loop.** Tool results go into the message list. The server calls the pool again until the model returns plain text (or you hit a round limit). 6. **Optional direct tools.** A tools UI can hit your backend's `/api/tool`, which then calls `/mcp`, with still no browser → Dome path. Useful for proving allow / redact / deny in isolation. Dome manages authorization, filtering, and audit. Your application manages the agent loop: what to ask the model, which tools to attempt, and how to show the results. ## How this application implements it [#how-this-application-implements-it] [demo-hr-desk](https://github.com/dome-systems/demo-hr-desk) is the reference application for this tutorial. The sections below are a guided tour of how it implements each step above. Skip ahead to [Run the agent loop](#run-the-agent-loop) if you want to try it first. ### UI → your backend [#ui--your-backend] `src/App.tsx` posts conversation history to `/api/chat`. The agent token never leaves the server. ```tsx title="src/App.tsx" async function sendChat(prompt: string) { // ... const messages = [...prior, { role: "user" as const, content: text }]; // ... const res = await fetch("/api/chat", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ messages }), }); const result = (await res.json()) as AgentResponse; // ... } ``` `server/index.ts` mounts the backend routes. Only these handlers (and the helpers they call) may use `DOME_TOKEN` or reach the gateway. ```ts title="server/index.ts" app.post("/api/chat", async (c) => { // ... build messages from body.messages or body.prompt const result = await runAgent({ messages, pool: body.pool, }); return c.json(result); }); ``` ### Backend → model (pool) [#backend--model-pool] `server/llm.ts` is the curl from [Call a model through a pool](/tutorials/get-started/call-a-model-through-a-pool) in TypeScript: gateway + `/v1/chat/completions`, bearer agent token, `model` = pool. ```ts title="server/llm.ts" export async function chatCompletion(options: { prompt?: string; messages?: ChatMessage[]; pool?: string; tools?: unknown[]; }): Promise { const base = process.env.DOME_GATEWAY_URL; const token = process.env.DOME_TOKEN; const pool = options.pool || process.env.DOME_POOL || DEFAULT_POOL; const requestBody: Record = { model: pool, messages, }; if (options.tools?.length) { requestBody.tools = options.tools; requestBody.tool_choice = "auto"; } // ... const url = `${base.replace(/\/$/, "")}/v1/chat/completions`; const res = await fetch(url, { method: "POST", headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json", }, body: JSON.stringify(requestBody), }); // ... } ``` ### Model may request tools [#model-may-request-tools] When the completion includes `tool_calls`, `server/agent.ts` maps each short name to a qualified MCP tool and calls `server/dome.ts`. ```ts title="server/agent.ts" export const TOOL_MAP: Record = { list_employees: "demo-hr/hr/list_employees", get_employee: "demo-hr/hr/get_employee", get_salary: "demo-hr/finance/get_salary", // ... }; for (const call of toolCalls) { const shortName = call.function?.name ?? ""; const mcpName = TOOL_MAP[shortName] ?? shortName; // ... parse arguments const toolTrace = await callTool(mcpName, args); // ... } ``` ### Tools return through Dome [#tools-return-through-dome] `server/dome.ts` posts JSON-RPC `tools/call` to `/mcp`. Allow, redact, and deny happen on that path before your code sees the result. ```ts title="server/dome.ts" export async function callTool( name: string, args: Record = {}, ): Promise { const base = process.env.DOME_GATEWAY_URL; const token = process.env.DOME_TOKEN; const requestBody = { jsonrpc: "2.0" as const, id: 1, method: "tools/call" as const, params: { name, arguments: args }, }; // ... const url = `${base.replace(/\/$/, "")}/mcp`; const res = await fetch(url, { method: "POST", headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json", }, body: JSON.stringify(requestBody), }); // ... map body.error → denied, result → allowed / error } ``` ### Loop [#loop] `server/agent.ts` runs the rounds. Tool results go into the message list. The server calls the pool again until the model returns plain text (or you hit a round limit). ```ts title="server/agent.ts" export async function runAgent(options: { messages: ChatMessage[]; pool?: string; }): Promise { // ... seed system prompt + user messages for (let round = 0; round < MAX_ROUNDS; round++) { const trace = await chatCompletion({ messages: messages as ChatMessage[], pool: options.pool, tools: OPENAI_TOOLS, }); steps.push({ type: "model", trace }); // ... return early if denied / no tool_calls for (const call of toolCalls) { const shortName = call.function?.name ?? ""; const mcpName = TOOL_MAP[shortName] ?? shortName; // ... parse arguments const toolTrace = await callTool(mcpName, args); steps.push({ type: "tool", name: shortName, mcpName, arguments: args, trace: toolTrace }); messages.push({ role: "tool", tool_call_id: call.id, content: toolResultContent(toolTrace), }); } } // ... } ``` Each `steps` entry is what the Chat transcript and **View gateway call** sheet show: model requests naming `employee-summary`, tool requests naming `demo-hr/…`. ### Optional direct tools [#optional-direct-tools] A tools UI can hit `/api/tool` for one MCP call without the model loop. Still no browser → Dome path. Useful for proving allow, redact, and deny in isolation. ```tsx title="src/App.tsx" async function runTool(action: (typeof TOOL_ACTIONS)[number]) { // ... const res = await fetch("/api/tool", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ name: action.name, arguments: action.args }), }); const trace = (await res.json()) as CallTrace; // ... } ``` ```ts title="server/index.ts" app.post("/api/tool", async (c) => { const body = await c.req.json<{ name?: string; arguments?: Record; }>(); // ... const trace = await callTool(body.name, body.arguments ?? {}); return c.json(trace); }); ``` That is the whole app: UI → your backend → pool and/or MCP. The frontend never calls Dome. The agent token never leaves the server. ## Run the agent loop [#run-the-agent-loop] Start the application: ```bash npm run dev ``` Open [http://localhost:5173](http://localhost:5173). Stay on **Chat** (the default). Use **Try asking** and start with **Who is E001 and how do I reach them?** You should see: 1. A model step that named `employee-summary` (open **View gateway call** on that step to confirm `"model": "employee-summary"`). 2. A tool step for `get_employee` with contact fields already `[REDACTED]`. 3. A final assistant reply that uses the tool result. Try **What is Alice's salary?** next. The model may attempt `get_salary`. The gateway denies it, and the transcript shows the refusal, the same Cedar rule as a direct tool click, now inside the loop. ## Show allow, redact, and deny [#show-allow-redact-and-deny] Chat mixed allow, redact, and deny into the model loop. The tools tab isolates each outcome with one click, so you can see which control fired without the model choosing the tools. Open **tools** and click each button in order. Your application does not decide who may call which tool, and it does not mask fields. You already defined those controls on the gateway. Your code only receives the allowed, redacted, or denied result. | Action | Status | What to notice | | ----------------------- | ------------------ | ------------------------------------------------------------ | | List employees | Allowed | Demo employees, including `E001`. | | Who is E001? | Allowed · redacted | Alice Johnson's record with `"email": "[REDACTED]"`. | | What is Alice's salary? | Denied | A `reason` from the rule that matched, not an empty payload. | The second result is the important one for guard filters. The backend returned a real address. The `redact-contact` guard filter replaced it on the response path before your proxy deserialized it. The page never asked for masking and cannot switch it off. Each result lists the outcome. Click **View gateway call** to open the side sheet with the outbound request and gateway response (token redacted). Why each click behaved that way: | Click | What Dome did | | ----------------------- | -------------------------------------------------------------------------------------------- | | List employees | Cedar allowed `mcp:call` on `demo-hr/hr/list_employees`. | | Who is E001? | Cedar allowed the call. The `redact-contact` guard filter masked `email` on the response. | | What is Alice's salary? | Cedar denied `mcp:call` on `demo-hr/finance/get_salary` because it is outside the allowlist. | **Troubleshooting** These are remediation steps if you get stuck: * `400` with `select a gateway`, or an application outcome of `denied` on every call including list\_employees. The gateway URL is missing its `/gateways/` segment, or the token is wrong. Re-read both values: ```bash dome context current dome gateways list ``` * The page loads but every click fails with a network error. Confirm `npm run dev` is running and that `/api/chat` and `/api/tool` are reachable. The browser talks only to the Hono proxy. Dome is never called from the client. * Every call is denied, including `list_employees`. The rule bundle from the first tutorial is missing from this workspace: ```bash dome rules show --agent hr-assistant ``` * The employee record still shows a real email address. The filter is not assigned to the response direction on this connection: ```bash dome tools guards filters list demo-hr ``` * Chat fails with a model / pool error, or tools work but Chat does not. Confirm the pool tutorial landed: `employee-summary` is attached to Default, and `hr-assistant` has the `llm:invoke` rule. ```bash dome models pool get employee-summary dome rules simulate --agent hr-assistant --action llm:invoke \ --resource employee-summary --resource-type llm_pool ``` `.env` must set `DOME_POOL=employee-summary`. ## Verify the results [#verify-the-results] The outcomes you saw are also on the record, attributed to the agent rather than to your process. ```bash dome audit query --limit 20 ``` You should see, for this run: 1. `model.call` at `stage=attempted` and `stage=completed` for Chat turns through `employee-summary`. 2. `tool.call` at `stage=attempted` and `stage=completed` for `list_employees` (and any tools the model invoked). 3. `guard.filter.evaluate` for `get_employee`, which is the filter reporting what it changed. 4. A completed `tool.call` for `get_salary` with `result=denied` and the shared `denial` block. To read only the rejection: ```bash dome audit query --results denied --limit 10 ``` Both credentials resolve to one identity, so nothing here distinguishes this app from your editor. That is deliberate: the rules and the record follow the agent, not the process that holds the key. When you want them separated in audit, register a second agent rather than a second key. ## Next steps [#next-steps] You learned how to run model and tool calls from one application through the same agent and gateway. Keep the `studio-get-started` workspace for the next tutorial. Continue with: * [Govern per end user](/tutorials/get-started/govern-per-end-user) to authorize from the person, not only the agent Refer to the following docs for topics covered in this lab: * [Develop](/develop) to authenticate and call gateways from your application * [Guards](/govern/guards) to inspect and filter request and response content # Call a model through a pool (/tutorials/get-started/call-a-model-through-a-pool) Tool calls are one half of what an agent does. The other half is inference, and it carries its own problems: a provider key sitting in an environment variable, spend nobody notices until the invoice, and no record of which agent asked for what. A [model connection](/connect/models) is one upstream LLM endpoint and its provider credential, for example Claude with your Anthropic key. A [pool](/connect/pools) groups one or more of those connections behind a single name. The agent puts the pool name in the request's `model` field. Dome chooses which connection serves the call. That split is what lets you swap providers, add failover, or change weights later without touching the app. Add a governed LLM pool to my Dome workspace and restrict which agent may call it. Walk me through spend quotas if my plan includes them. Then hand me the curl that proves the pool works, and show routing by adding a second model and switching which member is primary. First, show me this plan and ask me to confirm before running anything: 1. Confirm the workspace from the earlier tutorials is still active 2. Add a model connection with my provider API key 3. Create a pool, add the connection as a member, and attach the pool to the Default gateway 4. Explain spend quotas (Pro). Set a monthly pool cap if my plan allows it, or skip cleanly on Free 5. Deploy a Cedar rule permitting inference on that pool and nothing else 6. Form the LLM ingress URL on the Default gateway and export credentials 7. Call the pool once with curl against `/v1/chat/completions`, naming `employee-summary` 8. Add a second model (same provider or other provider), put it in the pool as failover, then switch priorities and curl again. Same pool name, different member in audit 9. Show me the audit trail, and the spend against the cap if a quota was set Follow the commands at [https://docs.domesystems.ai/agent/tutorials/get-started/call-a-model-through-a-pool.md](https://docs.domesystems.ai/agent/tutorials/get-started/call-a-model-through-a-pool.md) exactly. Non-negotiable rules: * Ask me for my provider API key before you need it, and tell me which provider you expect. Do not guess, and do not look for one in my shell history, environment, or files. For the second member, ask whether I want another model on the same key or a second provider. * Never print my provider API key or the `dome_...` agent token in chat. Pass the provider key to the CLI once, and write the agent token into a `.env` file that is gitignored. * Narrate as you go. Before each step, tell me in one or two sentences what you are about to do and why it matters. Do not silently run the whole flow. * Confirm the active context. Run `dome context current` and confirm the workspace name starts with `studio-`. If it does not, stop and ask me. * Teach the pool as the thing the client names. The connection is the backend member. Do not skip the pool and have me call the connection directly. * Authorize on `resource.pool`, not on the connection name, so adding a second member later does not require a rule change. * Cost quotas are a Pro feature. On Free, explain what they do, show the command, and continue without one if `dome quotas set` fails with a plan limit. Do not treat a missing quota as a failed tutorial. * On Pro, set the spend cap low, at five dollars per month, so the guardrail is real and cheap to test. Do not raise the cap or widen the rule to make a call succeed. * Spend sparingly: one curl to prove the primary, one curl after the priority switch. Do not loop retries. * After each create step, give me a markdown link into the Dome console for that resource. Derive the base URL from `dome auth status` → `Server`. * Never report a step as done without showing the command output. When you form the LLM ingress and show the curl, be explicit about all three things that differ from calling the provider directly: the base URL (gateway + `/v1/chat/completions`), the `Authorization` bearer (agent token, not the provider key), and the `model` field (pool name `employee-summary`). When you switch members, the curl must stay identical. Only pool membership changes. Then offer to run `dome audit query --limit 20`, and `dome quotas list` if a quota was set. In this tutorial, you will put an LLM behind the same gateway your tools already sit behind. The provider key stays in Dome, the agent names a pool rather than a vendor model, every call is attributed, and on Pro spend can be capped before it reaches the provider. You will also put two different models in that pool and switch which one serves traffic without changing the curl. To do this, you will: 1. **Add a model connection**: Register a provider model and hold its key in Dome. 2. **Put it in a pool**: Create a pool, add the connection, and attach the pool to the gateway. 3. **Cap the spend**: Learn how pool quotas work. Set one on Pro, or skip on Free. 4. **Authorize the pool**: Deploy a rule that permits this pool and nothing else. 5. **Point at the LLM ingress**: Form the gateway `/v1/chat/completions` URL and export credentials. 6. **Call the pool**: POST once naming `employee-summary`. 7. **Route across two members**: Add a second model, flip priority, and curl again with the same pool name. 8. **Verify the results**: Check the audit trail, and the spend if you set a quota. ## Prerequisites [#prerequisites] For this tutorial, you will need: * [Govern your first agent](/tutorials/get-started/govern-your-first-agent) completed, with its workspace still active. This tutorial reuses that workspace, its Default gateway, and the `hr-assistant` agent. * An API key for OpenAI or Anthropic. Dome calls the provider on your behalf, so the spend lands on your provider account. * A second model for the routing section: another model on that same key, or a key for the other provider. * An agent token (`dome_…`) for `hr-assistant`, the key from the first tutorial, or mint another with `dome agents create-key`. > **Note**: Optional: a **Pro** plan if you want to set a spend [quota](/govern/quotas) on the pool. Quotas are included on Pro. Free workspaces skip that step and continue with the rest of the tutorial. Confirm the workspace before you start: ```bash dome context current ``` The workspace should read `studio-get-started`. Switch back if it does not: ```bash dome context current ``` > This tutorial runs entirely in a workspace. In a production workspace, adding a provider connection and setting spend caps are typically finance and operator actions, not developer ones. ## Add a model connection [#add-a-model-connection] A model connection is a named route to one provider model, holding the credential Dome uses to reach it. Agents can call a connection by name, but this tutorial puts the connection in a pool instead. Naming the pool keeps the client's `model` field stable when you later add failover, change weights, or swap the upstream provider. **OpenAI** ```bash dome models add openai-mini \ --provider openai \ --model gpt-4o-mini \ --api-key "$OPENAI_API_KEY" ``` **Anthropic** ```bash dome models add claude-sonnet \ --provider anthropic \ --model claude-3-5-sonnet-20241022 \ --api-key "$ANTHROPIC_API_KEY" ``` The rest of this tutorial uses `openai-mini`. Substitute your connection name if you chose Anthropic. `--api-key` stores the credential in Dome's secret store, which is why nothing downstream needs a copy. For providers with their own identity story, [`--use-workload-identity`](/connect/models#credentials) skips the stored credential and uses the gateway's cloud-native chain instead, such as GCE metadata for Google or the AWS SDK chain for Bedrock. That avoids holding a long-lived key at all. Leave the connection off the gateway for now. A connection that is not a pool member and not attached to a gateway is registered but unreachable. You store the credential first, then expose the model only through the pool in the next step, so the agent never learns a direct connection name to call around the pool. Confirm the connection is registered and the credential is stored: ```bash dome models get openai-mini ``` ## Put it in a pool [#put-it-in-a-pool] A pool is the name your client will put in the `model` field. Dome picks which member serves each request, and can try another member when the first fails. Create `employee-summary` and attach it to Default: ```bash dome models pool create employee-summary \ --description "HR assistant employee summarization" \ --routing-strategy priority_weighted \ --failover-max all \ --gateway Default ``` | Setting | What it means here | | -------------------- | ------------------------------------------------------------------------------------------------------ | | `priority_weighted` | Prefer members by priority tier, then by weight within a tier. With one member, every call goes there. | | `--failover-max all` | Walk every eligible member before giving up. | Then add the connection as its only member: ```bash dome models pool member add employee-summary openai-mini \ --priority 0 \ --weight 1 ``` `--priority 0` marks this member as primary. Dome tries a `--priority 1` member only if the primary fails. Even with one member, the pool still matters. The client and the rule both name `employee-summary`. After the first curl succeeds, you will add a second model and switch which member serves without changing either. Confirm the pool and its membership: ```bash dome models pool get employee-summary dome models pool member list employee-summary ``` ## Cap the spend [#cap-the-spend] A [quota](/govern/quotas) is a dollar cap on a subject over a window. Enforcement happens before the provider is called, so an exhausted cap costs nothing. That is how you stop a runaway session from becoming an invoice surprise, and why quotas belong next to pools even when you are not setting one yet. > **Note**: Cost quotas are included on the **Pro** plan. Free workspaces cannot create them (`limit-max-cost-quotas` is zero). On Free, read this section and continue to [Authorize the pool](#authorize-the-pool). The rest of the tutorial does not depend on a quota. On Pro, set five dollars per month on the pool so every member shares one budget: ```bash dome quotas set \ --subject pool \ --pool employee-summary \ --limit 5 \ --window monthly \ --name "workspace cap" ``` Confirm it, along with what has been spent so far: ```bash dome quotas list ``` The subject is what makes a quota useful. `--subject pool` caps everything flowing through this pool no matter which member served the call. `--subject model` caps one connection across every pool it belongs to. `--subject agent` caps one agent across every model. `--subject act-as` caps an individual end user, which is what you reach for when one person's runaway session should not exhaust the team's budget. Windows are `daily` or `monthly`, and a quota can be created with `--disabled` if you want it in place before you start enforcing it. ## Authorize the pool [#authorize-the-pool] The gateway attachment makes `employee-summary` reachable. It does not decide who may call it. Tool rules from earlier tutorials cover `mcp:call`, not inference. Inference is a separate action, `llm:invoke`, on `Dome::LLMModel`. Allow `hr-assistant` to call models in the `employee-summary` pool, and deny every other inference call. Scope the rule to the pool name rather than a connection like `openai-mini`, so a failover member you add later inherits the same permit. Create `hr-assistant-llm.cedar`: ```cedar title="hr-assistant-llm.cedar" permit( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource is Dome::LLMModel ) when { resource.pool == "employee-summary" }; forbid( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource ) unless { resource has pool && resource.pool == "employee-summary" }; ``` `resource.pool` is how Cedar sees membership. Authorizing on `Dome::LLMModel::"openai-mini"` would lock the rule to one connection and miss any member you add later. **What authorizing the connection looks like** A connection-scoped rule permits only that one model. Adding a failover member later would still be denied until you rewrite the bundle: ```cedar permit( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource == Dome::LLMModel::"openai-mini" ); forbid( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource ) unless { resource == Dome::LLMModel::"openai-mini" }; ``` Deploy it as its own agent-scoped bundle: ```bash dome rules apply hr-assistant-llm.cedar --agent hr-assistant --name hr-assistant-llm ``` Check the decision before you write any code. Simulation runs the same evaluator as the gateway, with no call and no spend: ```bash dome rules simulate --agent hr-assistant --action llm:invoke \ --resource employee-summary --resource-type llm_pool ``` Expect `ALLOW`. The `llm_pool` resource type is how simulation addresses a pool the way a live call does: it stamps `resource.pool` so the permit above matches. Substituting a pool name you never created should return `DENY`. > **Note**: Dome rewrites pool-name literals to pool UUIDs when the bundle deploys, so the rule you write with `"employee-summary"` is what the gateway evaluates against the unspoofable pool id. You author names. The platform stores ids. ## Point at the LLM ingress [#point-at-the-llm-ingress] Point curl at the Default gateway's [LLM ingress](/concepts/gateways/llm-gateway) and authenticate as the agent. That path is where OpenAI- and Anthropic-shaped model traffic enters the data plane: ``` https:///gateways//v1/chat/completions ``` The first tutorial used the same gateway's tools ingress at `/mcp`. Model traffic shares the `/gateways/` prefix and uses `/v1/...` instead. Retrieve the three placeholders: * `AGENT_API_KEY`. The `Token: dome_…` value from [Govern your first agent](/tutorials/get-started/govern-your-first-agent). Tokens are shown once and cannot be recovered. If you did not save it, mint another: ```bash dome agents create-key hr-assistant --name pool-curl ``` * `GATEWAY_HOST`. Prepend `https://` to your current Dome host, for example `https://gateway.dev.domesystems.ai`. ```bash dome context current ``` * `DEFAULT_GATEWAY_ID`. The UUID of the Default gateway. ```bash dome gateways list ``` The result should look similar to `https://gateway.dev.domesystems.ai/gateways/3f9a2c14-8d7e-4b1a-9c02-5e6f7a8b9c01/v1/chat/completions`. Export once. `DOME_GATEWAY_URL` stops at the gateway. curl appends `/v1/chat/completions`: ```bash export DOME_GATEWAY_URL="https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID" export DOME_TOKEN="AGENT_API_KEY" ``` ## Call the pool [#call-the-pool] The gateway speaks the same OpenAI chat-completions protocol. Compared with calling the provider directly, three fields change: | Field | Value | | ------------- | ---------------------------------------------------------------------- | | URL | `$DOME_GATEWAY_URL/v1/chat/completions` | | Authorization | agent bearer token (`dome_…`), not the provider key | | `model` | `employee-summary` — the pool name, not `gpt-4o-mini` or `openai-mini` | Dome picks which member serves the call. The client never names the upstream model or connection. Call the pool once: ```bash curl -sS -X POST "$DOME_GATEWAY_URL/v1/chat/completions" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "employee-summary", "messages": [ { "role": "user", "content": "Summarize this employee in one sentence: E001 Alice Johnson, Senior Engineer in Engineering." } ] }' ``` Expect a normal chat-completions JSON body. The assistant text is a one-line employee summary. The important proof is that the call succeeded while naming `employee-summary`, not `gpt-4o-mini` or `openai-mini`. Leave the curl exports in your shell. The next section reuses them after you change pool membership. Provider SDKs work the same way later: OpenAI clients use base URL `…/gateways//v1` and `model: "employee-summary"`. Anthropic clients omit the trailing `/v1` on the base URL because their SDK appends `/v1/messages`. This tutorial sticks to curl so the wire shape is visible without an SDK. **Troubleshooting** These are remediation steps if you get stuck: * `400` with `select a gateway`. The URL is missing its `/gateways/` segment. A bare gateway host serves no inference. * `403` with `model not available in this gateway`. The pool exists but is not attached to Default, or it has no members. Confirm both: ```bash dome gateways get Default dome models pool member list employee-summary ``` * `403` with a `permission_error` naming a rule. Cedar denied the call. Reproduce it without spending anything: ```bash dome rules simulate --agent hr-assistant --action llm:invoke \ --resource employee-summary --resource-type llm_pool ``` * `404` with `no connection for requested model`. You passed a provider model id such as `gpt-4o-mini`, or the connection name `openai-mini`, where Dome expects the pool name. Check what this workspace exposes: ```bash dome models pool list ``` * `429` with `llm: quota exceeded`. The cap is working. The message names the subject that ran out. Review it, and raise it deliberately rather than by reflex: ```bash dome quotas list ``` If you never set a quota (Free plan), this error will not appear from Dome. Check your provider account instead. * `401` from the gateway. The bearer token is the provider's key, not Dome's. This endpoint authenticates the agent, and the provider credential never leaves the platform. ## Route across two members [#route-across-two-members] A single pool name can front more than one upstream. Add a second member for failover when the primary is down, shift traffic with weights, or promote a cheaper or stronger model without rewriting curl or Cedar. Clients and rules keep saying `employee-summary`. Membership decides who answers. In this section you add a failover member, then flip priorities so the new connection becomes primary. Failover is already set: `priority_weighted` with `--failover-max all` tries a `--priority 1` member only if the primary fails. ### Add the second connection [#add-the-second-connection] A pool can mix providers. The same `employee-summary` name can hold OpenAI and Anthropic members side by side. Pick same provider or other provider below. **Same provider** Reuse the key you already stored. Match the tab to your primary connection: **OpenAI** If your primary was `openai-mini`, add a stronger OpenAI model: ```bash dome models add openai-full \ --provider openai \ --model gpt-4o \ --api-key "$OPENAI_API_KEY" dome models pool member add employee-summary openai-full \ --priority 1 \ --weight 1 ``` **Anthropic** If your primary was `claude-sonnet`, add a lighter Anthropic model: ```bash dome models add claude-haiku \ --provider anthropic \ --model claude-3-5-haiku-20241022 \ --api-key "$ANTHROPIC_API_KEY" dome models pool member add employee-summary claude-haiku \ --priority 1 \ --weight 1 ``` **Other provider** Put a second vendor behind the same pool name. If your primary was OpenAI: ```bash dome models add claude-sonnet \ --provider anthropic \ --model claude-3-5-sonnet-20241022 \ --api-key "$ANTHROPIC_API_KEY" dome models pool member add employee-summary claude-sonnet \ --priority 1 \ --weight 1 ``` If your primary was Anthropic, add `openai-mini` the same way and attach it at `--priority 1`. Confirm both members: ```bash dome models pool member list employee-summary ``` You should see priority `0` (primary) and priority `1` (failover). Healthy calls still hit priority `0`. The second member is not a second name for the app to learn. curl and Cedar keep saying `employee-summary`. ### Switch the primary [#switch-the-primary] Flip priorities so the second member becomes primary. The curl keeps the same `model` value, but Dome routes it to the new primary. Substitute the connection names you actually added: ```bash # Example: openai-mini was primary, openai-full was failover dome models pool member update employee-summary openai-mini \ --priority 1 \ --weight 1 dome models pool member update employee-summary openai-full \ --priority 0 \ --weight 1 dome models pool member list employee-summary ``` Call again with the **same** request, still `model: "employee-summary"`: ```bash curl -sS -X POST "$DOME_GATEWAY_URL/v1/chat/completions" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "employee-summary", "messages": [ { "role": "user", "content": "Summarize this employee in one sentence: E001 Alice Johnson, Senior Engineer in Engineering." } ] }' ``` You now have one pool name and two backends. Membership and priority decide which serves. Keep the preferred model at priority `0` and the alternate at priority `1`. With `--failover-max all`, Dome tries the backup when the primary fails. Flip priorities back if you want the original primary for [Build a governed app](/tutorials/get-started/build-a-governed-app). The application only names `employee-summary`. It does not care which member is on top. ## Verify the results [#verify-the-results] Confirm the calls went through the pool and landed on `hr-assistant`, not a shared provider key. On Pro, also confirm they counted against your spend cap. Read the record: ```bash dome audit query --limit 20 ``` You should see attempted and completed `model.call` events for `hr-assistant`; completed events carry token usage and the **member that served each call**. The first curl and the post-switch curl should name different members if you flipped priority. A denial is the completed `model.call` itself with `result=denied` and the shared `denial` block. If you set a quota on Pro, check the spend. The used figure moves after each call: ```bash dome quotas list ``` To confirm the cap enforces rather than merely reports, lower it below what you have already spent and call again: ```bash dome quotas update --limit 0.01 ``` The next request returns `429` and never reaches the provider. Restore the cap afterward with another `update`, or remove it: ```bash dome quotas rm ``` Skip the quota commands on Free. There is nothing to list or update. The next tutorial wires the same pool into an application where the model and tool calls run together. ## Next steps [#next-steps] You learned how to hold a provider key in a model connection, route through a pool with failover, authorize `llm:invoke` on the pool, and attribute spend. Keep the `studio-get-started` workspace for the rest of this track. Continue with: * [Build a governed app](/tutorials/get-started/build-a-governed-app) to wire model and tool calls in one application Refer to the following docs for topics covered in this lab: * [Pools](/connect/pools) for routing strategies and membership * [Set Usage Limits](/govern/quotas) for spend caps on pools, models, and agents # Govern per end user (/tutorials/get-started/govern-per-end-user) A shared agent has a shared problem. If the HR application can read every employee record, then everyone who talks to it can, whatever their own access happens to be. Copying your permission model into the agent's prompt is not a fix. The model can be talked out of it. With [standing identity](/concepts/identity-patterns), the agent acts as itself — every caller gets the same Cedar answer from the agent's grants. With [delegated identity](/concepts/identity-patterns), each call carries a verified person, and Cedar authorizes on that person instead. Set up a Dome agent with **delegated identity** (`delegated-hr`) so each end user's permissions apply, then show me the same application returning different answers for Eva Martinez (HR), Alice Johnson (self), and Carol Williams (peer). Contrast this with standing identity on `hr-assistant` from earlier tutorials. Use the Vite + Hono reference app at [https://github.com/dome-systems/demo-hr-desk](https://github.com/dome-systems/demo-hr-desk). First, show me this plan and ask me to confirm before running anything: 1. Confirm the workspace from earlier Get Started tutorials is still active 2. Explain standing (`hr-assistant`) vs delegated (`delegated-hr`), then register `delegated-hr` with act-as required 3. Deploy Cedar: directory open to everyone, get\_employee for HR or self (act\_as.sub == employee\_id), get\_salary HR-only, plus the pool llm rule for Chat 4. Simulate Eva, Alice (self on E001), and Carol (denied on E001) before any live call 5. Point the application at delegated-hr: checkout tutorial/govern-per-end-user, put token + DOME\_ACTAS\_SECRET in server .env, run it, and explain how the application signs X-Dome-Act-As 6. Walk me through Act as Eva / Alice / Carol on tools (Who is E001? and salary). Same buttons, different outcomes 7. Show me the decisions in the audit trail, each naming the end user Follow the commands at [https://docs.domesystems.ai/agent/tutorials/get-started/govern-per-end-user.md](https://docs.domesystems.ai/agent/tutorials/get-started/govern-per-end-user.md) exactly. Non-negotiable rules: * Narrate as you go. Before each step, tell me in one or two sentences what you are about to do and why it matters. Do not silently run the whole flow. * Confirm the active context. Run `dome context current` and confirm the workspace name starts with `studio-`. If it does not, stop and ask me. * Never print the `dome_...` agent token or the act-as signing secret in chat. Write both into `.env` and confirm it is gitignored. * The browser must never call Dome. Only the Hono backend holds `DOME_TOKEN` and `DOME_ACTAS_SECRET` and sets `X-Dome-Act-As`. Do not put either secret in client code, Vite env, or the browser. * Do not put users' names or groups in a prompt, a system message, or an if-statement that decides allow/deny in my code. The whole point is that Cedar decides, not the application. * Do not widen the rules to make Carol's denied call succeed. The difference between personas is the result I am asking for. * Use `dome rules simulate` with act-as flags and `--eval-arguments` to check identities before running any live call. * After each create step, give me a markdown link into the Dome console for that resource. Derive the base URL from `dome auth status` → `Server`. * Never report a step as done without showing the command output. Show me clearly that the runs differ only in the signed identity passed to Dome, not in the code path taken. Then offer to run `dome audit query --limit 20` so I can see each decision attributed to both the agent and the person. In this tutorial, you will switch from standing `hr-assistant` to a delegated agent, `delegated-hr`. Eva (HR), Alice (self), and Carol (peer) click the same buttons and get different answers. The app has no logic that knows the difference. To do this, you will: 1. **Register a delegated agent**: Configure act-as verification on `delegated-hr` and make it mandatory. Leave `hr-assistant` standing. 2. **Write rules about the person**: Deploy Cedar that reads groups and compares `act_as.sub` to tool arguments. 3. **Check the identities**: Simulate Eva, Alice, and Carol before making a live call. 4. **How this application implements it**: Keep the token and act-as secret server-side. Sign per request. 5. **Verify the results**: See different answers from one UI, and each in audit. ## Background [#background] Earlier tutorials used **`hr-assistant`** standing. This one registers a second agent, **`delegated-hr`**, that requires act-as. Cedar reads `principal.act_as`, so Eva, Alice, and Carol can get different answers for the same tool. | | `hr-assistant` (standing) | `delegated-hr` (delegated) | | -------------------------- | ------------------------------ | ---------------------------------------------------------- | | **Who authorizes** | The agent's own grants | The verified human on `principal.act_as` | | **Credential** | Bearer token only | Bearer token + required `X-Dome-Act-As` | | **Same tool, same record** | Identical outcome for everyone | Eva allow · Alice self · Carol deny on `get_employee` E001 | | **Anonymous call** | Allowed under standing grants | Rejected (`--actas-required`) | You register a **second** agent rather than flipping `hr-assistant` to require act-as. Those settings would break earlier tutorials that call with no person attached. `delegated-hr` is the application agent that borrows each end user's identity. [Act-as](/concepts/agents/identity#act-as-identity) carries that person on each call. The boundary is enforced at the gateway, not in the model's prompt. That only works if **your backend** talks to Dome. Keep the token and signing secret on the server; the browser only says who is using the app. A frontend that called Dome directly could forge or omit act-as. ## Prerequisites [#prerequisites] For this tutorial, you will need: * [Govern your first agent](/tutorials/get-started/govern-your-first-agent) completed, with its workspace still active. This tutorial reuses that workspace, its `demo-hr` connection, and its Default gateway. * [Call a model through a pool](/tutorials/get-started/call-a-model-through-a-pool) completed if you want **Chat** under `delegated-hr` (the `employee-summary` pool). * [Build a governed app](/tutorials/get-started/build-a-governed-app) completed, or the [demo-hr-desk](https://github.com/dome-systems/demo-hr-desk) repo cloned as below. * Node.js 18 or later. Confirm the workspace before you start: ```bash dome context current ``` The workspace should read `studio-get-started`. Switch back if it does not: ```bash dome context current ``` Clone the reference app if you do not already have it from the previous tutorial: ```bash git clone https://github.com/dome-systems/demo-hr-desk.git cd demo-hr-desk npm install cp .env.example .env ``` If you already cloned it for [Build a governed app](/tutorials/get-started/build-a-governed-app), just `cd` into that directory. You will check out this tutorial's branch when you wire act-as. > This tutorial runs entirely in a workspace. In a production workspace, the identity provider is wired once by an operator, and the rules that read its claims are owned by security. ## Register a delegated agent [#register-a-delegated-agent] Register **`delegated-hr`** rather than reusing **`hr-assistant`**. Standing vs delegated is chosen [per agent](/concepts/identity-patterns). `hr-assistant` stays the standing editor/curl agent from earlier tutorials. `delegated-hr` is the purpose-built application agent: it authenticates as itself, but every governed call must present a verified end user, and Cedar authorizes on that person. This tutorial uses **HMAC** — a shared secret your backend uses to sign act-as. That is fine for a workspace. In production, use **OIDC** instead: register with `--actas-method oidc` and forward a JWT from your identity provider so Dome verifies the person against the IdP, not a secret your service holds. Generate the signing secret first so you can save it: ```bash export ACTAS_SECRET=$(openssl rand -hex 32) echo "$ACTAS_SECRET" ``` ```bash dome agents register --name delegated-hr \ --actas-method hmac \ --actas-hmac-secret "$ACTAS_SECRET" \ --actas-required \ --if-not-exists ``` Two flags carry the meaning: * `--actas-method hmac` tells the gateway how to verify the identity your service presents. Shared-secret HMAC is the workspace path here; production uses `oidc`. * `--actas-required` rejects any call arriving without an identity. Without it, act-as is accepted when present and ignored when absent, and a caller who omits it gets the agent's own permissions. Mint a credential for the application: ```bash dome agents create-key delegated-hr --name delegated-hr-service ``` > **Note**: `--actas-allowed-group`, `--actas-allowed-email`, and `--actas-allowed-subject` add an admission-level allowlist, rejecting identities outside it before Cedar runs. That is a coarse gate for narrowing which population an agent may serve. Leave it unset here so Cedar makes every decision. ## Write rules about the person [#write-rules-about-the-person] Cedar sees the end user as `principal.act_as`, a record carrying `sub`, `email`, `roles`, `groups`, and any custom `claims` the verified identity provided. Rules can read those the same way they read anything else. This policy does four things: * Anyone with a verified identity can list employees and view the org chart * Someone in the `hr` group can open any employee record and read salary * Anyone else can open only their own record (`act_as.sub` matches `employee_id`) * Calls with no act-as identity, and tools outside that set, are denied So Eva (HR) gets Alice's record and salary; Alice gets her own record only; Carol gets neither for Alice. The reference repo ships `delegated-hr.cedar`. Create it (or copy from the clone): ```cedar title="delegated-hr.cedar" permit( principal is Dome::Agent, action == Dome::Action::"mcp:discover", resource ); permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) when { resource in [ Dome::MCPTool::"demo-hr/hr/list_employees", Dome::MCPTool::"demo-hr/hr/org_chart" ] }; // HR can open any employee; others only their own record (act_as.sub == employee_id). permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"demo-hr/hr/get_employee" ) when { principal has act_as && ( principal.act_as.groups.contains("hr") || ( resource has arguments && resource.arguments has employee_id && resource.arguments.employee_id == principal.act_as.sub ) ) }; // Payroll is HR-only. permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"demo-hr/finance/get_salary" ) when { principal has act_as && principal.act_as.groups.contains("hr") }; // Overrides the auto-generated agent_spec permit that opens every Default gateway tool. forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"demo-hr/hr/get_employee" ) unless { principal has act_as && ( principal.act_as.groups.contains("hr") || ( resource has arguments && resource.arguments has employee_id && resource.arguments.employee_id == principal.act_as.sub ) ) }; forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"demo-hr/finance/get_salary" ) unless { principal has act_as && principal.act_as.groups.contains("hr") }; forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) unless { resource in [ Dome::MCPTool::"demo-hr/hr/list_employees", Dome::MCPTool::"demo-hr/hr/org_chart", Dome::MCPTool::"demo-hr/hr/get_employee", Dome::MCPTool::"demo-hr/finance/get_salary" ] }; ``` The `principal has act_as` guard matters. `act_as` is absent from the entity entirely when no identity was verified, and reading an absent attribute is an evaluation error rather than a false. Guard it, and an anonymous call falls through to a clean deny. Self-lookup compares `resource.arguments.employee_id` to `principal.act_as.sub`. Demo personas set `sub` to the employee id (E005 Eva, E001 Alice, E003 Carol), so Alice can open her own record while Carol cannot open Alice's. Payroll (`get_salary`) stays HR-only. If you completed [Call a model through a pool](/tutorials/get-started/call-a-model-through-a-pool), Chat still needs `llm:invoke` on `employee-summary`. Tool rules do not cover inference. Create `delegated-hr-llm.cedar` (same shape as `hr-assistant-llm.cedar`, scoped to this agent): ```cedar title="delegated-hr-llm.cedar" permit( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource is Dome::LLMModel ) when { resource.pool == "employee-summary" }; forbid( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource ) unless { resource has pool && resource.pool == "employee-summary" }; ``` Deploy both files scoped to the new agent, grant gateway access, and (for Chat) permit the pool: ```bash dome rules apply delegated-hr.cedar delegated-hr-llm.cedar --agent delegated-hr --name delegated-hr dome gateways access grant Default delegated-hr ``` Apply both Cedar files in one deploy so the tool rules and the pool rule stay active together. A second `dome rules apply` at the same agent scope replaces the previous bundle rather than layering beside it. ## Check the identities [#check-the-identities] Simulation accepts an end-user identity, so you can test a rule that reads `act_as` without a signing secret, a service, or a live call. Pass `--eval-arguments` whenever the rule compares `employee_id`. Eva (HR) looking up Alice: ```bash dome rules simulate --agent delegated-hr --action mcp:call \ --resource demo-hr/hr/get_employee --resource-type mcp_tool \ --eval-arguments '{"employee_id":"E001"}' \ --actas-sub E005 --actas-email eva@example.com --actas-groups hr ``` Expect `ALLOW`. Alice looking up herself (`sub` E001): ```bash dome rules simulate --agent delegated-hr --action mcp:call \ --resource demo-hr/hr/get_employee --resource-type mcp_tool \ --eval-arguments '{"employee_id":"E001"}' \ --actas-sub E001 --actas-email alice@example.com --actas-groups engineering ``` Expect `ALLOW`. Carol looking up Alice: ```bash dome rules simulate --agent delegated-hr --action mcp:call \ --resource demo-hr/hr/get_employee --resource-type mcp_tool \ --eval-arguments '{"employee_id":"E001"}' \ --actas-sub E003 --actas-email carol@example.com --actas-groups engineering ``` Expect `DENY`. Confirm salary is HR-only: ```bash dome rules simulate --agent delegated-hr --action mcp:call \ --resource demo-hr/finance/get_salary --resource-type mcp_tool \ --eval-arguments '{"employee_id":"E001"}' \ --actas-sub E005 --actas-email eva@example.com --actas-groups hr dome rules simulate --agent delegated-hr --action mcp:call \ --resource demo-hr/finance/get_salary --resource-type mcp_tool \ --eval-arguments '{"employee_id":"E001"}' \ --actas-sub E001 --actas-email alice@example.com --actas-groups engineering ``` Expect `ALLOW` then `DENY`. Confirm that the directory stays open to everyone by swapping the resource for `demo-hr/hr/list_employees`, and that omitting the act-as flags entirely denies the employee lookup rather than erroring. This is the loop worth keeping. A rule that reads identity claims has more branches than a rule that reads a tool name, and simulation is where you find the branch you forgot. ## How this application implements it [#how-this-application-implements-it] Act-as is a **server-side** concern. The gateway authenticates the agent with `Authorization: Bearer dome_…` and the end user with `X-Dome-Act-As`. Both headers are secrets your browser must never hold. | Layer | Holds | Talks to Dome? | | ------------------------ | ------------------------------------------- | ------------------------------------------------------------- | | Frontend (`src/App.tsx`) | Persona id only (`eva` / `alice` / `carol`) | No. Only `POST /api/chat` and `POST /api/tool` on your origin | | Backend (Hono proxy) | `DOME_TOKEN`, `DOME_ACTAS_SECRET` | Yes. Signs act-as and calls `/mcp` and `/v1/chat/completions` | Same frontend/backend split as [Build a governed app](/tutorials/get-started/build-a-governed-app#how-this-application-implements-it). With act-as the stakes are higher: if the browser held the agent token or signing secret, anyone with DevTools could impersonate anyone. Check out this tutorial's branch, which adds the Act as picker and HMAC signing, then point the **server** at `delegated-hr`: ```bash cd demo-hr-desk git fetch origin git checkout tutorial/govern-per-end-user ``` Update `.env` with the **delegated-hr** token and the secret you generated above. These values are read only by the Node process, never shipped to Vite or the browser: ```bash title=".env" DOME_TOKEN=dome_... DOME_GATEWAY_URL=https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID DOME_POOL=employee-summary DOME_ACTAS_SECRET=... ``` ```bash dome context current dome gateways list ``` > **Warning**: Do not prefix these with `VITE_`. Do not put `DOME_TOKEN` or `DOME_ACTAS_SECRET` in client bundles, public env, or browser storage. The frontend must not import them and must not `fetch` the gateway URL. ### How the application signs [#how-the-application-signs] The browser only sends a persona id (`eva` | `alice` | `carol`). The Hono proxy maps it to claims, signs with the server secret, and sets `X-Dome-Act-As` on the outbound Dome request. Cedar never sees a branch in `App.tsx`. Personas are fixed claims for the demo. There is still no allow/deny logic in the UI: ```ts title="server/actas.ts" export const PERSONAS = { eva: { id: "eva" as const, label: "Eva Martinez", detail: "HR Director", sub: "E005", email: "eva@example.com", groups: ["hr"], }, alice: { id: "alice" as const, label: "Alice Johnson", detail: "Senior Engineer", sub: "E001", email: "alice@example.com", groups: ["engineering"], }, carol: { id: "carol" as const, label: "Carol Williams", detail: "Staff Engineer", sub: "E003", email: "carol@example.com", groups: ["engineering"], }, } as const; ``` `signHMACActAs` builds the envelope the gateway verifies: identity fields + `_ts`, HMAC-SHA256 over canonical JSON `|` timestamp, then standard base64 of the signed payload. That string is the `X-Dome-Act-As` header value. ```ts title="server/actas.ts" export function signHMACActAs( secret: string, identity: ActAsIdentity, ts = Math.floor(Date.now() / 1000), ): string { if (!identity.sub && !identity.email) { throw new Error("act-as identity requires sub or email"); } const payload: Record = { _ts: ts }; if (identity.sub) payload.sub = identity.sub; if (identity.email) payload.email = identity.email; if (identity.groups?.length) payload.groups = identity.groups; // roles / claims omitted when empty const canonical = `${canonicalJson(payload)}|${ts}`; const digest = createHmac("sha256", secret).update(canonical).digest(); payload._signature = digest.toString("base64url"); return Buffer.from(canonicalJson(payload)).toString("base64"); } export function actAsHeaderValue(identity: ActAsIdentity): string | undefined { const secret = process.env.DOME_ACTAS_SECRET?.trim(); if (!secret) return undefined; return signHMACActAs(secret, identity); } ``` Tool and chat routes attach the **full** signed header on the real gateway request. `redactActAs` is only for the **View gateway call** sheet. It truncates the header in the UI trace so the signed blob is not dumped into the browser transcript. Dome still receives the unredacted value. ```ts title="server/dome.ts" if (actAs) { const signed = actAsHeaderValue(actAs); if (signed) { headers["X-Dome-Act-As"] = signed; // sent to Dome displayHeaders["X-Dome-Act-As"] = redactActAs(signed); // shown in the sheet } } ``` ```ts title="server/types.ts" export function redactActAs(header: string) { if (header.length <= 16) return ""; return `${header.slice(0, 12)}…(${header.length} chars)`; } ``` Start the app: ```bash npm run dev ``` Open [http://localhost:5173](http://localhost:5173). The **Act as** bar appears when `DOME_ACTAS_SECRET` is set. ### Click through Eva, Alice, and Carol [#click-through-eva-alice-and-carol] Stay on **tools** for the clearest contrast: 1. Select **Eva Martinez** (HR · `hr` · E005). 2. Click **List employees**. Allowed. 3. Click **Who is E001?**. Allowed. Email arrives as `[REDACTED]` (filter still applies). 4. Click **What is Alice's salary?**. Allowed (HR-only). 5. Select **Alice Johnson** (Engineering · E001). 6. Click **Who is E001?**. Allowed (self: `sub` matches `employee_id`). Email still redacted. 7. Click **What is Alice's salary?**. Denied. 8. Select **Carol Williams** (Engineering · E003). 9. Click **Who is E001?**. Denied. Open **View gateway call** and confirm `X-Dome-Act-As` on the request. The response carries the Cedar reason. If you want, try the same walk on **Chat** — ask **Who is E001 and how do I reach them?** as Eva, then Alice, then Carol. Same prompt, different outcomes. Model and tool steps both carry the signed identity. | Persona | List employees | Who is E001? | Alice's salary | | ----------------- | -------------- | ------------------------- | -------------- | | Eva (`hr` · E005) | Allowed | Allowed · redacted | Allowed | | Alice (E001) | Allowed | Allowed · self · redacted | Denied | | Carol (E003) | Allowed | Denied | Denied | One UI, one agent, one credential, three answers. Alice can still see herself. Carol cannot open Alice's record. Only Eva reaches payroll. > **Note**: For a real identity provider, configure the agent with `--actas-method oidc` and forward the JWT your application already validated as `X-Dome-Act-As`. The gateway verifies the signature against the provider's discovery document, so your service never becomes the authority on who the caller is. HMAC is the workspace path. [Govern callers with OIDC](/tutorials/production/govern-callers-with-oidc) builds that production path against your own identity provider. **Troubleshooting** These are remediation steps if you get stuck: * The Act as bar does not appear. `DOME_ACTAS_SECRET` is missing or empty. Restart `npm run dev` after writing `.env`. Confirm `/api/config` returns `"actAsEnabled": true`. * `400` with `act-as header required`. The agent is registered with `--actas-required` and the call carried no identity. Confirm the app is sending a persona and that the secret is set so the proxy signs. * `403` with `act-as verification failed`. The signature did not verify. Usually the secret in `.env` is not the one the agent holds. Rotate both to a known value: ```bash dome agents update delegated-hr --actas-hmac-secret "$NEW_SECRET" ``` * `403` with `agent act-as method does not meet workspace policy`. The workspace requires a stronger verification method than this agent uses, typically `oidc` rather than `hmac`. Check the policy before weakening anything: ```bash dome agents get delegated-hr ``` * Both users get the same answer. The rule is not reading the claim you think it is, or you are still on the `hr-assistant` token. Simulate both identities again and confirm `.env` uses the `delegated-hr` key: ```bash dome rules simulate --agent delegated-hr --action mcp:call \ --resource demo-hr/hr/get_employee --resource-type mcp_tool \ --actas-sub alice --actas-groups engineering ``` * A `VITE_` env var or browser network tab shows calls to the gateway / holds `dome_…`. Wrong shape. Move the token and act-as secret back to server `.env` and call Dome only from the Hono proxy. The frontend may only hit `/api/*` on your origin. * Chat fails with a pool / llm error while tools work. Apply the pool rule to this agent: ```bash dome rules apply delegated-hr.cedar delegated-hr-llm.cedar --agent delegated-hr --name delegated-hr ``` * The employee record arrives with a masked email for Eva or Alice. That is the response filter from the first tutorial, still doing its job on this connection. Filters apply to the tool, not to the agent, so a second agent inherits them. ## Verify the results [#verify-the-results] Confirm both decisions are on the record: ```bash dome audit query --limit 20 ``` Each event carries the agent and the verified end user, so a denial is attributable to a person rather than to a shared service account. That is the audit property act-as buys you, and it is the one that matters during an investigation. To read only the rejection: ```bash dome audit query --results denied --limit 10 ``` A rejected identity is a completed `tool.call` with `result=denied`, just like a policy refusal. Use `denial.reason`: `act_as_rejected` means the assertion did not verify, while `policy_denied` or `permission_denied` means authorization refused the call. > **Note**: Quotas take end users as subjects too. `dome quotas set --subject act-as --act-as E005 --limit 20` caps one person's inference spend, which is how you stop a single runaway session from consuming a team's budget. ## Clean up [#clean-up] This is the last tutorial in the Get Started track. Delete the workspace to remove the agents, rules, and grants together: ```bash dome workspaces delete studio-get-started ``` To keep the workspace and retire only this agent: ```bash dome agents revoke-key delegated-hr delegated-hr-service ``` Rotate the act-as secret anywhere you copied it. It signs identity assertions, so treat it like the credential it is. Clear `DOME_ACTAS_SECRET` (or switch back to the `hr-assistant` token) if you return to earlier tutorials. ## Next steps [#next-steps] You learned how to require verified end-user identity, authorize from the person, and attribute decisions to both agent and user. Continue with: * [Delegated agents](/build/agents/delegated) to configure verification providers and Act-As * [Simulate Rules](/govern/rules/simulate) to probe Act-As decisions before deploy # Govern your first agent (/tutorials/get-started/govern-your-first-agent) Dome is the governance layer for agentic software. It gives every agent an identity, enforces what each agent can call, redacts sensitive fields, and records every decision. Set up a governed HR assistant with Dome in a tutorial workspace, then hand me the questions that prove allow, redact, and deny. First, show me this plan and ask me to confirm before running anything: 1. Install the Dome CLI and sign in (opens a browser), then sync contexts 2. Create a tutorial workspace 3. Register the demo HR tool server as `demo-hr` 4. Create a JSON filter that redacts contact fields on the response path 5. Register an hr-assistant agent and mint its API key 6. Grant gateway access and deploy Cedar rules allowing HR and IT tools, denying compensation and customer data 7. Write my MCP client config so the assistant can reach the governed gateway tools ingress — or skip the client and prepare curl against the same URL 8. Tell me which questions to ask (or which curls to run) and what I should expect Follow the commands at [https://docs.domesystems.ai/agent/tutorials/get-started/govern-your-first-agent.md](https://docs.domesystems.ai/agent/tutorials/get-started/govern-your-first-agent.md) exactly. Non-negotiable rules: * Narrate as you go. Before each step, tell me in one or two sentences what you are about to do and why it matters. Do not silently run the whole flow. * Confirm the active context. After switching context, run `dome context current` and confirm the workspace name starts with `studio-`. If it does not, stop and ask me. Never modify a workspace you did not provision in this session. * Never print the `dome_...` agent token in chat. Write it directly into the MCP config (or a gitignored `.env` for curl) and confirm that file is gitignored. * `dome auth login` opens a browser. Run it, then wait for me before continuing. After a successful sign-in, run `dome context sync` so stale workspaces drop out of the local cache. * You cannot reload my MCP config. After writing it, stop, tell me to enable the hr-assistant server, and wait for my confirmation. If I prefer curl instead of an MCP client, hand me the Verify the results curl tab and skip the client reload. * Do not call the governed tools yourself to demo the outcomes. After setup, give me the AI Client prompts or the API via curl commands and expected results, then stop so I can try them. * After each create/grant/deploy step, give me a markdown link into the Dome console for that resource. Derive the base URL from `dome auth status` → `Server` (for example `https://app.glint-8c.domesystems.ai/agents` after registering the agent, `https://app.glint-8c.domesystems.ai/tools` after adding the tool). * Expect re-runs. Check for existing resources before creating them and use `--if-not-exists` where available. * Never report a step as done without showing the command output. Write the config for whichever client I am in: `.cursor/mcp.json` for Cursor, `claude mcp add --transport http` for Claude Code, `~/.codex/config.toml` for Codex. Remind me that `AGENT_API_KEY` is the `Token: dome_…` from `dome agents create-key`, shown once. Mint another key if I lost it. Once I confirm the server is live, or if I am verifying with curl, tell me to try these prompts (or the matching curls), with the expected result for each: 1. "Who works here?" Expect a list of demo employees with ids such as `E001`. 2. "Who is E001, and how do I reach them?" Expect Alice Johnson's record with `email` as `[REDACTED]`. The filter strips contact fields on the way back. 3. "What is Alice's salary?" Expect Cedar to deny the call. 4. "Pull up the Acme Corp customer record." Expect a denial too. If it returns data, the rules are broader than intended. Tell me instead of moving on. After I try them, offer to run `dome audit query --limit 20` so I can see the decisions attributed to the agent, then point me at Call a model through a pool. Keep the workspace — later tutorials reuse it. In this tutorial, you will stand up an HR assistant that Dome governs. It can look up employees and org structure, but it cannot read compensation or customer records, and contact details come back masked. You will see those limits enforced from Cursor or Claude in the same chat UI you already use. If you prefer not to wire an MCP client, you can call the gateway directly with curl. To do this, you will: 1. **Prepare your environment**: Create a dedicated workspace for this tutorial. 2. **Add a tool**: Register the demo HR server and attach it to Default. 3. **Redact contact fields**: Create a JSON filter and assign it to the response path. 4. **Create the agent**: Register the assistant and create an API key. 5. **Set access rules**: Grant gateway access and deploy authorization rules. 6. **Connect your client**: Point Cursor, Claude, or Codex at the tools ingress — or skip ahead and verify with curl. 7. **Verify the results**: Test allow, redact, and deny in an AI client or via curl, then inspect audit. ## Prerequisites [#prerequisites] For this tutorial, you will need: * The Dome CLI. Refer to [Install](/install) for Homebrew and direct-download instructions. * A tenant `admin` role (or an org `owner` / `admin` via cascade) to create the workspace, plus permission to deploy rules. Refer to [Permissions](/concepts/platform/permissions). * Optional: Cursor, Claude Code, or another MCP client that accepts a remote URL plus a bearer `Authorization` header. If you only want to exercise the governed tools, curl is enough — skip [Connect your client](#connect-your-client) after you have the gateway URL and agent key. ### Install the CLI [#install-the-cli] The Dome CLI is the primary interface for managing agents, deploying rules, and operating the platform. Install it, then confirm the binary is on your `PATH`. **Homebrew (macOS and Linux)** ```bash brew trust dome-systems/tap brew install dome-systems/tap/dome ``` > **Note**: Homebrew 6 requires you to trust a third-party tap before it loads its formulae. On older Homebrew, `brew trust` is unnecessary and harmless. **Direct download** Set your platform, then extract the binary onto your `PATH`: ```bash VERSION=0.2.0 # latest: https://github.com/dome-systems/releases/releases/latest OS=darwin # or linux ARCH=arm64 # or amd64 curl -sSL "https://github.com/dome-systems/releases/releases/download/v${VERSION}/dome_${VERSION}_${OS}_${ARCH}.tar.gz" | tar xz sudo mv dome /usr/local/bin/dome ``` Confirm the binary is on your `PATH`: ```bash dome version ``` ### Sign in [#sign-in] Log in. The CLI opens a browser-based SSO flow and stores a session token locally on success. ```bash dome auth login ``` > **Note**: If your invitation points at a non-default environment, for example a dedicated development stack, pass the server URL explicitly: > > ```bash > dome auth login --server https://app.glint-8c.domesystems.ai > ``` Confirm the session: ```bash dome auth status ``` You should see `Authenticated true` with your server and org. List the contexts available to your account. You will create a workspace under a tenant in the next section. ```bash dome context list ``` > This tutorial runs entirely in a workspace. In a production workspace, attaching backends is typically an operator action and deploying rules a security action. ## Prepare your environment [#prepare-your-environment] Dome nests resources so teams can share a company account without sharing data. * An **organization** is the company boundary for billing, ownership, and invites. * A **tenant** is a hard isolation wall inside that company. Agents and data in one tenant cannot see another. * A **workspace** is where you actually work: agents, tools, rules, and audit. Refer to [Platform scope](/concepts/platform/scopes) concept. Create a standard [workspace](/concepts/platform/scopes) for this tutorial. It has the same capabilities as any other workspace, so use a clear name and delete it only when you no longer need its resources. ```bash dome workspaces create --name studio-get-started ``` The command creates `studio-get-started` and selects it as the active context. Confirm it: ```bash dome context sync dome context current ``` Confirm you are on the workspace and note the gateway host. You need it when you configure your client: ```bash dome context current ``` Check that the workspace reads `studio-get-started` before continuing. Everything after this point creates or changes resources. ## Add a tool [#add-a-tool] A [tool](/connect/tools) is a backend the gateway calls on an agent's behalf. The agent never sees its URL or credentials. Register the public demo server as `demo-hr` and attach it to Default, the [Gateway](/build/gateways) your client will connect to. A tool is unreachable until it belongs to one. ```bash dome tools add \ --name demo-hr \ --url https://demo-mcp.domesystems.ai/mcp \ --protocol streamable-http \ --auth-method none \ --gateway Default ``` The connection name prefixes every tool it exposes, so the demo server's ten tools become `demo-hr/it/get_incidents`, `demo-hr/hr/get_employee`, and so on. You will use those qualified names when you write rules. ## Redact contact fields [#redact-contact-fields] The assistant needs employee directory details. It does not need anyone's email address or phone number. A [Guard](/govern/guards) inspects tool responses before they reach the agent, so you can strip those fields without asking the backend to change. Tool connections take JSON filters, which match fields by path and act on them. Create `redact-contact.json`: ```json title="redact-contact.json" { "json": { "components": [ { "fieldActions": [ { "matcher": { "path": "**.email" }, "action": "FILTER_ACTION_REDACT" }, { "matcher": { "path": "**.phone" }, "action": "FILTER_ACTION_REDACT" } ] } ] } } ``` The `**.` prefix is recursive descent: it matches the named field at any depth. That covers the top-level `email` on an employee record and the nested `primary_contact.email` on a customer record, without enumerating either path. Create the filter from that config: ```bash dome guards filters create redact-contact \ --description "Redact contact fields in tool responses" \ --config-from redact-contact.json ``` You should see `Filter created: redact-contact` with an ID and `v1`. Filters are versioned, so a later change deploys a new version and leaves this one in history. Creating a filter does not apply it. Assign it to the response direction on the connection: ```bash dome tools guards filters set demo-hr \ --direction response \ --filters redact-contact ``` Assignments are per direction. This one inspects what comes back from the tool. A `request` assignment would inspect the arguments going out. ## Create the agent [#create-the-agent] Register an [agent](/concepts/agents/identity) to mint its identity, then issue a credential. ```bash dome agents register --name hr-assistant --if-not-exists ``` The CLI prints `Agent registered: hr-assistant` with the agent UUID. The API key is shown once. Save it before moving on: ```bash dome agents create-key hr-assistant --name cursor ``` Store the `Token: dome_…` value in a password manager or your client config directly. It is a bearer token for a live gateway, so treat it like a production credential. ## Set access rules [#set-access-rules] Access in Dome is two decisions. First, may this agent reach a gateway at all? Second, once it is there, which tools may it actually call? You will grant the first with a gateway access grant, then tighten the second with Cedar rules. ### Grant gateway access [#grant-gateway-access] ```bash dome gateways access grant Default hr-assistant ``` You should see confirmation that `hr-assistant` was granted access to Default. That grant does two things: 1. **Admits** the agent at the Default endpoint, so the gateway will accept its requests. 2. **Permits** every resource currently in Default, plus any resource added later. That is a useful baseline for a brand-new agent, but it is broader than this HR assistant's job. The next step narrows it. ### Deploy authorization rules [#deploy-authorization-rules] For this assistant, you will deploy three rules: 1. Keep tool discovery open, so the client still lists every demo tool. 2. Name the five HR and IT tools this assistant may call. 3. Add a `forbid … unless` that blocks everything else. The last two share the same allowlist. `forbid` always wins over `permit`, so tools outside the list stay denied even when the gateway grant would allow them. Create `hr-assistant.cedar`: ```cedar title="hr-assistant.cedar" permit( principal is Dome::Agent, action == Dome::Action::"mcp:discover", resource ); permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) when { resource in [ Dome::MCPTool::"demo-hr/hr/list_employees", Dome::MCPTool::"demo-hr/hr/get_employee", Dome::MCPTool::"demo-hr/hr/org_chart", Dome::MCPTool::"demo-hr/it/list_services", Dome::MCPTool::"demo-hr/it/get_incidents" ] }; forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) unless { resource in [ Dome::MCPTool::"demo-hr/hr/list_employees", Dome::MCPTool::"demo-hr/hr/get_employee", Dome::MCPTool::"demo-hr/hr/org_chart", Dome::MCPTool::"demo-hr/it/list_services", Dome::MCPTool::"demo-hr/it/get_incidents" ] }; ``` Deploy it as an agent-scoped bundle. Scoping to `hr-assistant` is what limits `principal is Dome::Agent` to this one agent: ```bash dome rules apply hr-assistant.cedar --agent hr-assistant --name hr-assistant ``` A successful deploy prints `Bundle deployed: hr-assistant` with a version and hash. Because only the `mcp:call` rules carry an allowlist, these rules gate invocation, not discovery. The assistant still lists all ten demo tools in your client. It just cannot call the six outside its job. Keeping discovery open is what lets you watch a denial happen instead of wondering why a tool vanished. ## Connect your client [#connect-your-client] Point your MCP client at the Default gateway's [tools ingress](/concepts/gateways/tools-gateway) and authenticate as the agent. That path is where MCP discovery and `tools/call` traffic enter the data plane: ``` https:///gateways//mcp ``` If you would rather not configure an MCP client, keep this URL and the agent token handy and jump to [Verify the results](#verify-the-results) — the curl tab hits the same tools ingress. Retrieve the three placeholders: * `AGENT_API_KEY`. The `Token: dome_…` value printed by `dome agents create-key` when you created the agent. Tokens are shown once and cannot be recovered. If you did not save it, mint another and use that value: ```bash dome agents create-key hr-assistant --name cursor ``` * `GATEWAY_HOST`. Prepend `https://` to your current Dome host, for example `https://gateway.dev.domesystems.ai`. ```bash dome context current ``` * `DEFAULT_GATEWAY_ID`. The UUID of the Default gateway. ```bash dome gateways list ``` The result should look similar to `https://gateway.dev.domesystems.ai/gateways/3f9a2c14-8d7e-4b1a-9c02-5e6f7a8b9c01/mcp`. That `/mcp` path is the tools ingress; model traffic uses a different path under the same `/gateways/` prefix. Register that endpoint with your client, passing the agent token as a bearer credential. Or skip the tabs below and use the same URL and token with curl in [Verify the results](#verify-the-results). **Cursor** Use project `.cursor/mcp.json` or **Settings → MCP**: ```json { "mcpServers": { "hr-assistant": { "url": "https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID/mcp", "headers": { "Authorization": "Bearer AGENT_API_KEY" } } } } ``` Gitignore this file. It holds a live gateway credential. **Claude Code** Run this in your terminal, not inside a `claude` session: ```bash claude mcp add --transport http hr-assistant \ https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID/mcp \ --header "Authorization: Bearer AGENT_API_KEY" ``` Every flag must come before the server name. Keep `--transport http`: the gateway speaks Streamable HTTP, not the legacy `sse` transport Claude Code also supports. Confirm the result with `claude mcp list`. **Codex** Codex reads the token from the environment rather than the config file, so export it first: ```bash export DOME_AGENT_TOKEN=AGENT_API_KEY ``` Then add the server to `~/.codex/config.toml`, or `.codex/config.toml` for a single trusted project: ```toml [mcp_servers.hr-assistant] url = "https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID/mcp" bearer_token_env_var = "DOME_AGENT_TOKEN" ``` `bearer_token_env_var` takes the **name** of the variable, not the token itself. Codex resolves it at launch, so export it before starting a session, then verify with `/mcp`. Reload MCP. Tools such as `demo-hr/hr/list_employees` appear once the client connects. If you are verifying with curl instead, you can skip the reload and continue. **Troubleshooting** These are remediation steps if you get stuck: * No tools appear after reloading. Confirm the URL ends in `/mcp` and includes the `/gateways/` segment. A bare gateway host serves nothing. Then confirm the agent has both a gateway grant and a deployed bundle: ```bash dome gateways access list Default dome rules simulate --agent hr-assistant --action mcp:discover \ --resource demo-hr/hr/list_employees --resource-type mcp_tool ``` Your bundle permits `mcp:discover` outright, so a `DENY` here means the bundle did not deploy. An empty access list means the grant did not land. * Every call returns an authorization error. The token is incomplete, or it belongs to a different agent. Tokens are shown once and cannot be recovered, so mint a fresh one and replace the credential in your client: ```bash dome agents create-key hr-assistant --name cursor-2 ``` * The employee record still shows a real email address. The filter exists but is not assigned, or it is assigned to the wrong direction. Confirm the chain on the response path: ```bash dome tools guards filters list demo-hr ``` Assignments are picked up on the next gateway sync, so allow a moment after setting the chain. * Tools appear but calls time out. The demo server is public and unauthenticated, so a timeout usually points at egress restrictions on your network. Confirm you can reach `https://demo-mcp.domesystems.ai/mcp` directly. ## Verify the results [#verify-the-results] Confirm allow, redact, and deny without changing the chat UI. Only the tool path is governed. Use an AI client if you connected one above, or POST MCP JSON-RPC to the same tools ingress with curl. Export the same placeholders once if you are using the curl tab: ```bash export DOME_GATEWAY_URL="https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID" export DOME_TOKEN="AGENT_API_KEY" ``` **AI Client** Ask the assistant the prompts below. 1. **Who works here?** The call is allowed. You receive the demo employee directory, including ids such as `E001`: ```json { "id": "E001", "name": "Alice Johnson", "department": "Engineering", "title": "Senior Engineer" } ``` 2. **Who is E001, and how do I reach them?** The call is allowed, and the filter masks the contact field on the way back: ```json { "id": "E001", "name": "Alice Johnson", "department": "Engineering", "title": "Senior Engineer", "email": "[REDACTED]" } ``` The assistant learns who the person is and loses the ability to contact them directly. The backend still returned the real address. The filter replaced it before the agent saw it. 3. **What is Alice's salary?** The call is denied. `demo-hr/finance/get_salary` is not in the allowlist, so the `forbid` applies. The gateway returns a JSON-RPC error rather than data: ```json { "error": { "code": -32001, "message": "" } } ``` Your assistant paraphrases this in its own words, so the exact wording in chat varies. The audit trail below is the authoritative record. 4. **Pull up the Acme Corp customer record.** Also denied, and you never named this tool in the rule. That is the difference between an allowlist you maintain by hand and a boundary that holds by default. **API via curl** Post JSON-RPC `tools/call` to the gateway MCP endpoint. Substitute the exports above, or paste the URL and bearer token inline. 1. **List employees**, allowed: ```bash curl -sS -X POST "$DOME_GATEWAY_URL/mcp" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "demo-hr/hr/list_employees", "arguments": {} } }' ``` Expect demo employees in `result`, including `E001`. 2. **Get E001**, allowed, contact redacted: ```bash curl -sS -X POST "$DOME_GATEWAY_URL/mcp" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "demo-hr/hr/get_employee", "arguments": { "employee_id": "E001" } } }' ``` Expect `"email": "[REDACTED]"` in the returned record. The backend still returned the real address. The filter replaced it before your client saw it. 3. **Get salary**, denied: ```bash curl -sS -X POST "$DOME_GATEWAY_URL/mcp" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "demo-hr/finance/get_salary", "arguments": { "employee_id": "E001" } } }' ``` Expect a JSON-RPC `error` with code `-32001` and a reason from the authorization decision, not a salary payload. 4. **Get customer**, denied, and never named in the allowlist: ```bash curl -sS -X POST "$DOME_GATEWAY_URL/mcp" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 4, "method": "tools/call", "params": { "name": "demo-hr/sales/get_customer", "arguments": { "name": "Acme Corp" } } }' ``` Expect the same class of denial. That is the difference between an allowlist you maintain by hand and a boundary that holds by default. ### Inspect the audit trail [#inspect-the-audit-trail] Every allow, filter, and deny is attributable to the agent: ```bash dome audit query --limit 20 ``` You should see `tool.call` at attempted and completed stages, the sibling `guard.filter.evaluate`, and a completed `tool.call` with `result=denied`, each carrying the `hr-assistant` agent ID. To read only the rejections, filter by result: ```bash dome audit query --results denied --limit 10 ``` ### Test rule changes without a client [#test-rule-changes-without-a-client] Simulation runs the same evaluator as the gateway with no side effects, so you can check a rule before shipping it without a client reload or a real call: ```bash dome rules simulate --agent hr-assistant --action mcp:call \ --resource demo-hr/hr/get_employee --resource-type mcp_tool ``` Expect `ALLOW`. Swap the resource for `demo-hr/finance/get_salary` or `demo-hr/sales/get_customer` and expect `DENY` for both. This is the loop to use when you tighten the rule later. ## Next steps [#next-steps] You learned how to register an agent, attach a tool through a gateway, deploy rules and a guard, and verify allow, redact, and deny. Keep the `studio-get-started` workspace for the rest of this track. Continue with: * [Call a model through a pool](/tutorials/get-started/call-a-model-through-a-pool) to put an LLM behind the same gateway Refer to the following docs for topics covered in this lab: * [Agents](/build/agents) to manage identities, keys, and lifecycle * [Authorize Access](/govern/rules) to write and deploy Cedar rules # Get started (/tutorials/get-started) Each one builds on the workspace the one before it left behind, and every one ends with a governed call you can verify in the audit trail. 1. [Govern your first agent](/tutorials/get-started/govern-your-first-agent): Allow employee lookups, redact contact details, and deny payroll — from Cursor, Claude, or curl. 2. [Call a model through a pool](/tutorials/get-started/call-a-model-through-a-pool): Route chat through a model pool with failover, and keep your provider key server-side. 3. [Build a governed app](/tutorials/get-started/build-a-governed-app): Wire model and tool calls into one application. Watch allow, redact, and deny. 4. [Govern per end user](/tutorials/get-started/govern-per-end-user): Give each person different tool access and different answers from the same agent. # Adopt an existing app (/tutorials/production/adopt-an-existing-app) You already have an app calling a provider directly. The provider key is in its environment, spend shows up on an invoice, and nothing records which part of your system asked for what. Dome speaks the providers' own wire protocols, so adoption is a configuration change rather than a rewrite. The work is proving parity and keeping a way back. Move my existing LLM app onto Dome without rewriting its logic, and keep a rollback. First, inspect my repository and show me this plan with your findings, then ask me to confirm before changing anything: 1. Every place my code constructs a provider client or names a model, and which provider SDKs I use 2. Any API surface I use that Dome does not proxy, so I know the risks before I start 3. A Dome model connection mirroring my current provider and model 4. The three configuration values that change, wired so I can revert by changing one variable 5. A parity check: the same prompt through both paths, compared 6. A rule and a spend cap once parity holds Follow the commands at [https://docs.domesystems.ai/agent/tutorials/production/adopt-an-existing-app.md](https://docs.domesystems.ai/agent/tutorials/production/adopt-an-existing-app.md) exactly. Non-negotiable rules: * Read before you write. Show me what you found in my code and wait for confirmation before editing anything. * Change configuration, not logic. Do not restructure my code, swap my SDK, or "improve" my prompts while you are here. If my code hardcodes a base URL or a key, tell me and propose the smallest change that makes it configurable. * Do not touch production. Work on a local or development environment only. Ask me which one before you start. * Keep the rollback real. The switch back must be a single environment variable, and you must show me it works before we go further. * Never print or commit my provider key or the `dome_...` agent token. Confirm the env file is gitignored. * Workspace first. Create a workspace for the parity check rather than using a real workspace, unless I tell you otherwise. * Do not skip the parity check. Run the same prompt through both paths and show me both outputs before recommending the switch. * Never report a step as done without showing the command output. Tell me plainly if any part of my app cannot move yet, and why. Then show me the spend and the audit trail for the calls the governed path made. In this tutorial, you will repoint an app that already calls a provider at Dome, verify it behaves the same, then add the governance that was the reason for moving. Your application logic does not change. To do this, you will: 1. **Check what Dome proxies**: Confirm your API surface is supported before you start. 2. **Mirror your model in Dome**: Create a connection that matches what you call today. 3. **Switch one environment**: Change three values, keeping a one-variable rollback. 4. **Verify parity**: Compare the same request through both paths. 5. **Add the governance**: Apply the rule and the cap you moved for. ## Prerequisites [#prerequisites] For this tutorial, you will need: * An app that calls OpenAI or Anthropic through their official SDK or plain HTTP. * The Dome CLI. Refer to [Install](/install) for Homebrew and direct-download instructions. * The provider API key your app uses today. * A workspace you can experiment in. Create a workspace if you do not have one: ```bash dome workspaces create --name studio-adopt dome context sync dome context current ``` > Adopting an existing app usually spans two roles. A developer changes the configuration, while the rule and the spend cap belong to security and finance. Both halves are shown here. ## Check what Dome proxies [#check-what-dome-proxies] Establish this before you change anything, because it determines whether your app can move today. | Surface | Status | | -------------------------------- | ------------------------------------- | | `POST /v1/chat/completions` | Proxied | | `POST /v1/messages` | Proxied | | `POST /v1/messages/count_tokens` | Proxied | | `POST /v1/embeddings` | Proxied | | `GET /v1/models` | Proxied | | `POST /v1/responses` | Not yet. Returns `501` | | `POST /v1/moderations` | Not yet. Returns `501` | | Provider-specific endpoints | Through `POST /v1/passthrough/` | If your app is built on the OpenAI Responses API, it cannot move yet. Find out now rather than midway through a migration: ```bash grep -rn "responses.create\|/v1/responses\|moderations" --include="*.py" --include="*.ts" --include="*.js" . ``` Also find every place a client is constructed or a model is named. Those are the only lines this tutorial touches: ```bash grep -rn "OpenAI(\|Anthropic(\|base_url\|baseURL\|api_key\|apiKey" --include="*.py" --include="*.ts" --include="*.js" . ``` A base URL or key that is hardcoded rather than read from the environment is the one code change worth making. Make it configurable, and the rest of this is deployment work. ## Mirror your model in Dome [#mirror-your-model-in-dome] Create a connection that resolves to exactly what your app calls today. Name it after the model id your code already passes, and your application's model string keeps working unchanged: **OpenAI** ```bash dome models add gpt-4o \ --provider openai \ --model gpt-4o \ --api-key "$OPENAI_API_KEY" \ --gateway Default ``` **Anthropic** ```bash dome models add claude-3-5-sonnet-20241022 \ --provider anthropic \ --model claude-3-5-sonnet-20241022 \ --api-key "$ANTHROPIC_API_KEY" \ --gateway Default ``` Naming the connection after the upstream model is a deliberate migration convenience, not the end state. Dome resolves a connection name to a provider model, so a name of your own choosing lets you change providers later without touching the app. Adopt the model id first, rename once you are stable. The provider key now lives in Dome. Remove it from your app's environment at the end of this tutorial, not yet. You still need it for the parity check. Register an agent for the app and mint its credential: ```bash dome agents register --name checkout-service --if-not-exists dome agents create-key checkout-service --name production dome gateways access grant Default checkout-service ``` ## Switch one environment [#switch-one-environment] Three values change, and nothing else: | Value | From | To | | -------- | ---------------------- | --------------------------------------------------------- | | Base URL | The provider's default | `https:///gateways//v1` | | API key | Your provider key | The Dome agent token, `dome_…` | | model | A provider model id | Your Dome connection name | Naming the connection after the model handled the third. Wire the first two so that reverting is a single variable: ```python title="llm_client.py" import os from openai import OpenAI def build_client() -> OpenAI: """Route through Dome when configured; otherwise call the provider directly.""" gateway_url = os.getenv("DOME_GATEWAY_URL") if gateway_url: return OpenAI(base_url=f"{gateway_url}/v1", api_key=os.environ["DOME_TOKEN"]) return OpenAI(api_key=os.environ["OPENAI_API_KEY"]) ``` Unsetting `DOME_GATEWAY_URL` returns the app to the provider. That is the rollback, and it needs no deploy of new code. Collect the endpoint values: ```bash dome context current dome gateways list ``` Smoke-test the endpoint before you point the app at it. This lists the models the gateway exposes to you and confirms the URL and credential are right: ```bash curl -s https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID/v1/models \ -H "Authorization: Bearer AGENT_API_KEY" ``` > **Note**: Anthropic clients set `base_url` to the gateway **without** the `/v1` suffix, because their SDK appends `/v1/messages` itself. Anthropic routes also accept the credential in `x-api-key` when no `Authorization` header is present, so an app that only sets `x-api-key` works unchanged. ## Verify parity [#verify-parity] Run the same prompt through both paths and compare. Use a deterministic request so the comparison means something: ```python title="parity_check.py" import os from openai import OpenAI PROMPT = "Reply with exactly the word: ready" def ask(client: OpenAI) -> str: response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": PROMPT}], temperature=0, ) return response.choices[0].message.content direct = OpenAI(api_key=os.environ["OPENAI_API_KEY"]) governed = OpenAI( base_url=os.environ["DOME_GATEWAY_URL"] + "/v1", api_key=os.environ["DOME_TOKEN"], ) print("direct: ", ask(direct)) print("governed:", ask(governed)) ``` Both lines should match. Check three things beyond the text itself: that response objects carry the same shape your code already destructures, that streaming still streams if you use it, and that your latency budget still holds with a proxy hop in the path. Then confirm the governed call was recorded, which the direct call was not: ```bash dome audit query --limit 10 ``` You should see attempted and completed `model.call` events attributed to `checkout-service`; the completed event carries token usage. That record is the thing you did not have before. **Troubleshooting** These are remediation steps if you get stuck: * `400` with `select a gateway`. The base URL is missing its `/gateways/` segment. For OpenAI clients it must also end in `/v1`. * `404` with `no connection for requested model`. The model string in your code does not match a connection name in this workspace. Compare them: ```bash dome models list ``` * `403` with `model not available in this gateway`. The connection is not attached to Default. Check membership with `dome gateways get Default`. * `403` with `agent is not granted access to this gateway`. The agent has no admission grant. Note that `GET /v1/models` skips this check, so a working smoke test does not prove the grant exists: ```bash dome gateways access grant Default checkout-service ``` * `401` from the gateway. Your app is still sending the provider key. This endpoint authenticates the agent. * `429` with `llm: quota exceeded`. A spend cap fired. The message names the subject that ran out. * `501` on a request that worked before. You are calling a surface Dome does not proxy yet, such as Responses or Moderations. Keep those calls on the direct path until they are supported. * Requests succeed but nothing appears in audit. The app is still on the direct path. Confirm `DOME_GATEWAY_URL` is set in the environment the process actually reads. ## Add the governance [#add-the-governance] Parity holding is the midpoint, not the finish. Nothing is governed yet: the agent may call anything in the gateway and spend without limit. Deploy a rule naming what this app may invoke. Create `checkout-service.cedar`: ```cedar title="checkout-service.cedar" permit( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource == Dome::LLMModel::"gpt-4o" ); forbid( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource ) unless { resource == Dome::LLMModel::"gpt-4o" }; ``` ```bash dome rules apply checkout-service.cedar --agent checkout-service --name checkout-service ``` Then cap the spend. Set the limit from what this app actually costs, which you now have a record of: ```bash dome quotas set \ --subject agent \ --agent checkout-service \ --limit 200 \ --window monthly \ --name "checkout service" ``` Confirm both before you rely on them: ```bash dome rules simulate --agent checkout-service --action llm:invoke \ --resource gpt-4o --resource-type llm_model dome quotas list ``` Now remove the provider key from your app's environment. Until you do, the app can still bypass everything you just built by falling back to the direct path. > **Note**: Keep the fallback branch in the code if you want, but point it at nothing. A rollback path that silently restores ungoverned access is worse than no rollback path, because it works. ## Verify the results [#verify-the-results] Four things should now be true, and each has a command that proves it: 1. The app reaches the provider only through Dome. Its environment no longer holds a provider key. 2. Calls are attributed. `dome audit query --limit 10` names `checkout-service`. 3. Only the intended model is reachable. Simulating any other connection name returns `DENY`. 4. Spend is capped. `dome quotas list` shows the limit and what has been used against it. Roll out the way you would any configuration change: one environment, then a share of production traffic, then the rest. Because the switch is an environment variable, staged rollout and rollback use the mechanism you already have. ## Next steps [#next-steps] In this tutorial, you: * Confirmed your [API surface](/concepts/gateways/llm-gateway) was proxied before starting, rather than discovering a gap midway. * Moved a provider credential into [Dome](/connect/models) and out of your app's environment. * Changed three configuration values and no application logic, keeping a one-variable rollback. * Proved parity before adding constraints. * Applied a [rule](/govern/rules) and a [quota](/govern/quotas) sized from real usage. Continue with: * [Debug a tool call denial](/tutorials/production/debug-a-denial): Diagnose the first rejection your rollout produces. * [Govern per end user](/tutorials/get-started/govern-per-end-user): The agent inherits each user's permissions — same agent, different tool access and answers per person. * [Pools](/connect/pools): Failover and routing across providers once you are behind the gateway. * [LLM gateway](/concepts/gateways/llm-gateway): Endpoints, pipeline stages, and error shapes in full. # Debug a tool call denial (/tutorials/production/debug-a-denial) An agent reports that a tool call failed. The message it repeats to you came from a model paraphrasing an error, so it is not evidence. Dome recorded the actual decision, and several different gates could have produced it. The skill worth having is narrowing quickly: which gate answered, and what would change the answer. Teach me to diagnose Dome denials by planting three different failures in my workspace and walking me through each one. First, show me this plan and ask me to confirm before running anything: 1. Confirm the workspace from the first tutorial is still active 2. Reproduce a Cedar denial and show me how to attribute it to a rule 3. Reproduce a gateway access denial and show me how it differs from Cedar authorization 4. Reproduce a malformed endpoint error and show me how it differs from an authorization error 5. Show me the audit evidence and the simulation for each 6. Restore everything you changed Follow the commands at [https://docs.domesystems.ai/agent/tutorials/production/debug-a-denial.md](https://docs.domesystems.ai/agent/tutorials/production/debug-a-denial.md) exactly. Non-negotiable rules: * Narrate as you go. For each failure, tell me what you are breaking, what error I should expect, and which gate produced it. Do not silently run the whole flow. * Confirm the active context. Run `dome context current` and confirm the workspace name starts with `studio-`. If it does not, stop and ask me. Only change the workspace selected for this tutorial. * Restore every change you make, in the same session, and prove it with the command output. Do not leave the workspace in a broken state. * Diagnose from evidence, not from guessing. For each failure, show me the audit event and the simulation result, not just the client-side error. * Do not fix a denial by widening the rules. Show me what the rule says, then restore the original state. * Never print the `dome_...` agent token in chat. * Never report a step as done without showing the command output. For each of the three failures, tell me the one command I would have run first if I did not know the cause in advance. Then give me a short summary I can keep: which error message points at which gate. In this tutorial, you will plant three failures at three different layers and diagnose each from the outside. By the end you will be able to read an error message and know which command to run first. To do this, you will: 1. **Learn the order of the gates**: Understand what runs before what. 2. **Diagnose a rule denial**: Attribute a rejection to the rule that caused it. 3. **Diagnose a Gateway access denial**: Find the missing gateway grant that rejects invocation before Cedar evaluates the resource. 4. **Diagnose a malformed endpoint**: Separate transport problems from authorization problems. 5. **Tell denials from redactions**: Recognize the events that are not denials. ## Prerequisites [#prerequisites] For this tutorial, you will need: * The Dome CLI. Refer to [Install](/install) for Homebrew and direct-download instructions. * [Govern your first agent](/tutorials/get-started/govern-your-first-agent) completed, with its workspace still active. You will use its `hr-assistant` agent, its rule bundle, and its `demo-hr` connection. Confirm the workspace, and stay in the workspace. You are about to break things deliberately: ```bash dome context current ``` ## Learn the order of the gates [#learn-the-order-of-the-gates] A call passes several independent checks before it reaches a backend. They run in a fixed order, and the first one to reject ends the call, so the gate that answered tells you where to look. | Order | Gate | What it decides | Typical signal | | ----- | ------------------- | ---------------------------------------------- | -------------------------------------------------------------- | | 1 | Authentication | Is this a valid, active credential? | `401`, or `403` for a suspended or revoked agent | | 2 | Act-as verification | Is the end-user identity present and provable? | `400 act-as header required`, `403 act-as verification failed` | | 3 | Endpoint selection | Did the caller name a gateway? | `400 select a gateway` | | 4 | gateway membership | Is this resource in that gateway? | `tool not available in this gateway` | | 5 | gateway admission | Is this agent granted access to that gateway? | `agent is not granted access to this gateway` | | 6 | quota | Is there budget left? | `429 llm: quota exceeded` | | 7 | rules | Does Cedar permit it? | `denied by rule: ` | Two properties of this ladder cause most confusion. Quota sits **above** rules. A permit that looks correct still fails if the spend cap is exhausted, so a rule you just deployed is not always the thing to change. Discovery behaves differently from invocation. `tools/list` remains membership- and Cedar-filtered and does not prove that the agent has a gateway access grant. The grant is enforced when the agent invokes a resource, so use an actual call as the access check. ## Diagnose a rule denial [#diagnose-a-rule-denial] Start with the denial you already have. The `hr-assistant` rules permit five tools and forbid the rest, so payroll is rejected. Ask the assistant in your MCP client: ``` What is Alice's salary? ``` Your client shows whatever the model made of the error. The underlying response is a JSON-RPC error with code `-32001`, carrying `dome.authorization_denied` in its `data.type`, and a message that is Dome's recorded reason rather than the model's paraphrase. Get the authoritative record: ```bash dome audit query --results denied --limit 5 ``` The denied operation event names the agent and resource; its shared `denial` block names the reason. A reason of `denied by rule: ` means an explicit `forbid` matched. A reason of `denied by rule` with no identifier, or `no rule bundle loaded`, means nothing permitted the call rather than something forbidding it, which is a different fix. Confirm the decision without a client in the loop. Simulation runs the same evaluator with no side effects: ```bash dome rules simulate --agent hr-assistant --action mcp:call \ --resource demo-hr/finance/get_salary --resource-type mcp_tool ``` Expect `DENY` with the reason and the determining rule. Add `--json` for the full response, including the scope trace showing which scope contributed the decision. Then read what the agent is actually running under, which is not always what you think you deployed: ```bash dome rules show --agent hr-assistant ``` That resolves the whole hierarchy. To see only the agent-scoped bundle, use `dome agents get-policies hr-assistant`. > **Note**: Simulation takes the same identity flags the gateway would supply. `--actas-sub`, `--actas-email`, `--actas-groups`, and `--actas-roles` let you reproduce a denial that only affects one person, and `--eval-arguments` supplies tool arguments for rules that inspect them. ## Diagnose a Gateway access denial [#diagnose-a-gateway-access-denial] Now revoke the agent's gateway grant: ```bash dome gateways access revoke Default hr-assistant ``` Reload MCP in your client, then ask it to call `demo-hr/hr/list_employees`. The call fails with `agent is not granted access to this gateway` before the resource's Cedar rule is evaluated. Discovery can still list the tool, so a successful `tools/list` is not an access test. This is the case where simulation misleads you if you ask it the wrong question. Cedar still permits discovery, so a bundle check comes back clean: ```bash dome rules simulate --agent hr-assistant --action mcp:discover \ --resource demo-hr/hr/list_employees --resource-type mcp_tool ``` That returns `ALLOW` while invocation is rejected, because gateway admission runs before resource authorization. The permit is real but is never reached. The command to run first for a missing gateway grant: ```bash dome gateways access list Default ``` An empty result, or a list without `hr-assistant`, is your answer. Restore it: ```bash dome gateways access grant Default hr-assistant ``` Retry the tool call and confirm it succeeds. The lesson generalizes: when invocation reports a missing gateway grant, inspect gateway access before changing resource rules. Membership is the neighboring failure. A tool that exists but belongs to no gateway is unreachable through that endpoint. This command shows which resources a gateway actually carries: ```bash dome gateways get Default ``` ## Diagnose a malformed endpoint [#diagnose-a-malformed-endpoint] The third class of failure is not authorization at all, and it is worth being able to rule out in seconds. Call the gateway without naming a gateway: ```bash curl -i -X POST https://GATEWAY_HOST/mcp \ -H "Authorization: Bearer AGENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' ``` You get `400` with `select a gateway: use /gateways/{id}/mcp`. Nothing was evaluated and nothing appears in audit, because the request never identified a gateway to be evaluated against. The same applies to `/v1` for inference. Two related mistakes produce different errors, which is how you tell them apart: * A URL missing the `/mcp` suffix reaches no handler. * A valid URL with a wrong or unauthenticated token returns `401` from authentication, ahead of every authorization gate. The rule of thumb: **`400` and `401` are your problem, `403` and `-32001` are the policy's answer.** Only the second kind is worth taking to your security team. **Message-to-cause reference** Match the message you have to the gate that produced it: * `select a gateway`. The URL omits the `/gateways/` segment. Nothing was evaluated. * `401 invalid or expired token`. The credential is wrong, malformed, or rotated. Mint a new key rather than editing rules. * `403 agent is suspended` or `agent is revoked`. Lifecycle state, not policy. Check the agent record with `dome agents get`. * `act-as header required`. The agent requires a verified end-user identity and the call arrived without one. * `act-as verification failed`. An identity was presented but did not verify. Usually a mismatched HMAC secret or an expired token. * `tool not available in this gateway`. Membership. The tool exists but is not in this gateway, or the gateway is inactive. * `agent is not granted access to this gateway`. Admission on invocation. Discovery may still list the resource and is not proof that a grant exists. * `llm: quota exceeded`. A spend cap. The message names the subject that ran out. Check `dome quotas list`. * `denied by rule: `. An explicit `forbid` matched. Read it with `dome rules show --agent `. * `no rules for workspace` or `no rule bundle loaded`. Nothing was deployed, so the default deny applied. Deploy a bundle. * `policy stale` or `gateway policy stale, fail closed`. The gateway's policy copy aged past its tolerance and it is failing closed. This is an infrastructure signal, not a rule problem. ## Tell denials from redactions [#tell-denials-from-redactions] `guard.filter.evaluate` is a verdictless sibling event. Its `direction` and `actions` fields distinguish request and response changes. If an action blocks the operation, the enclosing `tool.call` or `model.call` carries `result=denied` and `denial.reason=guard_blocked`. This distinction matters when an agent reports missing data. If the field arrived as `[REDACTED]`, no denial occurred and the rules are not the place to look: ```bash dome tools guards filters list demo-hr ``` Filters attach to the connection, so every agent reaching that tool inherits them regardless of its own rules. For the full picture of a single request, follow its activity chain. One user action can span many events, and the chain shows them in order: ```bash dome audit chains --limit 10 dome audit chain ``` To read one event in full, including its payload: ```bash dome audit get ``` ## Verify the results [#verify-the-results] Confirm you left the workspace as you found it. The grant should be back: ```bash dome gateways access list Default ``` The five permitted tools should still allow, and payroll should still deny: ```bash dome rules simulate --agent hr-assistant --action mcp:call \ --resource demo-hr/hr/list_employees --resource-type mcp_tool dome rules simulate --agent hr-assistant --action mcp:call \ --resource demo-hr/finance/get_salary --resource-type mcp_tool ``` Expect `ALLOW` then `DENY`. `dome rules simulate` exits non-zero on a denial, which makes it usable as a check in CI: assert that the calls you intend to be impossible stay impossible. ## Next steps [#next-steps] In this tutorial, you: * Learned the order the [gates](/concepts/architecture/dataplane) run in, and why quota sits above rules. * Attributed a denial to its rule using the [audit trail](/operate/audit) rather than the client's paraphrase. * Found a missing gateway grant from its explicit invocation denial. * Separated transport errors from policy answers. * Distinguished a [Guard](/govern/guards) rewriting a field from a rule refusing a call. Continue with: * [Simulate rules](/govern/rules/simulate): Every flag, including identity and argument evaluation. * [Audit reference](/operate/audit): Event envelope, filters, chains, and export formats. * [Adopt an existing app](/tutorials/production/adopt-an-existing-app): Move an app you already run onto the governed path. * [Stream Live Events](/operate/observe): Live streams, metrics, and OpenTelemetry export. # Govern callers with OIDC (/tutorials/production/govern-callers-with-oidc) An internal assistant is shared infrastructure used by people with different entitlements. A finance analyst may open a department budget. An account executive may open customer contact details. Neither should inherit the other's reach because they happen to use the same assistant. Dome resolves that by governing the **caller**: the verified end user your application represents on each request. Your application forwards the signed identity token it already holds from workforce sign-in, Dome verifies it against your identity provider, authorizes from its claims, and records the person alongside the agent. description="Hand this to an AI agent. It provisions a workspace, wires your identity provider as the source of caller identity, and proves different outcomes for three real signed-in people." icon="sparkles" actions={["copy", "cursor"]} > Build a governed internal desk assistant where authorization comes from each signed-in employee's OIDC identity, then show me every caller Dome recorded. First, show me this plan and ask me to confirm before running anything: 1. Create a tutorial workspace and confirm I am in it 2. Register the public demo tool server as `internal-desk` on the Default gateway 3. Ask me for my OIDC issuer base URL and confirm its discovery document is reachable 4. Create a workspace verification provider from that issuer 5. Register `desk-copilot` bound to that provider with act-as required, mint its key, and grant gateway access 6. Deploy Cedar that reads `principal.act_as` groups and subject 7. Simulate an individual contributor, an account executive, and a finance analyst before any live call 8. Ask me for one development token per test user, then call the gateway as each of them 9. Show me the Callers registry and the audit evidence for each person 10. Require OIDC for the whole workspace and prove an unverified call fails Follow the commands at [https://docs.domesystems.ai/agent/tutorials/production/govern-callers-with-oidc.md](https://docs.domesystems.ai/agent/tutorials/production/govern-callers-with-oidc.md) exactly. Non-negotiable rules: * Narrate as you go. Before each step, tell me in one or two sentences what you are about to do and why it matters. * Confirm the active context. Run `dome context current` and confirm the workspace name starts with `studio-`. If it does not, stop and ask me. * Never print the `dome_...` agent token or any end-user token in chat. Write them into a gitignored env file and confirm it is ignored. * Use tokens issued by my identity provider. Do not mint, forge, or hand-assemble identity claims, and do not fall back to HMAC or a persona map. * Do not put my agent token or an end-user token in browser code, client env, or a URL query string. * Do not widen Cedar to make a denied call succeed. The differing outcomes are the result I am asking for. * Use `dome rules simulate` with act-as flags before any live call. * Read the demo directory first and use employee IDs it actually returns, rather than assuming which IDs exist. * After each create step, give me a markdown link into the Dome console for that resource. Derive the base URL from `dome auth status` → `Server`. * Never report a step as done without showing the command output. Show me clearly that the runs differ only in the verified identity, not in the request path or the rules. Then offer to delete the workspace. In this tutorial, you will govern a desk assistant that three employees share. All three reach the same agent, the same tools, and the same rules. Their answers differ because Dome verifies who is asking. To do this, you will: 1. **Prepare a workspace and a tool**: Create a workspace and attach the demo backend. 2. **Define the identity contract**: Pick the issuer and claims that policy will depend on. 3. **Register the identity provider**: Create a verification provider Dome can verify tokens against. 4. **Create the delegated agent**: Bind the agent to that provider and require verified identity. 5. **Write rules about the person**: Authorize from groups and subject rather than from the agent. 6. **Call as three employees**: Forward each signed-in user's token and compare outcomes. 7. **Inspect callers**: Read the registry and the audit evidence behind it. 8. **Require verified identity**: Raise the workspace floor and confirm it holds. ## Prerequisites [#prerequisites] For this tutorial, you will need: * The Dome CLI. Refer to [Install](/install) for Homebrew and direct-download instructions * A tenant `admin` role (or an org `owner` / `admin` via cascade) to create the workspace, plus permission to create providers and deploy rules. * An OIDC identity provider you administer, reachable from the internet, with a published discovery document and JWKS. * The ability to obtain a **development** ID or access token, in JWT form, for three test users in that provider. The three test users need different claims, because that difference is what the rules read: | Test user | `groups` | Represents | | --------- | ----------------- | ------------------------- | | First | `["engineering"]` | An individual contributor | | Second | `["sales"]` | An account executive | | Third | `["finance"]` | A finance analyst | One rule in this tutorial compares the caller's `sub` to an employee record in the demo backend, so the first user's `sub` should match an employee ID that backend returns. You will read the directory in the first live call and can adjust then. > **Warning**: Use test users in a development or staging tenant of your identity provider. Do not use a real employee's token, and do not paste any token into a ticket, a commit, or a chat transcript. ## Prepare a workspace and a tool [#prepare-a-workspace-and-a-tool] Create a dedicated workspace so nothing here touches a real environment: ```bash dome workspaces create --name studio-callers dome context sync dome context current ``` Confirm the workspace reads `studio-callers` before continuing. Attach the public demo backend as `internal-desk` on the Default [gateway](/build/gateways). The connection name prefixes every tool it exposes: ```bash dome tools add \ --name internal-desk \ --url https://demo-mcp.domesystems.ai/mcp \ --protocol streamable-http \ --auth-method none \ --gateway Default ``` Four of its tools carry this tutorial's scenario: | tool | Holds | Who should reach it | | ----------------------------------------- | ------------------------ | ------------------------- | | `internal-desk/hr/list_employees` | Employee directory | Anyone signed in | | `internal-desk/finance/expense_report` | One employee's expenses | Finance, or that employee | | `internal-desk/sales/get_customer` | Customer contact details | Sales | | `internal-desk/finance/department_budget` | Department spend | Finance | Only the second row depends on who is asking rather than on which team they belong to. That row is the reason act-as exists: no static grant on a shared agent can express "their own record." ## Define the identity contract [#define-the-identity-contract] Three systems have to agree before any of this works. Your identity provider issues claims, Dome verifies them, and Cedar reads them. Write the contract down first: | Contract field | Choice for this tutorial | Why it matters | | --------------- | ------------------------------------ | --------------------------------------------- | | Issuer | One exact OIDC issuer base URL | Dome fetches discovery and JWKS from it | | Subject | Stable directory identifier in `sub` | Identifies the caller and enables self-access | | Email | Informational | Search and investigation | | Groups | String array in `groups` | Team-level authorization | | Forwarded value | The exact signed JWT | Dome verifies the signature itself | Export the issuer base URL and confirm Dome will be able to read it. Dome appends the well-known path, so pass the issuer, not the discovery document: ```bash export OIDC_ISSUER="https://login.example.com" curl --fail --silent "$OIDC_ISSUER/.well-known/openid-configuration" ``` The response must contain `jwks_uri`. Prefer an immutable directory identifier for `sub`. Email addresses get changed and reassigned, and a self-access rule keyed on email inherits that problem. > **Note**: If your corporate login starts with SAML, use the OIDC issuer that signs the token your application will actually forward. A SAML assertion is not a valid `X-Dome-Act-As` value. Check that a development token matches the contract. Decode the payload locally and print only claim shapes, never values you would not want in a transcript: ```bash export IC_TOKEN="" node -e ' const claims = JSON.parse(Buffer.from(process.env.IC_TOKEN.split(".")[1], "base64url")); console.log({ iss: claims.iss, sub_present: Boolean(claims.sub), groups_type: Array.isArray(claims.groups) ? "array" : typeof claims.groups, expires_in_s: claims.exp - Math.floor(Date.now() / 1000), }); ' ``` `iss` must match the issuer you exported, `groups` must be an array, and the token must not be expired. Decoding proves nothing about the signature; Dome verifies that independently against the JWKS. > **Note**: Many providers omit `groups` until you add a claim mapping or request the right scope. Fix that in the provider now. A rule that reads a claim your tokens never carry denies every call and looks like a Dome problem. ## Register the identity provider [#register-the-identity-provider] A verification provider is named identity configuration the workspace owns. Agents reference it, so the issuer lives in one place and caller records get a stable provider boundary: ```bash dome verification-providers create \ --name workforce-oidc \ --method oidc \ --oidc-url "$OIDC_ISSUER" ``` List providers and keep the ID: ```bash dome verification-providers list --scope workspace --include-chain export OIDC_PROVIDER_ID="" ``` Providers are also visible to workspaces below their scope, which is how one platform team publishes the corporate issuer once for many product workspaces. In this workspace you own the only one. ## Create the delegated agent [#create-the-delegated-agent] Register the assistant so that identity is mandatory and can only come from that provider: ```bash dome agents register --name desk-copilot \ --actas-method oidc \ --actas-provider "$OIDC_PROVIDER_ID" \ --actas-required \ --if-not-exists ``` Two settings carry the meaning: * `--actas-method oidc` with `--actas-provider` makes your identity provider the authority on who the caller is. Your application never asserts identity on its own behalf. * `--actas-required` rejects a request that arrives with no identity, instead of quietly falling back to the agent's own standing permissions. Mint the credential the application will hold, and grant the agent access to the gateway: ```bash dome agents create-key desk-copilot --name desk-service dome gateways access grant Default desk-copilot ``` Save the `Token: dome_…` value into a gitignored env file. It is shown once, and it is a live gateway credential. ```bash export DOME_TOKEN="" export DOME_GATEWAY_URL="https:///gateways/" ``` Retrieve the host and gateway ID if you do not have them: ```bash dome context current dome gateways list ``` > **Warning**: The agent token authenticates the workload; the forwarded JWT identifies the person. Both belong on your server. A browser holding either one can impersonate the workload, the person, or both. ## Write rules about the person [#write-rules-about-the-person] Cedar sees the verified end user as `principal.act_as`, carrying `sub`, `email`, `roles`, `groups`, and any custom `claims`. Rules read those like any other attribute. This policy does four things: * Anyone with a verified identity can read the directory * Finance can open any expense report, and anyone can open their own * Sales can open customer contact details * Everything else is denied, including unverified calls Create `desk-copilot.cedar`: ```cedar title="desk-copilot.cedar" permit( principal is Dome::Agent, action == Dome::Action::"mcp:discover", resource ); permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"internal-desk/hr/list_employees" ) when { principal has act_as }; // Finance sees every expense report; everyone else sees only their own. permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"internal-desk/finance/expense_report" ) when { principal has act_as && ( principal.act_as.groups.contains("finance") || ( resource has arguments && resource.arguments has employee_id && resource.arguments.employee_id == principal.act_as.sub ) ) }; permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"internal-desk/sales/get_customer" ) when { principal has act_as && principal.act_as.groups.contains("sales") }; permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"internal-desk/finance/department_budget" ) when { principal has act_as && principal.act_as.groups.contains("finance") }; // Overrides the generated permit that opens every Default gateway tool. forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"internal-desk/finance/expense_report" ) unless { principal has act_as && ( principal.act_as.groups.contains("finance") || ( resource has arguments && resource.arguments has employee_id && resource.arguments.employee_id == principal.act_as.sub ) ) }; forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"internal-desk/sales/get_customer" ) unless { principal has act_as && principal.act_as.groups.contains("sales") }; forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"internal-desk/finance/department_budget" ) unless { principal has act_as && principal.act_as.groups.contains("finance") }; forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) unless { resource in [ Dome::MCPTool::"internal-desk/hr/list_employees", Dome::MCPTool::"internal-desk/finance/expense_report", Dome::MCPTool::"internal-desk/sales/get_customer", Dome::MCPTool::"internal-desk/finance/department_budget" ] }; ``` Deploy it scoped to this agent: ```bash dome rules apply desk-copilot.cedar --agent desk-copilot --name desk-copilot ``` The `principal has act_as` guard matters. When no identity was verified, the attribute is absent from the entity, and reading an absent attribute is an evaluation error rather than a false. Guarding it turns an unverified call into a clean deny. Nothing in these rules names an employee. They name claims. Adding a person to the finance group in your directory changes what the assistant will do for them, with no deploy here. ## Call as three employees [#call-as-three-employees] Export a development token per test user: ```bash export IC_TOKEN="" export AE_TOKEN="" export FIN_TOKEN="" ``` The header is the same on MCP, OpenAI-compatible, and Anthropic-compatible ingress. Only its value changes between users: ```bash call_as() { curl -sS -X POST "$DOME_GATEWAY_URL/mcp" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "X-Dome-Act-As: $1" \ -H "Content-Type: application/json" \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"$2\",\"arguments\":$3}}" } ``` Read the directory first. It is open to every verified caller, and it tells you which employee IDs the backend actually has: ```bash call_as "$IC_TOKEN" internal-desk/hr/list_employees '{}' ``` Pick one ID from that response for the individual contributor, and a different one for the expense report they should not reach: ```bash export OWN_ID="" export OTHER_ID="" ``` If the engineering test user's `sub` does not match any employee ID, change `sub` at your identity provider, or point the self-access comparison at a claim that does line up with your own systems. That mapping is the part every real deployment has to decide. Simulate the branches before you spend live calls on them. Simulation runs the same evaluator as the gateway with no side effects, no token, and no network call to your identity provider, and `--eval-arguments` supplies the arguments a rule compares: ```bash # The engineering user opening their own expenses. dome rules simulate --agent desk-copilot --action mcp:call \ --resource internal-desk/finance/expense_report --resource-type mcp_tool \ --eval-arguments "{\"employee_id\":\"$OWN_ID\"}" \ --actas-sub "$OWN_ID" --actas-groups engineering # The same person opening someone else's expenses. dome rules simulate --agent desk-copilot --action mcp:call \ --resource internal-desk/finance/expense_report --resource-type mcp_tool \ --eval-arguments "{\"employee_id\":\"$OTHER_ID\"}" \ --actas-sub "$OWN_ID" --actas-groups engineering # Sales opening customer contact details. dome rules simulate --agent desk-copilot --action mcp:call \ --resource internal-desk/sales/get_customer --resource-type mcp_tool \ --actas-sub sales-user --actas-groups sales # Finance opening a department budget. dome rules simulate --agent desk-copilot --action mcp:call \ --resource internal-desk/finance/department_budget --resource-type mcp_tool \ --actas-sub finance-user --actas-groups finance ``` Expect `ALLOW`, `DENY`, `ALLOW`, `ALLOW`. A rule that reads identity claims has more branches than a rule that reads a tool name, so this is the loop to keep. Now run the same requests as different people: ```bash # Own expenses: allowed by self-access. Someone else's: denied. call_as "$IC_TOKEN" internal-desk/finance/expense_report "{\"employee_id\":\"$OWN_ID\"}" call_as "$IC_TOKEN" internal-desk/finance/expense_report "{\"employee_id\":\"$OTHER_ID\"}" # Customer contact details: denied for engineering, allowed for sales. call_as "$IC_TOKEN" internal-desk/sales/get_customer '{"customer_id":"C001"}' call_as "$AE_TOKEN" internal-desk/sales/get_customer '{"customer_id":"C001"}' # Department budget: finance only. call_as "$AE_TOKEN" internal-desk/finance/department_budget '{"department":"Engineering"}' call_as "$FIN_TOKEN" internal-desk/finance/department_budget '{"department":"Engineering"}' # No identity at all: rejected before authorization. curl -sS -X POST "$DOME_GATEWAY_URL/mcp" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"internal-desk/hr/list_employees","arguments":{}}}' ``` | Caller | Directory | Own expenses | Others' expenses | Customer details | Department budget | | ----------- | --------- | ------------ | ---------------- | ---------------- | ----------------- | | Engineering | Allowed | Allowed | Denied | Denied | Denied | | Sales | Allowed | Allowed | Denied | Allowed | Denied | | Finance | Allowed | Allowed | Allowed | Denied | Allowed | | No identity | Rejected | Rejected | Rejected | Rejected | Rejected | One agent, one credential, one rule bundle, four outcomes. ### How a real application sends this [#how-a-real-application-sends-this] Curl stands in for your backend here. In an application, the token comes from the authenticated server-side session, per request: ```ts title="server/dome.ts" export async function callToolForUser( session: { subject: string; oidcJwt: string }, name: string, args: unknown, ) { if (!session.oidcJwt) { throw new Error("session has no forwardable OIDC token"); } return fetch(`${process.env.DOME_GATEWAY_URL}/mcp`, { method: "POST", headers: { Authorization: `Bearer ${process.env.DOME_TOKEN}`, "Content-Type": "application/json", "X-Dome-Act-As": session.oidcJwt, }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "tools/call", params: { name, arguments: args }, }), }); } ``` Two boundaries keep this honest. Take the identity only from trusted session middleware, never from the request body, and build headers per request rather than attaching a user's token to a client shared across users. ## Inspect callers [#inspect-callers] Dome now knows three people. List them: ```bash dome callers list dome callers list --group finance dome callers list --search "$OWN_ID" ``` Inspect one: ```bash dome callers get "$OWN_ID" ``` The record shows the verified claims, the verification provider and methods observed, first-seen and last-seen timestamps, the agents and tools attributed to that person, and lifetime and current-month activity. Callers are a projection of verified traffic, not a directory you maintain. You never created these records; they appeared because requests carried tokens that verified. Two issuers can use the same `sub` without merging, since records are keyed by provider and subject. When the same subject appears under more than one provider, address it by the record UUID from `dome callers list --json`. Correlate the projection with the evidence underneath it: ```bash dome audit query --limit 20 dome audit query --act-as-sub "$OWN_ID" --limit 10 dome audit query --results denied --limit 10 ``` Every governed call names both actors: the agent that made the request and the person it represented. That is the property worth having during an investigation, because a denial belongs to a person rather than to a shared service account. The denials are not all the same kind. A `denial.reason` of `act_as_rejected` means the identity itself failed verification, so the application or the provider configuration is wrong. A policy denial means the identity verified and the rules refused the action, which is the boundary working. ```bash dome audit query --deny-reasons act_as_rejected --limit 10 ``` Erasing a caller with `dome callers delete` removes the projection and its activity rows, not the audit evidence, and later verified traffic recreates it. That is the shape a data-subject request takes here. ## Require verified identity [#require-verified-identity] `--actas-required` protects this one agent. A workspace dedicated to user-facing applications can require verified identity from every agent in it, so a new agent cannot be registered around the boundary. Read the current floor, then raise it: ```bash dome workspaces actas get dome workspaces actas update \ --required \ --allowed-methods oidc \ --required-provider "$OIDC_PROVIDER_ID" dome workspaces actas get ``` Confirm nothing changed for a verified caller and that an unverified call still fails: ```bash call_as "$FIN_TOKEN" internal-desk/hr/list_employees '{}' ``` The floor is a minimum. An agent may be stricter, for example by narrowing which verified subjects, emails, or groups it will accept, but it cannot opt out. An agent configured with `actas_method=none` is rejected outright once the workspace requires identity. > **Warning**: Workspace Act-As updates are a full replace: omitted flags clear their fields, and omitting `--required` sets it back to false. Pass the complete intended state every time. Before doing this in a real workspace, inventory what it would strand. Any standing agent, and any delegated agent that cannot present a token from the required provider, starts failing at the gateway: ```bash dome agents list ``` The order that holds up in production is: publish the provider, cut one agent over and compare its caller records against your application's own authenticated subject, move the rest, then raise the workspace floor in a change window with a rollback for the agent and workspace selections. **Troubleshooting** These are remediation steps if you get stuck: * `400` with `act-as header required`. The request carried no identity. Confirm your caller sets `X-Dome-Act-As`, and that the route runs behind authenticated middleware. Do not make identity optional to get past this. * `403` with `act-as verification failed`. The token did not verify. Check the issuer, the key ID against the published JWKS, and expiry. Development tokens are usually short-lived, so re-mint before assuming a configuration problem. * `unknown signing key`. The token came from a different issuer than the provider you configured, or the provider is pointed at the wrong discovery URL. Confirm with `dome verification-providers get "$OIDC_PROVIDER_ID"`. * The token has no dots, or verification fails on a token that looks fine. An opaque access token cannot be verified from discovery metadata. Forward a signed JWT from the same issuer. * Self-access is denied for the person's own record. The caller's `sub` and the `employee_id` argument are not the same string. Compare the directory listing with `dome callers get`, then simulate with the claims you actually observed. * Every caller gets the same answer. The rule is not reading the claim you expect. Confirm `groups` is a string array in the token rather than a space-delimited string. * `403 agent act-as method does not meet workspace policy`. The workspace floor requires a method or provider the agent does not use. Compare `dome workspaces actas get` with `dome agents get desk-copilot` before weakening either. * Nobody appears in `dome callers list`. The registry needs at least one successfully verified request. Query audit for `act_as_rejected`, and confirm you are reading the same workspace that received the calls. * Tools appear but calls time out. The demo backend is public and unauthenticated, so a timeout usually points at network egress. Confirm you can reach `https://demo-mcp.domesystems.ai/mcp` directly. ## Clean up [#clean-up] Delete the workspace to remove the agent, provider, rules, grants, and caller projections together: ```bash dome workspaces delete studio-callers ``` To keep the workspace and retire only the application credential: ```bash dome agents revoke-key desk-copilot desk-service ``` Clear the exported tokens from your shell, and revoke the development tokens at your identity provider if it allows it. ## Next steps [#next-steps] You made a shared assistant answer to each person using it: identity verified by your provider, authorization decided by Cedar on verified claims, and every decision attributable to a named caller. * [Callers](/connect/callers) for provider hierarchy, scope selection, registry filters, and erasure * [Delegated agents](/build/agents/delegated) for the full verification model, including allow-lists * [Pass identity for delegated agents](/develop#pass-identity-for-delegated-agents) for MCP and model client examples * [Quotas](/govern/quotas) to cap spend for one caller rather than for the whole agent * [Observe](/operate/observe) to attribute a rejection to the gate that produced it # Production (/tutorials/production) Five tutorials, in no particular order. Read the one that matches the problem in front of you. * [Run a managed agent](/build/agents/managed): Let Dome run an agent worker on demand, on a schedule, or from a signed webhook. * [Use Dome as an MCP gateway](/tutorials/production/use-dome-as-an-mcp-gateway): Let Cursor, Claude Code, or Codex sign in with your own Dome account and call MCP tools, individually audited. * [Use Dome as a model broker](/tutorials/production/use-dome-as-a-model-broker): Hold the provider key server-side and let Cursor, Claude Code, or Codex call any model, not just their own. * [Govern callers with OIDC](/tutorials/production/govern-callers-with-oidc): Authorize a shared assistant from each signed-in employee's identity provider token, then inspect every caller. * [Deploy an always-on agent](/tutorials/production/deploy-your-agent/always-on): Build a request-serving HTTP agent, deploy it as a private container service, and verify its governed calls. * [Deploy an event-driven agent](/tutorials/production/deploy-your-agent/event-driven): Build a bounded handler, invoke it once, then attach a schedule without moving credentials into the function. # Use Dome as a model broker (/tutorials/production/use-dome-as-a-model-broker) Your assistant already calls a model every time you chat with it. That call carries its own problems: a provider key sitting in the client's config, spend nobody notices until the invoice, and a model locked to whatever provider the client shipped with. Set yourself up to make your own model calls through Dome's model broker instead of calling the provider directly. First, show me this plan and ask me to confirm before running anything: 1. Install the Dome CLI if missing, sign in (opens a browser), then sync contexts 2. Create a tutorial workspace 3. Add a model connection with my provider API key, attached to the Default gateway 4. Register a `code-assistant` agent and mint its API key 5. Grant the agent gateway access and deploy a Cedar bundle that permits `llm:invoke` 6. Rewrite your own model configuration (base URL and key) to route through Dome 7. Tell me to reload, then make one completion and show me the resulting audit event Follow the commands at [https://docs.domesystems.ai/agent/tutorials/production/use-dome-as-a-model-broker.md](https://docs.domesystems.ai/agent/tutorials/production/use-dome-as-a-model-broker.md) exactly. Non-negotiable rules: * Ask me for my provider API key before you need it, and tell me which provider you expect. Do not look for one in my shell history, environment, or files. * Narrate as you go. Before each step, tell me in one or two sentences what you are about to do and why it matters. * Confirm the active context. After switching context, confirm the workspace name starts with `studio-`. If it does not, stop and ask me. * Never print my provider API key or the `dome_...` agent token in chat. Write the agent token directly into config, and confirm any file holding it is gitignored. * You cannot reload your own model configuration. After writing it, stop and tell me you need a restart, and wait for my confirmation before making a real call. * Never report a step as done without showing the command output. Once reloaded, make one completion to prove the path, then run `dome audit query --limit 5` and show me the resulting `model.call` event. In this tutorial, you will hold a provider key in Dome, register your assistant, and repoint its own inference (not a script, the assistant itself) at the Dome gateway. The provider never learns Dome is in front of it; it just sees a different caller. 1. **Prepare your environment**: Sign in and create a dedicated workspace. 2. **Add a model connection**: Register a provider model and hold its key in Dome. 3. **Create the agent**: Register an agent for your assistant and mint its API key. 4. **Authorize inference**: Grant gateway access and permit `llm:invoke`. 5. **Point your assistant at Dome**: Rewrite Cursor, Claude Code, or Codex's own model configuration. 6. **Verify the results**: Make one completion and confirm the audit event. ## Prerequisites [#prerequisites] For this tutorial, you will need: * The Dome CLI. Refer to [Install](/install) for Homebrew and direct-download instructions. * A tenant `admin` role (or an org `owner` / `admin` via cascade) to create the workspace, plus permission to deploy rules. * An API key for OpenAI, Anthropic, or both. Dome calls the provider on your behalf, so the spend lands on your provider account. A key for each provider lets you try swapping which model answers a given client, later in this tutorial. * Cursor, Claude Code, or Codex, each configurable with a custom model base URL and key. ## Prepare your environment [#prepare-your-environment] Sign in and create a tutorial workspace: ```bash dome auth login dome workspaces create --name studio-connect-assistant dome context sync dome context current ``` If you already have `studio-connect-assistant` from [Use Dome as an MCP gateway](/tutorials/production/use-dome-as-an-mcp-gateway), reuse it. This tutorial does not touch that gateway's tools. Confirm the workspace before continuing: ```bash dome context current ``` ## Add a model connection [#add-a-model-connection] A [model connection](/connect/models) is one upstream LLM endpoint and the credential Dome uses to reach it. The endpoint a client points at is a wire protocol, not a provider. Dome's Anthropic-shaped endpoint and its OpenAI-compatible endpoint can each resolve to any connection you name. The model behind a connection does not have to match the client calling it. Add whichever provider you have a key for. Add both if you want to try the swap later in this tutorial: **Anthropic** ```bash dome models add claude-broker \ --provider anthropic \ --model claude-3-5-sonnet-20241022 \ --api-key "$ANTHROPIC_API_KEY" \ --gateway Default ``` **OpenAI** ```bash dome models add openai-broker \ --provider openai \ --model gpt-4o \ --api-key "$OPENAI_API_KEY" \ --gateway Default ``` `--gateway Default` attaches it directly, without a pool. A [pool](/connect/pools) buys you failover and weighted routing across several connections. Reach for one once you have more than one model to route across; a single connection does not need it. Confirm the connection is registered: ```bash dome models get claude-broker # or openai-broker ``` ## Create the agent [#create-the-agent] Every call through a gateway is authorized and audited against this agent identity, not against Cursor, Claude Code, or Codex as a product. Register an [agent](/concepts/agents/identity) for your assistant, then mint a credential: ```bash dome agents register --name code-assistant --if-not-exists dome agents create-key code-assistant --name model-client ``` The `Token: dome_…` value is shown once. Save it. You paste it into your client's model configuration in a few steps. > **Note**: [Use Dome as an MCP gateway](/tutorials/production/use-dome-as-an-mcp-gateway) uses a different identity path: interactive sign-in instead of a static key. The two tutorials are independent; running one does not create the agent the other expects. ## Authorize inference [#authorize-inference] Grant access to the [Gateway](/build/gateways) if you have not already: ```bash dome gateways access grant Default code-assistant ``` `llm:invoke` is a separate action from `mcp:call`, so a tool-calling permit does not cover inference. Create `code-assistant-llm.cedar`: ```cedar title="code-assistant-llm.cedar" permit( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource is Dome::LLMModel ); ``` `resource is Dome::LLMModel` scopes the permit to this workspace's model connections, not a specific one, so adding a second model later needs no rule change. Deploy it scoped to this agent: ```bash dome rules apply code-assistant-llm.cedar --agent code-assistant --name code-assistant-llm ``` ## Point your assistant at Dome [#point-your-assistant-at-dome] Each client reads its base URL and key differently. One call resolves both base URLs, so there is nothing to assemble by hand: ```bash dome gateways get Default --json ``` Copy `endpoints.anthropic_base_url` for Claude Code, or `endpoints.openai_base_url` for Cursor and Codex. `{AGENT_API_KEY}` is the `dome_…` token from the previous step. > **Note**: The client and the model are independent. Every client below asks for a Dome connection by name, not a vendor model id. Claude Code can request `openai-broker` and run GPT through its native Anthropic-shaped interface. Codex or Cursor can request `claude-broker` and run Claude through their OpenAI-shaped one. **OpenAI** Codex speaks the OpenAI-compatible protocol Dome exposes at `endpoints.openai_base_url`. Its `model` setting names a Dome connection, not a vendor model id. Use `openai-broker` for its native GPT connection, or `claude-broker` to have Codex run Claude instead. **Terminal.** Export the agent token in the shell that launches `codex`, then add Dome as a provider in `~/.codex/config.toml`: ```bash export DOME_AGENT_TOKEN="AGENT_API_KEY" ``` ```toml title="~/.codex/config.toml" [model_providers.dome] name = "Dome" base_url = "OPENAI_BASE_URL" env_key = "DOME_AGENT_TOKEN" wire_api = "chat" model_provider = "dome" model = "openai-broker" # or "claude-broker" ``` **Desktop / IDE extension.** A GUI-launched Codex does not inherit variables exported in a terminal session, so `env_key` needs the token available at the OS level. Set it once, then restart the app so it picks up the change: ```bash # macOS launchctl setenv DOME_AGENT_TOKEN "AGENT_API_KEY" ``` On Windows or Linux, set it from your system's environment variable settings instead. The `config.toml` block above does not change. Only how the token reaches the process does. **Claude** Claude Code speaks the Anthropic protocol Dome exposes at `endpoints.anthropic_base_url`. `ANTHROPIC_MODEL` names a Dome connection the same way. Set it to `claude-broker` for its native connection, or to `openai-broker` to have Claude Code run GPT instead. **Terminal.** Export all three in the shell that launches `claude`: ```bash export ANTHROPIC_BASE_URL="ANTHROPIC_BASE_URL_VALUE" export ANTHROPIC_API_KEY="AGENT_API_KEY" export ANTHROPIC_MODEL="claude-broker" # or "openai-broker" ``` **Desktop / IDE extension.** A GUI-launched Claude Code does not inherit a terminal's exported variables. Write the same three values into `~/.claude/settings.json` instead, under `env`: ```json title="~/.claude/settings.json" { "env": { "ANTHROPIC_BASE_URL": "ANTHROPIC_BASE_URL_VALUE", "ANTHROPIC_API_KEY": "AGENT_API_KEY", "ANTHROPIC_MODEL": "claude-broker" } } ``` Claude Code reads this file on launch, so it covers the IDE extension the same way the exports cover the terminal. **Cursor** Open **Cursor Settings → models** and add a custom OpenAI-compatible model for each connection you want to reach: * **API key:** `AGENT_API_KEY` * **Override OpenAI Base URL:** `OPENAI_BASE_URL` (`endpoints.openai_base_url` from the command above) * **model name:** `openai-broker` or `claude-broker` Add both as separate custom models and pick whichever one you want per chat. Cursor sends the name you typed as-is; Dome resolves it to that connection regardless of the underlying provider. ## Verify the results [#verify-the-results] Restart your client, then ask it anything. The response itself proves nothing about the path, so check audit instead: ```bash dome audit query --limit 5 ``` Expect a completed `model.call` event naming `claude-broker` or `openai-broker`, attributed to `code-assistant`, with token usage. If you set `ANTHROPIC_MODEL=openai-broker` or pointed Codex at `claude-broker`, that event is the proof. The client's native provider and the model that actually answered are different, and Dome is what bridged them. **Troubleshooting** * `401` from the gateway. The key in your client's model config is the provider's key, not the Dome agent token. This endpoint authenticates the agent; the provider credential never leaves Dome. * `403` with a `permission_error`. Cedar denied the call. Reproduce it without spending anything: ```bash dome rules simulate --agent code-assistant --action llm:invoke \ --resource claude-broker --resource-type llm_model ``` * `404` with `no connection for requested model`. You put a provider model id (like `gpt-4o`) in the client's model field instead of the Dome connection name. Check what this workspace exposes: ```bash dome models list ``` * Anthropic request returns `404`. You pasted `openai_base_url` into an Anthropic-shaped client. Use `endpoints.anthropic_base_url` instead; the Anthropic SDK appends `/v1/messages` on its own. * Nothing shows up in audit. The client did not pick up the new environment or settings. Fully restart it rather than reloading a window, and re-check the exported variables (or `settings.json` / OS-level environment) that the process actually inherited. ## Next steps [#next-steps] Your assistant's own inference (not just a demo script) now runs through Dome. Continue with: * [Set Usage Limits](/govern/quotas) to cap what your assistant can spend per day or month before it becomes a surprise invoice * [Call a model through a pool](/tutorials/get-started/call-a-model-through-a-pool) to add failover across two models behind the same name * [Use Dome as an MCP gateway](/tutorials/production/use-dome-as-an-mcp-gateway) if you have not governed this assistant's tool calls yet # Use Dome as an MCP gateway (/tutorials/production/use-dome-as-an-mcp-gateway) Your assistant already calls MCP tools on your behalf: databases, ticket queues, internal APIs, whatever you've connected. Called directly, that access carries its own problems: one shared credential for every call, no record of which call did what, and no way to cut off this assistant without breaking every other caller too. Set yourself up to reach an MCP tool through a Dome gateway, signing in as me instead of holding a static agent key. First, show me this plan and ask me to confirm before running anything: 1. Install the Dome CLI if missing, sign in (opens a browser), then sync contexts 2. Create a tutorial workspace 3. Register the public demo tool server as `demo-hr`, attached to the Default gateway 4. Enable interactive access on the Default gateway, allow-listing my email 5. Deploy a Cedar bundle that permits the interactive agent to discover and call tools 6. Rewrite your own MCP config to point at the gateway's `/mcp` endpoint with no token 7. Tell me to reload and complete the browser sign-in yourself, then verify a tool call and show me the audit event Follow the commands at [https://docs.domesystems.ai/agent/tutorials/production/use-dome-as-an-mcp-gateway.md](https://docs.domesystems.ai/agent/tutorials/production/use-dome-as-an-mcp-gateway.md) exactly. Non-negotiable rules: * Narrate as you go. Before each step, tell me in one or two sentences what you are about to do and why it matters. * Confirm the active context. After switching context, confirm the workspace name starts with `studio-`. If it does not, stop and ask me. * Ask me for the email I want to allow-list before you need it. Default to the email I used for `dome auth login` if I don't have another in mind. * You cannot complete a browser sign-in on my behalf. After writing the MCP config, stop, tell me to reload and approve the sign-in prompt myself, and wait for my confirmation before calling any tool through it. * Never report a step as done without showing the command output. Write the config for whichever client you are running in: `.cursor/mcp.json` for Cursor, `claude mcp add --transport http` for Claude Code, `~/.codex/config.toml` plus `codex mcp login` for Codex. Once I confirm sign-in succeeded, call a `demo-hr` tool once to prove the path, then run `dome audit query --limit 5` and show me the resulting event, including whose identity it carries. In this tutorial, you will put a public demo MCP server behind the Default gateway, then rewrite your assistant's MCP config to reach it by signing in with your own Dome account instead of pasting in a static key. The rule you deploy is intentionally broad: allow everything for now. [Govern your first agent](/tutorials/get-started/govern-your-first-agent) covers narrowing it with allow, redact, and deny. 1. **Prepare your environment**: Sign in and create a dedicated workspace. 2. **Add a tool**: Register the demo server and attach it to the Default gateway. 3. **Enable interactive access**: Allow-list your own email on the Default gateway. 4. **Allow it through**: Deploy a permissive Cedar bundle scoped to the interactive agent. 5. **Connect your client**: Point Cursor, Claude Code, or Codex at the gateway, no token. 6. **Verify the results**: Call a tool from your assistant and confirm the audit event. ## Prerequisites [#prerequisites] For this tutorial, you will need: * The Dome CLI. Refer to [Install](/install) for Homebrew and direct-download instructions. * A tenant `admin` role (or an org `owner` / `admin` via cascade) to create the workspace, plus permission to deploy rules. * Cursor, Claude Code, or Codex, each pointed at your Dome account rather than a shared agent key. > **Note**: This tutorial uses [interactive access](/build/gateways/interactive-mcp-access): a real person signs in and rides an interactive agent. For a headless agent, a CI job, or anything without a browser, mint a static agent key instead. [Govern your first agent](/tutorials/get-started/govern-your-first-agent) covers that path. ## Prepare your environment [#prepare-your-environment] Sign in and create a tutorial workspace: ```bash dome auth login dome workspaces create --name studio-connect-assistant dome context sync dome context current ``` Confirm the workspace before continuing. Everything after this point creates resources: ```bash dome context current ``` ## Add a tool [#add-a-tool] A [tool](/connect/tools) is a backend the gateway calls on your assistant's behalf. By connecting it to a [Gateway](/build/gateways), you decide which tools your assistant can discover and call, without your assistant ever seeing the tool's URL or credentials. Register the public demo server and attach it to the Default gateway: ```bash dome tools add \ --name demo-hr \ --url https://demo-mcp.domesystems.ai/mcp \ --protocol streamable-http \ --auth-method none \ --gateway Default ``` The connection name prefixes every tool it exposes, so this server's tools become `demo-hr/hr/list_employees`, `demo-hr/it/get_incidents`, and so on. A tool with no gateway membership is registered but unreachable. ## Enable interactive access [#enable-interactive-access] Every call through a gateway is authorized and audited against an agent identity, not against a person or a product name. [interactive access](/build/gateways/interactive-mcp-access) gives you that identity without registering one by hand: enabling it creates an interactive agent that you, and anyone else you allow-list, sign in as through a browser. Enable it on Default, allow-listing the email you used for `dome auth login`: ```bash dome gateways interactive enable Default --email you@example.com ``` The command prints the interactive agent's name, `gateway-interactive-`. Confirm it, since the next step needs it: ```bash dome gateways get Default --json ``` Read `interactive_access.managed_agent_name` from the response. ## Allow it through [#allow-it-through] Enabling interactive access already admitted the interactive agent to Default. Cedar rules still decide what it may call, the same as any agent. Deploy a bundle that stays deliberately open, since this tutorial is about the connection, not the policy. Create `interactive-access.cedar`: ```cedar title="interactive-access.cedar" permit( principal is Dome::Agent, action == Dome::Action::"mcp:discover", resource ); permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ); ``` The `--agent` flag takes the interactive agent's name from the previous step, not a name you chose. Deploy it scoped to that agent: ```bash dome rules apply interactive-access.cedar \ --agent gateway-interactive-GATEWAY_ID \ --name interactive-access ``` > **Note**: This bundle allows every tool behind every gateway this agent can reach. [Govern your first agent](/tutorials/get-started/govern-your-first-agent) shows narrowing it to a named allowlist and redacting fields on the way back. [Interactive MCP access](/build/gateways/interactive-mcp-access#authorize-the-interactive-agent) shows scoping a rule to `principal.act_as.email`, useful once more than one person shares this agent. ## Connect your client [#connect-your-client] Point your MCP client at the Default gateway's [tools ingress](/concepts/gateways/tools-gateway). One call resolves the whole URL, so there is nothing to assemble by hand. Run it: ```bash dome gateways get Default --json ``` Copy `endpoints.mcp_url` from the response. That value is `MCP_URL` below, with no token or header this time. The first connection triggers a browser sign-in instead. **Cursor** Use project `.cursor/mcp.json` or **Settings → MCP**, with no `headers` block: ```json { "mcpServers": { "dome-tools": { "url": "MCP_URL" } } } ``` There is no credential in this file to gitignore. Cursor opens the browser on the first tool call. **Claude Code** Run this in your terminal, not inside a `claude` session: ```bash claude mcp add --transport http dome-tools MCP_URL ``` Keep `--transport http`. The gateway speaks Streamable HTTP, not the legacy `sse` transport Claude Code also supports. No `--header` flag this time. Confirm the result with `claude mcp list`, then Claude Code opens the browser on the first connection. **Codex** Add the server to `~/.codex/config.toml` with no `env_key`: ```toml [mcp_servers.dome-tools] url = "MCP_URL" ``` Then trigger the browser sign-in explicitly: ```bash codex mcp login dome-tools ``` Reload MCP. The first connection opens your browser: sign in with the email you allow-listed, review the client and the tools it can reach, and approve. Your client stores the resulting grant and refreshes it silently after that, until it expires or you revoke it. ## Verify the results [#verify-the-results] Ask your assistant a question that needs the demo tool, for example **"Who works here?"** You should get back the demo employee directory, including ids such as `E001`. Confirm the call is attributed to the interactive agent, and to you specifically: ```bash dome audit query --limit 5 ``` Expect a `tool.call` event naming `demo-hr/hr/list_employees` (or whichever tool your assistant chose), attempted and completed, with `gateway-interactive-` as the agent and your email under `act_as`. That is the difference from a shared agent key: if a teammate signs in later, their calls land under the same agent but their own `act_as` identity, and you can revoke just their grant without touching yours. **Troubleshooting** * No tools appear after reloading. Confirm you pasted `endpoints.mcp_url`, not `gateway_url` or another field. Then confirm the bundle landed: ```bash dome rules simulate --agent gateway-interactive-GATEWAY_ID --action mcp:discover \ --resource demo-hr/hr/list_employees --resource-type mcp_tool ``` * The browser never opens, or the client just fails silently. Send the assistant a message that needs the tool first; some clients only start the OAuth handshake on first use, not on save. For Codex, run `codex mcp login dome-tools` directly instead of waiting for it. * The consent page shows no eligible agent. Your signed-in email does not exactly match the allow-list, or your account lacks `agents.view` on this workspace. Compare against the allow-list: ```bash dome gateways get Default --json ``` * Every call returns an authorization error. Cedar denied the call. Reproduce it without spending anything, using the interactive agent's name: ```bash dome rules simulate --agent gateway-interactive-GATEWAY_ID --action mcp:call \ --resource demo-hr/hr/list_employees --resource-type mcp_tool ``` * Calls succeed but time out. The demo server is public and unauthenticated, so a timeout usually means egress restrictions on your network. Confirm you can reach `https://demo-mcp.domesystems.ai/mcp` directly. ## Next steps [#next-steps] You pointed a real MCP client at a Dome gateway, signed in as yourself, and watched a governed call land in audit under your own identity. Continue with: * [Use Dome as a model broker](/tutorials/production/use-dome-as-a-model-broker) to route your assistant's own inference through Dome the same way * [Interactive MCP access](/build/gateways/interactive-mcp-access) to allow-list teammates, scope rules per person, and manage grants * [Govern your first agent](/tutorials/get-started/govern-your-first-agent) to narrow this broad rule to an allowlist and redact fields on the way back # Developer (/tutorials/role/developer) On Dome, a developer owns the agent as a workload: you register it, mint its credentials, point it at a gateway, and verify that governed calls succeed or fail for the reasons you expect. Operators usually attach shared backends. Security usually owns the baseline rules. In this workspace you finish the loop yourself so you can see the full path. Run the Dome Developer role tutorial in a tutorial workspace: register an agent, attach demo-hr, deploy a minimal Cedar allowlist, then hand me curl or Python calls that prove allow and deny, plus audit. First, show me this plan and ask me to confirm before running anything: 1. Confirm CLI auth, create studio-role-developer, switch into it 2. Register role-dev-agent and mint an API key (do not print the token) 3. Attach demo-hr to Default and grant the agent gateway access 4. Deploy a Cedar allowlist (directory tools only; deny salary) 5. Hand me Verify tabs (curl and Python) for list\_employees (allow) and get\_salary (deny) 6. Show audit for those decisions, then offer clean up Follow the commands at [https://docs.domesystems.ai/agent/tutorials/role/developer.md](https://docs.domesystems.ai/agent/tutorials/role/developer.md) exactly. Non-negotiable rules: * Narrate as you go. Before each step, tell me in one or two sentences what you are about to do and why it matters. * Confirm the active context. After switching context, run `dome context current` and confirm the workspace name starts with `studio-`. If it does not, stop and ask me. * Never print the `dome_...` agent token in chat. Write it into a gitignored `.env` for the verify step. * Do not call the governed tools yourself to demo outcomes. After setup, hand me the curl/Python commands and expected results, then stop. * After each create/grant/deploy step, give me a markdown link into the Dome console. Derive the base URL from `dome auth status` → `Server`. * Never report a step as done without showing the command output. In this tutorial, you will register an agent, attach the demo HR tools behind Default, deploy a narrow Cedar allowlist, and prove allow vs deny from curl or Python — then see both decisions in audit. To do this, you will: 1. **Create a workspace**: Create a dedicated workspace for this role walk. 2. **Register an agent**: Mint identity and an API key for the workload. 3. **Attach tools and grant access**: Put `demo-hr` on Default and admit the agent. 4. **Deploy authorization rules**: Allow directory tools; deny compensation. 5. **Verify allow and deny**: Call the gateway with curl or Python. 6. **Confirm in audit**: Read the decisions attributed to your agent. ## Prerequisites [#prerequisites] For this tutorial, you will need: * The [Dome CLI](/install) installed and authenticated (`dome auth login`, then `dome auth status`) * A tenant `admin` role (or an org `owner` / `admin` via cascade) to create the workspace, plus permission to deploy rules. Refer to [Permissions](/concepts/platform/permissions). > This tutorial runs entirely in a workspace. In a production workspace, attaching backends is typically an [operator](/tutorials/role/operator) action and deploying rules a [security](/tutorials/role/security) action. A developer still needs enough Connect and Govern context to integrate and debug. ## Create a workspace [#create-a-workspace] A [workspace](/concepts/platform/scopes) is a dedicated workspace with the same capabilities as production. Provision one for this role track: ```bash dome workspaces create --name studio-role-developer ``` The command creates `studio-role-developer` and selects it as the active context. Confirm it: ```bash dome context sync dome context current ``` Confirm the workspace reads `studio-role-developer` before continuing. ## Register an agent [#register-an-agent] An [agent](/concepts/agents/identity) is the workload identity every governed call is attributed to. Register one, then mint a credential the gateway will accept as `Authorization: Bearer`: ```bash dome agents register --name role-dev-agent --if-not-exists dome agents create-key role-dev-agent --name service ``` Save the `Token: dome_…` value once into a gitignored `.env`. Tokens are shown once and cannot be recovered — mint another key if you lose it. ## Attach tools and grant access [#attach-tools-and-grant-access] A [tool](/connect/tools) is a backend the gateway calls on the agent's behalf. The agent never sees its URL. Register the public demo HR server and attach it to Default: ```bash dome tools add \ --name demo-hr \ --url https://demo-mcp.domesystems.ai/mcp \ --protocol streamable-http \ --auth-method none \ --gateway Default ``` The connection name prefixes every tool (`demo-hr/hr/list_employees`, and so on). Admit the agent at Default so the gateway accepts its requests: ```bash dome gateways access grant Default role-dev-agent ``` That grant admits the agent and permits resources currently in Default. The next step narrows what the agent may actually call. ## Deploy authorization rules [#deploy-authorization-rules] Cedar decides every `mcp:call`. This allowlist keeps directory tools open and blocks compensation (and everything else) with `forbid … unless`: ```cedar title="role-dev-agent.cedar" permit( principal is Dome::Agent, action == Dome::Action::"mcp:discover", resource ); permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) when { resource in [ Dome::MCPTool::"demo-hr/hr/list_employees", Dome::MCPTool::"demo-hr/hr/get_employee", Dome::MCPTool::"demo-hr/hr/org_chart" ] }; forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) unless { resource in [ Dome::MCPTool::"demo-hr/hr/list_employees", Dome::MCPTool::"demo-hr/hr/get_employee", Dome::MCPTool::"demo-hr/hr/org_chart" ] }; ``` Deploy it scoped to this agent: ```bash dome rules apply role-dev-agent.cedar --agent role-dev-agent --name role-dev-agent ``` Expect `Bundle deployed: role-dev-agent`. Optionally simulate before a live call: ```bash dome rules simulate --agent role-dev-agent --action mcp:call \ --resource demo-hr/hr/list_employees --resource-type mcp_tool dome rules simulate --agent role-dev-agent --action mcp:call \ --resource demo-hr/finance/get_salary --resource-type mcp_tool ``` Expect `ALLOW`, then `DENY`. ## Verify allow and deny [#verify-allow-and-deny] Build the tools ingress URL from your workspace gateway host and Default's id: ```bash dome context current dome gateways list ``` Export once: ```bash export DOME_GATEWAY_URL="https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID" export DOME_TOKEN="dome_..." ``` Post MCP JSON-RPC `tools/call` to `$DOME_GATEWAY_URL/mcp`. Use curl or Python — same payloads, same outcomes. **API via curl** **List employees** — allowed: ```bash curl -sS -X POST "$DOME_GATEWAY_URL/mcp" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "demo-hr/hr/list_employees", "arguments": {} } }' ``` Expect demo employees in `result`, including `E001`. **Get salary** — denied: ```bash curl -sS -X POST "$DOME_GATEWAY_URL/mcp" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "demo-hr/finance/get_salary", "arguments": { "employee_id": "E001" } } }' ``` Expect a JSON-RPC error (authorization deny), not payroll data. **Python** Requires `httpx` (`pip install httpx`). Same gateway URL and token as above: ```python title="verify_calls.py" import json import os import httpx url = os.environ["DOME_GATEWAY_URL"].rstrip("/") + "/mcp" token = os.environ["DOME_TOKEN"] def call(name: str, arguments: dict | None = None) -> None: response = httpx.post( url, headers={ "Authorization": f"Bearer {token}", "Content-Type": "application/json", }, json={ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": name, "arguments": arguments or {}}, }, timeout=30.0, ) print(json.dumps(response.json(), indent=2)) # Allowed — directory call("demo-hr/hr/list_employees") # Denied — compensation call("demo-hr/finance/get_salary", {"employee_id": "E001"}) ``` ```bash python verify_calls.py ``` Expect employees in the first response and an authorization error in the second. ## Confirm in audit [#confirm-in-audit] Every decision is attributed to the agent. List recent events: ```bash dome audit query --limit 20 ``` Focus on denials: ```bash dome audit query --results denied --limit 10 ``` You should see the allowed `list_employees` call and the denied `get_salary` call under `role-dev-agent`. ## Clean up [#clean-up] Delete the workspace to remove the agent, rules, and grants together: ```bash dome workspaces delete studio-role-developer ``` ## Next steps [#next-steps] You learned how to register an agent, call tools through a gateway, and confirm allow and deny in audit. Continue with: * [security](/tutorials/role/security) to author, simulate, and tighten rules and guards * [operator](/tutorials/role/operator) to attach backends and expose gateways * [Govern your first agent](/tutorials/get-started/govern-your-first-agent) for the full Get Started path with filters and an MCP client # Choose your role (/tutorials/role) Four tutorials, one per job. Each is self-contained: take yours, or read a neighbour's to see where the handoff falls. * [Developer](/tutorials/role/developer): Register an agent, call tools through a gateway, and confirm allow and deny in audit. * [Security](/tutorials/role/security): Author and simulate Cedar, redact sensitive fields, prove denials, and export evidence. * [Operator](/tutorials/role/operator): Attach tools, expose a gateway, grant access, and watch traffic as it happens. * [Platform Admin](/tutorials/role/platform-admin): Set who may administer Dome, check platform health, and export an audit snapshot. # Operator (/tutorials/role/operator) On Dome, an operator owns the shared substrate: workspaces, tool and model connections, gateways, grants, and the live signals that show the platform is healthy. You make backends reachable under Dome, group them behind named endpoints, grant the right agents access at the edge, and watch traffic. Developers integrate agents into that substrate. Security tightens what those agents may do once they are on it. Run the Dome Operator role tutorial in a tutorial workspace: attach demo-hr to Default, register a tutorial agent for a smoke grant, deploy a tiny Cedar permit for list\_employees, then hand me one curl or Python call that proves the substrate works, plus audit. First, show me this plan and ask me to confirm before running anything: 1. Confirm CLI auth, create studio-role-operator, switch into it 2. Attach demo-hr to Default 3. Register role-ops-agent (scaffolding only), mint a key (do not print it), grant Default 4. Deploy a minimal Cedar permit for discover + list\_employees 5. Hand me one Verify call (curl and Python) for list\_employees 6. Show audit query (and mention audit stream), then offer clean up Follow the commands at [https://docs.domesystems.ai/agent/tutorials/role/operator.md](https://docs.domesystems.ai/agent/tutorials/role/operator.md) exactly. Non-negotiable rules: * Narrate as you go. Emphasize substrate (backends, gateway, grants) — not a full developer or security walkthrough. * Confirm the active context. Confirm `dome context current` starts with `studio-`. * Never print the agent token. Write it to a gitignored `.env`. * Do not call governed tools yourself to demo. Hand me the verify commands. * Link the console after create/grant/deploy. Derive base URL from `dome auth status` → `Server`. * Never report a step as done without command output. In this tutorial, you will create a workspace, attach `demo-hr` to Default, grant a tutorial agent at the edge, and prove the substrate with one allowed call — then see it in audit. To do this, you will: 1. **Create a workspace**: Create the dedicated workspace you will operate in. 2. **Attach a tool to Default**: Make `demo-hr` a governed target on the gateway. 3. **Grant a smoke-test agent**: Admit a tutorial agent so you can prove the edge path. 4. **Deploy a minimal allow**: Permit discovery and one directory tool so the smoke call succeeds. 5. **Smoke-test the substrate**: Call once with curl or Python, then check audit. ## Prerequisites [#prerequisites] For this tutorial, you will need: * The [Dome CLI](/install) installed and authenticated * A tenant `admin` role (or an org `owner` / `admin` via cascade) to create the workspace, plus permission to attach tools. Refer to [Permissions](/concepts/platform/permissions). > This tutorial runs entirely in a workspace. The tutorial agent and tiny Cedar rule exist only so you can prove backends and grants work — not to replace the [Developer](/tutorials/role/developer) or [Security](/tutorials/role/security) tutorials. ## Create a workspace [#create-a-workspace] ```bash dome workspaces create --name studio-role-operator dome context sync dome context current ``` Confirm the workspace reads `studio-role-operator`. ## Attach a tool to Default [#attach-a-tool-to-default] A tool is unreachable until it belongs to a [Gateway](/build/gateways). Register the public demo HR server on Default: ```bash dome tools add \ --name demo-hr \ --url https://demo-mcp.domesystems.ai/mcp \ --protocol streamable-http \ --auth-method none \ --gateway Default ``` Confirm Default lists the connection: ```bash dome gateways get Default ``` ## Grant a smoke-test agent [#grant-a-smoke-test-agent] Without an agent grant, nothing can call through the edge — even with a healthy backend. Register a dedicated agent and admit it: ```bash dome agents register --name role-ops-agent --if-not-exists dome agents create-key role-ops-agent --name smoke dome gateways access grant Default role-ops-agent ``` Save the token to a gitignored `.env`. Treat this agent as scaffolding for the smoke test, not a production workload identity. ## Deploy a minimal allow [#deploy-a-minimal-allow] Gateway grants admit the agent; Cedar still decides each call. Deploy the smallest permit that lets one directory tool succeed: ```cedar title="role-ops-agent.cedar" permit( principal is Dome::Agent, action == Dome::Action::"mcp:discover", resource ); permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"demo-hr/hr/list_employees" ); ``` ```bash dome rules apply role-ops-agent.cedar --agent role-ops-agent --name role-ops-agent ``` ## Smoke-test the substrate [#smoke-test-the-substrate] ```bash dome context current dome gateways list ``` ```bash export DOME_GATEWAY_URL="https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID" export DOME_TOKEN="dome_..." ``` One allowed call proves backend membership, the grant, and Cedar together. **API via curl** ```bash curl -sS -X POST "$DOME_GATEWAY_URL/mcp" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "demo-hr/hr/list_employees", "arguments": {} } }' ``` Expect demo employees in `result`. **Python** Requires `httpx` (`pip install httpx`): ```python title="smoke_ops.py" import json import os import httpx url = os.environ["DOME_GATEWAY_URL"].rstrip("/") + "/mcp" token = os.environ["DOME_TOKEN"] response = httpx.post( url, headers={ "Authorization": f"Bearer {token}", "Content-Type": "application/json", }, json={ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "demo-hr/hr/list_employees", "arguments": {}, }, }, timeout=30.0, ) print(json.dumps(response.json(), indent=2)) ``` ```bash python smoke_ops.py ``` Confirm the call landed in audit. Tail live events in a second terminal if you want the operator view: ```bash dome audit query --limit 10 # Optional live tail: # dome audit stream ``` ## Clean up [#clean-up] ```bash dome workspaces delete studio-role-operator ``` ## Next steps [#next-steps] You learned how to attach tools to a gateway, grant access at the edge, and prove the substrate with a smoke call. Continue with: * [Developer](/tutorials/role/developer) to register real agent workloads and verify allow/deny * [Security](/tutorials/role/security) to tighten rules, filters, and evidence export * [Stream Live Events](/operate/observe) for day-to-day triage # Platform Admin (/tutorials/role/platform-admin) On Dome, a platform admin owns tenancy boundaries, workspace membership, who may change shared systems, and whether the estate stays operable and auditable. You decide who can administer Dome. You do not usually write every Cedar rule or attach every backend — operators and security run day-to-day Connect and Govern work inside the boundaries you set. Run the Dome Platform Admin role tutorial in a tutorial workspace: list members, optionally assign a role if I give you a real teammate email, verify platform access and gateway inventory, and export today's audit snapshot. First, show me this plan and ask me to confirm before running anything: 1. Confirm CLI auth, create studio-role-platform-admin, switch into it 2. List workspace members 3. If I provide a real teammate email, set their role; otherwise skip members set 4. Run `dome auth status` and `dome gateways list` 5. Export today's audit (empty file is OK — we're proving the pipeline) 6. Offer clean up Follow the commands at [https://docs.domesystems.ai/agent/tutorials/role/platform-admin.md](https://docs.domesystems.ai/agent/tutorials/role/platform-admin.md) exactly. Non-negotiable rules: * Narrate as you go. Stay in the admin lane — no Cedar authoring, no backend attachment. * Confirm the active context. Confirm `dome context current` starts with `studio-`. * Do not invent teammate emails. Ask me for a real address or skip role assignment. * Never report a step as done without showing the command output. * Link the console after membership changes. Derive base URL from `dome auth status` → `Server`. In this tutorial, you will create a dedicated workspace, inspect membership, optionally assign a role, verify platform access and gateway inventory, and export an audit snapshot. To do this, you will: 1. **Create a workspace**: Create a workspace you can safely administer and delete. 2. **Inspect and assign membership**: List members; set a role only if a real teammate email is available. 3. **Check platform access**: Confirm authentication and inspect the workspace's gateways. 4. **Export an audit snapshot**: Prove the compliance export pipeline runs. ## Prerequisites [#prerequisites] For this tutorial, you will need: * The [Dome CLI](/install) installed and authenticated * A tenant `admin` role (or an org `owner` / `admin` via cascade) to create the workspace and manage workspace members. Refer to [Permissions](/concepts/platform/permissions). > This tutorial stays in the Manage lane. For backends and gateways refer to [Operator](/tutorials/role/operator). For Cedar and day-to-day audit investigation refer to [Security](/tutorials/role/security). ## Create a workspace [#create-a-workspace] ```bash dome workspaces create --name studio-role-platform-admin dome context sync dome context current ``` Confirm the workspace reads `studio-role-platform-admin`. ## Inspect and assign membership [#inspect-and-assign-membership] List who is already on the workspace: ```bash dome workspaces members list ``` Each member holds one workspace role: `admin`, `operator`, `security`, or `viewer` (refer to [Permissions](/concepts/platform/permissions) concept). Assign a role only when you have a real teammate email that already exists in your org: ```bash dome workspaces members set --user teammate@example.com --role operator ``` If you do not have a second user handy, skip this command. The rest of the tutorial still exercises health and export. ## Check platform access [#check-platform-access] Confirm the CLI can reach the platform, then list the public gateways in the active workspace: ```bash dome auth status dome gateways list ``` Pair that inventory with a quick glance at recent audit activity: ```bash dome audit query --limit 10 ``` An empty result is fine on a brand-new workspace. ## Export an audit snapshot [#export-an-audit-snapshot] Platform admins prove the export pipeline works even when there is little traffic. Export today's events as JSON Lines: ```bash dome audit export \ --since "$(date -u +%Y-%m-%dT00:00:00Z)" \ --format jsonl > platform-audit.jsonl ``` A zero-line file still means the command succeeded — you verified the path. Use `--format ocsf` or `cef` when a downstream SIEM expects those shapes. ## Clean up [#clean-up] ```bash dome workspaces delete studio-role-platform-admin ``` ## Next steps [#next-steps] You learned how to inspect membership, check gateway health, and export an audit snapshot. Continue with: * [Operator](/tutorials/role/operator) to attach backends and expose gateways * [Security](/tutorials/role/security) for rules, filters, and evidence packages * [Permissions](/concepts/platform/permissions) concept for the full role-to-capability map # Security (/tutorials/role/security) On Dome, security owns what each agent may call, what content may leave a backend, and whether the audit trail can prove it. You author and simulate Cedar rules, apply guards and filters, investigate denials, and export evidence. Operators make backends reachable. Developers integrate agents. In this workspace you stand up just enough substrate to exercise the Govern path end to end. Run the Dome Security role tutorial in a tutorial workspace: attach demo-hr, apply a contact redaction filter, deploy restrictive Cedar, then hand me curl or Python calls that prove allow, redact, and deny, plus audit export. First, show me this plan and ask me to confirm before running anything: 1. Confirm CLI auth, create studio-role-security, switch into it 2. Register role-sec-agent, mint a key (do not print the token), attach demo-hr, grant Default 3. Create and assign redact-contact filter on demo-hr responses 4. Write, validate, simulate, and deploy Cedar (directory allow; salary/customer deny) 5. Hand me Verify tabs (curl and Python) for list\_employees, get\_employee (redacted), get\_salary (deny) 6. Show audit query and export today's events, then offer clean up Follow the commands at [https://docs.domesystems.ai/agent/tutorials/role/security.md](https://docs.domesystems.ai/agent/tutorials/role/security.md) exactly. Non-negotiable rules: * Narrate as you go. Before each step, tell me in one or two sentences what you are about to do and why it matters. * Confirm the active context. After switching context, run `dome context current` and confirm the workspace name starts with `studio-`. If it does not, stop and ask me. * Never print the `dome_...` agent token in chat. Write it into a gitignored `.env`. * Do not call the governed tools yourself to demo outcomes. After setup, hand me the curl/Python commands and expected results, then stop. * After each create/grant/deploy step, give me a markdown link into the Dome console. Derive the base URL from `dome auth status` → `Server`. * Never report a step as done without showing the command output. In this tutorial, you will deploy a restrictive Cedar allowlist, redact contact fields on the response path, prove allow / redact / deny from curl or Python, and export audit evidence. To do this, you will: 1. **Create a workspace**: Create a dedicated workspace for this role walk. 2. **Stand up minimal substrate**: Register an agent, attach `demo-hr`, and grant Default. 3. **Redact contact fields**: Create a filter and assign it to tool responses. 4. **Author, simulate, and deploy Rules**: Allow directory tools; deny compensation and customers. 5. **Verify allow, redact, and deny**: Call the gateway with curl or Python. 6. **Investigate and export evidence**: Query denials and export today's audit trail. ## Prerequisites [#prerequisites] For this tutorial, you will need: * The [Dome CLI](/install) installed and authenticated (`dome auth login`, then `dome auth status`) * A tenant `admin` role (or an org `owner` / `admin` via cascade) to create the workspace, plus permission to deploy rules. Refer to [Permissions](/concepts/platform/permissions). > This tutorial runs entirely in a workspace. In a production workspace, attaching backends is typically an [operator](/tutorials/role/operator) action. Here you attach `demo-hr` yourself so you can finish the Govern loop. ## Create a workspace [#create-a-workspace] ```bash dome workspaces create --name studio-role-security dome context sync dome context current ``` Confirm the workspace reads `studio-role-security` before continuing. ## Stand up minimal substrate [#stand-up-minimal-substrate] You need an agent identity and a reachable tool so rules and filters have something to govern. ```bash dome agents register --name role-sec-agent --if-not-exists dome agents create-key role-sec-agent --name service ``` Save the token to a gitignored `.env` — do not leave it in chat history. ```bash dome tools add \ --name demo-hr \ --url https://demo-mcp.domesystems.ai/mcp \ --protocol streamable-http \ --auth-method none \ --gateway Default dome gateways access grant Default role-sec-agent ``` ## Redact contact fields [#redact-contact-fields] A [Guard](/govern/guards) filter strips sensitive fields from tool responses before the agent sees them. Create `redact-contact.json`: ```json title="redact-contact.json" { "json": { "components": [ { "fieldActions": [ { "matcher": { "path": "**.email" }, "action": "FILTER_ACTION_REDACT" }, { "matcher": { "path": "**.phone" }, "action": "FILTER_ACTION_REDACT" } ] } ] } } ``` Create the filter and assign it to the response direction on `demo-hr`: ```bash dome guards filters create redact-contact \ --description "Redact contact fields in tool responses" \ --config-from redact-contact.json dome tools guards filters set demo-hr \ --direction response \ --filters redact-contact ``` ## Author, simulate, and deploy Rules [#author-simulate-and-deploy-rules] This allowlist keeps directory tools open. Everything else — including salary and customer records — is denied by `forbid … unless`: ```cedar title="role-sec-agent.cedar" permit( principal is Dome::Agent, action == Dome::Action::"mcp:discover", resource ); permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) when { resource in [ Dome::MCPTool::"demo-hr/hr/list_employees", Dome::MCPTool::"demo-hr/hr/get_employee", Dome::MCPTool::"demo-hr/hr/org_chart" ] }; forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) unless { resource in [ Dome::MCPTool::"demo-hr/hr/list_employees", Dome::MCPTool::"demo-hr/hr/get_employee", Dome::MCPTool::"demo-hr/hr/org_chart" ] }; ``` Validate and simulate **before** deploying so you know the allow and deny paths: ```bash dome rules validate role-sec-agent.cedar dome rules simulate --agent role-sec-agent --action mcp:call \ --resource demo-hr/hr/list_employees --resource-type mcp_tool dome rules simulate --agent role-sec-agent --action mcp:call \ --resource demo-hr/finance/get_salary --resource-type mcp_tool ``` Expect `ALLOW`, then `DENY`. Deploy when those match: ```bash dome rules apply role-sec-agent.cedar --agent role-sec-agent --name role-sec-agent ``` ## Verify allow, redact, and deny [#verify-allow-redact-and-deny] ```bash dome context current dome gateways list ``` ```bash export DOME_GATEWAY_URL="https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID" export DOME_TOKEN="dome_..." ``` **API via curl** **List employees** — allowed: ```bash curl -sS -X POST "$DOME_GATEWAY_URL/mcp" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "demo-hr/hr/list_employees", "arguments": {} } }' ``` **Get E001** — allowed, email redacted: ```bash curl -sS -X POST "$DOME_GATEWAY_URL/mcp" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "demo-hr/hr/get_employee", "arguments": { "employee_id": "E001" } } }' ``` Expect `"email": "[REDACTED]"`. **Get salary** — denied: ```bash curl -sS -X POST "$DOME_GATEWAY_URL/mcp" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "demo-hr/finance/get_salary", "arguments": { "employee_id": "E001" } } }' ``` **Python** Requires `httpx` (`pip install httpx`): ```python title="verify_security.py" import json import os import httpx url = os.environ["DOME_GATEWAY_URL"].rstrip("/") + "/mcp" token = os.environ["DOME_TOKEN"] def call(name: str, arguments: dict | None = None) -> None: response = httpx.post( url, headers={ "Authorization": f"Bearer {token}", "Content-Type": "application/json", }, json={ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": name, "arguments": arguments or {}}, }, timeout=30.0, ) print(json.dumps(response.json(), indent=2)) call("demo-hr/hr/list_employees") call("demo-hr/hr/get_employee", {"employee_id": "E001"}) call("demo-hr/finance/get_salary", {"employee_id": "E001"}) ``` ```bash python verify_security.py ``` Expect allow, redacted email, then deny. ## Investigate and export evidence [#investigate-and-export-evidence] ```bash dome audit query --limit 20 dome audit query --results denied --limit 10 ``` Export today's trail as JSON Lines for a compliance package or SIEM: ```bash dome audit export \ --since "$(date -u +%Y-%m-%dT00:00:00Z)" \ --format jsonl > security-audit.jsonl ``` ## Clean up [#clean-up] ```bash dome workspaces delete studio-role-security ``` ## Next steps [#next-steps] You learned how to author and simulate Cedar, redact sensitive fields, prove denials, and export audit evidence. Continue with: * [Developer](/tutorials/role/developer) to register agents and verify from the workload side * [operator](/tutorials/role/operator) to attach backends and expose gateways * [Simulate Rules](/govern/rules/simulate) for deeper pre-deploy checks # Build a governed app — agent instructions (/agent/tutorials/get-started/build-a-governed-app) These are the instructions an AI agent follows to run the [Build a governed app](/tutorials/get-started/build-a-governed-app) tutorial on your behalf. Read the tutorial instead if you are running the steps yourself. ## Goal [#goal] Run the HR application so the user sees the **gold path**: a model + tool agent loop through Dome (Chat), then the explicit allow / redact / deny clicks on tools. Before running, walk through the generic agent flow and the app files that implement each step (with the relevant code from the tutorial). Name the control responsible for each tool outcome. Use the Vite + Hono reference app at [https://github.com/dome-systems/demo-hr-desk](https://github.com/dome-systems/demo-hr-desk). There is no Python path in this tutorial. ## Rules [#rules] Follow these even if the rest of this page is unreachable. * **Confirm before you start.** Before running any commands, present the plan below and wait for the user to say proceed. * **Narrate as you go.** Before each step, tell the user in one or two sentences what you are about to do and why it matters (credential separation, gateway URL shape, keeping the agent token off the browser, pool + tools together, response filters, Cedar allowlists). Do not silently run the whole flow. * **Confirm the active context.** Run `dome context current` and confirm the workspace name starts with `studio-`. If it does not, stop and ask. Only change the workspace selected for this tutorial. * **Require the pool tutorial.** Confirm `employee-summary` and the `llm:invoke` rule exist before starting Chat. If missing, send the user to [Call a model through a pool](/tutorials/get-started/call-a-model-through-a-pool) first. * **Never print the agent token.** `dome agents create-key` returns a live bearer token once. Write it straight into `.env`. Do not echo it, log it, or repeat it in chat. Confirm the env file is gitignored before writing the token into it. * **Keep the app small.** Prefer the reference app as-is. Do not add auth UI or expand the product. * **Teach the flow.** After setup, explain the generic six-step agent flow from the tutorial, then show the matching code in `App.tsx`, `index.ts`, `llm.ts`, `agent.ts`, and `dome.ts` (condensed sections are fine). Do not dump whole files. * **Chat first.** After `npm run dev`, have the user open Chat (default), use Try asking, and inspect gateway calls. Then tools for the three explicit outcomes. * **Backend only.** Emphasize that `/api/chat` and `/api/tool` are the only paths to Dome; the agent token stays in server `.env`. This is the prerequisite for act-as in the next tutorial. * **Stop at the human handoff.** `dome auth login` opens a browser; run it, then wait. For the Vite app, after `npm run dev` starts, tell the user to open [http://localhost:5173](http://localhost:5173) and drive Chat / tools themselves. * **Never weaken governance to make a call pass.** The denial is the point of the exercise. Do not edit the Cedar bundle or remove the filter. If a call fails that should have worked, stop and report it. * **Link the console.** After each create step, give the user a markdown link into the Dome console for the resource you just touched. Derive the base URL from `dome auth status` → `Server`. * **Expect re-runs.** Check for existing resources before creating them. Pass `--if-not-exists` where it exists. * **Show your evidence.** Never report a step as done without the command output that proves it. ## Quick setup [#quick-setup] Before running any commands, present the user with this checklist and wait for confirmation: ``` Here's what I'll do to get your application running model + tools through Dome. 1. Confirm the workspace from Govern + Call a model through a pool is active 2. Mint a second API key on the hr-assistant agent, for the app 3. Clone demo-hr-desk and fill .env (token, gateway URL, DOME_POOL=employee-summary) 4. Walk you through the generic agent flow, then the app files that implement it 5. Run Chat — walk you through a Try asking turn (model + tool steps) 6. On Tools, click through allow, redact, and deny 7. Show you the same decisions in the audit trail Shall I proceed? ``` Do not start step 1 until the user confirms. ## Steps [#steps] ### 1\. Confirm the workspace [#1-confirm-the-workspace] This tutorial builds on [Govern your first agent](/tutorials/get-started/govern-your-first-agent) and [Call a model through a pool](/tutorials/get-started/call-a-model-through-a-pool). It needs `demo-hr`, `redact-contact`, `hr-assistant`, the tool rule bundle, the `employee-summary` pool, and the `hr-assistant-llm` rule. ```bash dome context current ``` The workspace must read `studio-get-started`. If it does not, run `dome context current`. If that workspace does not exist, run the earlier tutorials' setup before continuing, and say so rather than improvising a different scenario. Confirm the prerequisites are actually present before writing any code: ```bash dome tools guards filters list demo-hr dome rules show --agent hr-assistant dome models pool get employee-summary dome rules simulate --agent hr-assistant --action llm:invoke \ --resource employee-summary --resource-type llm_pool ``` The filter chain on the response direction must list `redact-contact`, the agent must have a tool bundle, the pool must exist, and simulation must `ALLOW` `llm:invoke`. If any is missing, stop and report it. ### 2\. Mint a credential for the app [#2-mint-a-credential-for-the-app] ```bash dome agents create-key hr-assistant --name service ``` Capture the token without printing it. Explain that both keys resolve to the same identity, so both are governed by the same rules and both appear in audit under `hr-assistant`. Link the agents page: `/agents`. ### 3\. Set up the project [#3-set-up-the-project] ```bash dome context current dome gateways list ``` The gateway URL must include the `/gateways/` segment and must **not** include `/mcp` or `/v1`. ```bash git clone https://github.com/dome-systems/demo-hr-desk.git cd demo-hr-desk npm install cp .env.example .env ``` Write `.env` (gitignored): ``` DOME_TOKEN= DOME_GATEWAY_URL=https:///gateways/ DOME_POOL=employee-summary ``` Explain that this tutorial uses plain HTTP through a Hono proxy so the wire shape stays visible, and the agent token stays off the browser. However, any OpenAI-compatible client, AI SDK, or MCP client can point at the gateway with the agent token — chat completions at `…/gateways//v1`, tools at `…/gateways//mcp`. ### 4\. Teach the flow and the code [#4-teach-the-flow-and-the-code] Walk the user through the tutorial's **How a governed agent works** (six steps), then **How this application implements it**. The implementation headings mirror those six steps. For each subsection, show the condensed code blocks from the human tutorial (or the matching snippets in the cloned repo). Do not paste entire files. Tell them they can skip ahead to **Run the agent loop** if they want to try the app first. ### 5\. Run Chat, then Tools [#5-run-chat-then-tools] ```bash npm run dev ``` Tell the user to open [http://localhost:5173](http://localhost:5173) and stay on **Chat** (default). Have them use **Try asking** — start with **Who is E001 and how do I reach them?** Wait for them to report what they see. Expected: 1. A model step naming `employee-summary` (**View gateway call** shows `"model": "employee-summary"`) 2. A `get_employee` tool step with `"email": "[REDACTED]"` 3. A final assistant reply Then have them try **What is Alice's salary?** so a denied tool appears inside the loop. After Chat, switch to **tools** and click each button in order: | Action | Status | | ----------------------- | -------------------------------------------- | | List employees | Allowed — demo employees including `E001` | | Who is E001? | Allowed · redacted — `"email": "[REDACTED]"` | | What is Alice's salary? | Denied — a rule reason | Walk the user through what Dome did for each click: | Click | What Dome did | | ----------------------- | -------------------------------------------------------------------------------------------- | | List employees | Cedar allowed `mcp:call` on `demo-hr/hr/list_employees`. | | Who is E001? | Cedar allowed the call. The `redact-contact` guard filter masked `email` on the response. | | What is Alice's salary? | Cedar denied `mcp:call` on `demo-hr/finance/get_salary` because it is outside the allowlist. | Point out that the app contains no filtering and no allowlist. If the email arrives unmasked or the payroll call succeeds, say so plainly rather than moving on. ### 6\. Show the record [#6-show-the-record] ```bash dome audit query --limit 20 dome audit query --results denied --limit 10 ``` Point out completed `model.call` events for Chat, completed `tool.call` events for allowed tools, `guard.filter.evaluate` for the employee lookup, and the payroll `tool.call` with `result=denied` — all attributed to `hr-assistant`. Link the console audit view: `/audit/events`. ### 7\. Offer the exit [#7-offer-the-exit] Point the user at [Govern per end user](/tutorials/get-started/govern-per-end-user) next. Keep the `studio-get-started` workspace and the `hr-assistant` credentials — the next tutorial builds on them. Do not tear the workspace down. Leave the `service` key in place unless the user asks to revoke it. # Call a model through a pool — agent instructions (/agent/tutorials/get-started/call-a-model-through-a-pool) These are the instructions an AI agent follows to run the [Call a model through a pool](/tutorials/get-started/call-a-model-through-a-pool) tutorial on your behalf. Read the tutorial instead if you are running the steps yourself. ## Goal [#goal] Put an LLM behind a named pool on the user's existing gateway, with the provider key held server-side and a Cedar rule permitting that pool. Teach spend quotas and set a five dollar monthly pool cap on Pro; on Free, explain quotas and continue without one. Prove the path with curl to `/v1/chat/completions` naming `employee-summary`. Then add a **second model** (same provider or other provider), attach it as failover (`--priority 1`), **switch priorities**, curl again with the identical request, and show audit naming different members for the two calls. Do **not** open the desk or write an SDK client in this tutorial. The next tutorial wires model + tools together in the desk. ## Rules [#rules] Follow these even if the rest of this page is unreachable. * **Confirm before you start.** Before running any commands, present the plan below and wait for the user to say proceed. * **Ask for the provider key.** Tell the user which provider you expect and ask them for the key when you reach that step. Do not search their environment, shell history, or files for one, and do not guess a provider. For the second member, ask whether they want another model on the same key or a second provider. * **Never print credentials.** Neither the provider API key nor the `dome_...` agent token may appear in chat, logs, or a file that is not gitignored. Pass the provider key to the CLI once. * **Teach the pool.** The client and the rules both name the pool. The connection is a backend member. Do not skip the pool and have the user call the connection directly. * **Authorize on `resource.pool`.** Do not authorize on the connection name. Adding a second member later must not require a rule change. * **Prove with curl.** Live calls are curl only: one before the switch, one after. Do not scaffold Python/OpenAI SDK code or start the desk unless the user explicitly asks after the curls succeed. * **Show routing.** Adding the second member and flipping priority is required, not optional. Explain that failover uses the priority-1 tier when the primary attempt fails; the live demo is the priority switch (same curl, different member in audit). * **Narrate as you go.** Before each step, tell the user in one or two sentences what you are about to do and why it matters (connection vs pool, server-side credentials, quota subjects, `llm:invoke` as a separate action, pool names versus provider model ids, priority tiers vs failover). Do not silently run the whole flow. * **Confirm the active context.** Run `dome context current` and confirm the workspace name starts with `studio-`. If it does not, stop and ask. Only change the workspace selected for this tutorial. * **Quotas are Pro.** Cost quotas are included on Pro. On Free, `dome quotas set` fails with a plan limit (`limit-max-cost-quotas`). Explain what quotas do, show the command, and continue without one. Do not treat a missing quota as a failed tutorial. * **Keep the cap low on Pro.** When a quota can be created, set five dollars per month on the pool. A real guardrail that is cheap to test is the point. * **Never widen governance to make a call pass.** Do not raise the cap or broaden the Cedar rule. Adding a second pool member for the routing demo is required; do not attach unrelated extra models beyond that. * **Spend the user's money sparingly.** Each successful call bills their provider account. Two curls (primary + after switch). Do not loop retries. * **Link the console.** After each create step, give the user a markdown link into the Dome console for the resource you just touched. Derive the base URL from `dome auth status` → `Server`. * **Show your evidence.** Never report a step as done without the command output that proves it. ## Quick setup [#quick-setup] Before running any commands, present the user with this checklist and wait for confirmation: ``` Here's what I'll do to put a governed LLM pool behind your gateway. 1. Confirm the workspace from the earlier tutorials is active 2. Add a model connection with your provider key 3. Create a pool, add the connection as a member, and attach the pool to Default 4. Walk through spend quotas (Pro). Set a $5/month pool cap if your plan allows it; skip on Free 5. Deploy a Cedar rule permitting inference on that pool (resource.pool), not the connection 6. Form the LLM ingress URL on the Default gateway and export credentials 7. Call the pool once with curl against /v1/chat/completions, naming employee-summary 8. Add a second model, attach it as failover, switch priorities, curl again (same request) 9. Show you the audit record — different members for the two calls (and spend if a quota was set) I'll need an OpenAI or Anthropic API key at step 2, and either a second model on that key or a second provider key at step 8. Calls bill your provider account. Shall I proceed? ``` Do not start step 1 until the user confirms. ## Steps [#steps] ### 1\. Confirm the workspace [#1-confirm-the-workspace] ```bash dome context current ``` The workspace must read `studio-get-started`. If it does not, run `dome context current`. If that workspace does not exist, run the [Govern your first agent](/tutorials/get-started/govern-your-first-agent) setup first and say so, rather than inventing a different scenario. ### 2\. Add the model connection [#2-add-the-model-connection] Ask the user for their provider and key now. Register the connection **without** attaching it to a gateway — the pool will carry the attachment. For OpenAI: ```bash dome models add openai-mini \ --provider openai \ --model gpt-4o-mini \ --api-key "" ``` For Anthropic: ```bash dome models add claude-sonnet \ --provider anthropic \ --model claude-3-5-sonnet-20241022 \ --api-key "" ``` Use the connection name the user's provider implies for the rest of these steps. Confirm it landed: ```bash dome models get openai-mini ``` Link the models page: `/models`. Explain that the key now lives in Dome's secret store, and that the connection is a backend member, not what the client will name. ### 3\. Create the pool and add the member [#3-create-the-pool-and-add-the-member] Create the pool and attach it to Default: ```bash dome models pool create employee-summary \ --description "HR assistant employee summarization" \ --routing-strategy priority_weighted \ --failover-max all \ --gateway Default ``` Explain the pool settings: `priority_weighted` prefers by tier then weight; `--failover-max all` walks every eligible member before giving up. Then add the connection as its only member: ```bash dome models pool member add employee-summary openai-mini \ --priority 0 \ --weight 1 ``` Explain that `--priority 0` marks this member as primary, and Dome tries a `--priority 1` member only if the primary fails. A single-member pool still matters because the client and the rules both name `employee-summary` — you will add a second member after the first curl without changing either. Then confirm: ```bash dome models pool get employee-summary dome models pool member list employee-summary ``` Do **not** add the second member yet. That is step 8, after the first curl proves the path. Link `/models` (or the pools view if linked from the console). ### 4\. Cap the spend on the pool [#4-cap-the-spend-on-the-pool] Explain that a quota is a dollar cap enforced before the provider is called, and that cost quotas are included on **Pro**. Free workspaces cannot create them. On Pro, run: ```bash dome quotas set \ --subject pool \ --pool employee-summary \ --limit 5 \ --window monthly \ --name "workspace cap" dome quotas list ``` Record the quota ID from the output. Explain that `--subject pool` caps every member that serves this pool. If `dome quotas set` fails with a plan limit such as `limit-max-cost-quotas`, tell the user quotas are a Pro feature, show what the command would have done, and continue to authorize the pool. Do not stop the tutorial or invent a workaround. ### 5\. Authorize the pool [#5-authorize-the-pool] The gateway attachment makes `employee-summary` reachable. It does not decide who may call it. Tool rules from earlier tutorials cover `mcp:call`, not inference. Inference is a separate action, `llm:invoke`, on `Dome::LLMModel`. Tell the user the intent before writing the file: allow `hr-assistant` to call models in the `employee-summary` pool, and deny every other inference call. Scope the rule to the pool name rather than a connection like `openai-mini`, so a failover member added later inherits the same permit. Write `hr-assistant-llm.cedar`: ```cedar permit( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource is Dome::LLMModel ) when { resource.pool == "employee-summary" }; forbid( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource ) unless { resource has pool && resource.pool == "employee-summary" }; ``` Deploy and verify without spending anything. Use `--resource-type llm_pool` so simulation stamps `resource.pool` the way a live pool-routed call does: ```bash dome rules apply hr-assistant-llm.cedar --agent hr-assistant --name hr-assistant-llm dome rules simulate --agent hr-assistant --action llm:invoke \ --resource employee-summary --resource-type llm_pool ``` Expect `ALLOW`. Then simulate a pool name that does not exist and expect `DENY`. Do not skip this check; it is cheaper than a failed live call. Explain that Dome rewrites pool-name literals to pool UUIDs on deploy, so the user authors names and the platform stores ids. ### 6\. Point at the LLM ingress [#6-point-at-the-llm-ingress] Point curl at the Default gateway's [LLM ingress](/concepts/gateways/llm-gateway). Model traffic shares the same `/gateways/` gateway prefix as the tools ingress from the first tutorial, and uses `/v1/chat/completions` instead of `/mcp`: ``` https:///gateways//v1/chat/completions ``` Retrieve the placeholders the same way as [Connect your client](/tutorials/get-started/govern-your-first-agent#connect-your-client): ```bash dome context current dome gateways list ``` If the user no longer has an agent token, mint one with `dome agents create-key hr-assistant --name pool-curl` and write it into a gitignored env file — never print it in chat. Export once. `DOME_GATEWAY_URL` stops at the gateway: ```bash export DOME_GATEWAY_URL="https://GATEWAY_HOST/gateways/DEFAULT_GATEWAY_ID" export DOME_TOKEN="AGENT_API_KEY" ``` ### 7\. Call the pool [#7-call-the-pool] Before the curl, show how the request differs from calling the provider directly: | Field | Value | | ------------- | ---------------------------------------------------------------------- | | URL | `$DOME_GATEWAY_URL/v1/chat/completions` | | Authorization | agent bearer token (`dome_…`), not the provider key | | `model` | `employee-summary` — the pool name, not `gpt-4o-mini` or `openai-mini` | Explain that Dome picks which member serves the call, and the client never names the upstream model or connection. Then call once: ```bash curl -sS -X POST "$DOME_GATEWAY_URL/v1/chat/completions" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "employee-summary", "messages": [ { "role": "user", "content": "Summarize this employee in one sentence: E001 Alice Johnson, Senior Engineer in Engineering." } ] }' ``` Show the response body. Confirm the call named `employee-summary`. Keep `DOME_GATEWAY_URL` and `DOME_TOKEN` exported for the second curl. Map any failure to its cause rather than retrying blindly: `400 select a gateway` means the `/gateways/` segment is missing, `403 model not available in this gateway` means the pool is not attached to Default or has no members, `404 no connection for requested model` means a provider model id or connection name was passed where a pool name belongs, `429 llm: quota exceeded` means the cap fired, and `401` means the provider key was used in place of the agent token. ### 8\. Add a second member and switch routing [#8-add-a-second-member-and-switch-routing] Ask whether the user wants **same provider** (another model on the same key) or **other provider** (second vendor key). Do not invent a key. Same provider examples: * Primary was `openai-mini` → add `openai-full` with `gpt-4o`, attach at `--priority 1` * Primary was `claude-sonnet` → add `claude-haiku` with `claude-3-5-haiku-20241022`, attach at `--priority 1` Other provider: add the opposite vendor connection and attach at `--priority 1`. ```bash dome models pool member list employee-summary ``` Explain: healthy calls still hit priority `0`; priority `1` is the failover tier used when the primary attempt fails (`--failover-max all`). Curl and Cedar still name only `employee-summary`. Flip priorities so the new member becomes primary (substitute the real connection names): ```bash dome models pool member update employee-summary \ --priority 1 \ --weight 1 dome models pool member update employee-summary \ --priority 0 \ --weight 1 dome models pool member list employee-summary ``` Run the **identical** curl from step 7 again. Show the response. Offer to flip priorities back so the original primary remains default for the desk tutorial. ### 9\. Show the spend and the record [#9-show-the-spend-and-the-record] ```bash dome audit query --limit 20 ``` Point out the attempted and completed `model.call` events attributed to `hr-assistant`; the completed stage carries token usage and the **member that served each call**. The two curls should show different members if the priority switch worked. Denials appear as completed `model.call` events with `result=denied` and the shared `denial` block. Link `/audit/events`. If a quota was set on Pro, also run: ```bash dome quotas list ``` Point out that the used figure moved. Offer, but do not perform unprompted, a cap enforcement test: lowering the limit below current spend makes the next call return `429` without reaching the provider. ```bash dome quotas update --limit 0.01 ``` If the user runs it, restore the original limit afterward with another `update`. On Free, skip the quota commands entirely. ### 10\. Offer the exit [#10-offer-the-exit] Point the user at [Build a governed app](/tutorials/get-started/build-a-governed-app) next. Keep the `studio-get-started` workspace — later tutorials in this track reuse it. Do not tear it down or remove the pool. # Govern per end user — agent instructions (/agent/tutorials/get-started/govern-per-end-user) These are the instructions an AI agent follows to run the [Govern per end user](/tutorials/get-started/govern-per-end-user) tutorial on your behalf. Read the tutorial instead if you are running the steps yourself. ## Goal [#goal] Point the HR application at **`delegated-hr`** (delegated identity + required act-as), not standing `hr-assistant`, so Eva (HR), Alice (self), and Carol (peer) get different answers from the **same** UI and code path. All three may list employees. Eva (HR) may open any employee record and call `get_salary`. Alice may open her own record (`sub` E001 == `employee_id`). Carol may not open Alice's record. Prefer tools for the live demo; Chat is optional once the pool rule is on `delegated-hr`. Before registering, narrate **standing vs delegated**: | | `hr-assistant` (standing) | `delegated-hr` (delegated) | | ------------------ | --------------------------------------------------- | ---------------------------------------------------- | | Who authorizes | agent grants | Verified human on `principal.act_as` | | Credential | Bearer only | Bearer + required `X-Dome-Act-As` | | Same tool / record | Same answer for everyone | Eva / Alice / Carol differ | | Why a second agent | Keep editor/curl tutorials working without a person | Purpose-built application that borrows each end user | Do not flip `hr-assistant` to `--actas-required` — that would break earlier Get Started paths. ## Rules [#rules] Follow these even if the rest of this page is unreachable. * **Confirm before you start.** Before running any commands, present the plan below and wait for the user to say proceed. * **Narrate as you go.** Before each step, tell the user in one or two sentences what you are about to do and why it matters (standing vs delegated identity, why a second agent, act-as verification methods, why `--actas-required` matters, the `has` guard in Cedar, self-lookup via `act_as.sub`, per-call identity, application signs server-side). Do not silently run the whole flow. * **Confirm the active context.** Run `dome context current` and confirm the workspace name starts with `studio-`. If it does not, stop and ask. Only change the workspace selected for this tutorial. * **Never print secrets.** Neither the `dome_...` agent token nor the act-as signing secret may appear in chat. Write both into `.env` and confirm it is gitignored first. * **Backend calls Dome.** The frontend must never call the gateway and must never hold `DOME_TOKEN` or `DOME_ACTAS_SECRET`. Only the Hono proxy sets `Authorization` and `X-Dome-Act-As`. Do not add `VITE_` prefixes or put secrets in client code. * **Keep the decision in Cedar.** Do not put user names, groups, or role checks into the application code, a prompt, or a system message. Do not edit `App.tsx` to branch on allow/deny — personas only supply signed identity claims. * **Never widen governance to make a call pass.** The denial for Carol on Alice's record is the expected result. Do not edit the rules, drop `--actas-required`, or add Carol to `hr`. * **Simulate before calling.** Check Eva, Alice (self), and Carol with `dome rules simulate`, including `--eval-arguments` for `employee_id`, before any live call. * **Use the reference app.** Do not write a Python `delegated_hr.py` unless the user explicitly asks. Default to [demo-hr-desk](https://github.com/dome-systems/demo-hr-desk). * **Link the console.** After each create step, give the user a markdown link into the Dome console for the resource you just touched. Derive the base URL from `dome auth status` → `Server`. * **Show your evidence.** Never report a step as done without the command output that proves it. ## Quick setup [#quick-setup] Before running any commands, present the user with this checklist and wait for confirmation: ``` Here's what I'll do to set up delegated identity on the HR application. 1. Confirm the workspace from earlier Get Started tutorials is active 2. Explain standing (hr-assistant) vs delegated (delegated-hr), then register delegated-hr with act-as required 3. Deploy Cedar: directory open to everyone; get_employee for HR or self (act_as.sub == employee_id); get_salary HR-only — plus the pool llm rule for Chat 4. Simulate Eva, Alice (self on E001), and Carol (denied on E001) before any live call 5. Point demo-hr-desk at delegated-hr: checkout tutorial/govern-per-end-user, server-only token + DOME_ACTAS_SECRET, run it — explain that the backend calls Dome and sets X-Dome-Act-As 6. Walk you through Act as Eva / Alice / Carol on Tools (Who is E001? and salary) 7. Show you the decisions in the audit trail Shall I proceed? ``` Do not start step 1 until the user confirms. ## Steps [#steps] ### 1\. Confirm the workspace [#1-confirm-the-workspace] ```bash dome context current ``` The workspace must read `studio-get-started`. If it does not, run `dome context current`. If that workspace does not exist, run the [Govern your first agent](/tutorials/get-started/govern-your-first-agent) setup first and say so, rather than inventing a different scenario. This tutorial needs the `demo-hr` connection and the Default gateway. ### 2\. Register the agent [#2-register-the-agent] Generate the signing secret first so it can be captured and written to `.env`, then register **`delegated-hr`**. Do not reuse or flip `hr-assistant` to `--actas-required` — that agent stays standing for the editor and curl paths in earlier tutorials. Narrate standing vs delegated before registering. ```bash openssl rand -hex 32 ``` ```bash dome agents register --name delegated-hr \ --actas-method hmac \ --actas-hmac-secret "" \ --actas-required \ --if-not-exists dome agents create-key delegated-hr --name delegated-hr-service ``` Explain the two flags: `--actas-method hmac` sets how the gateway verifies the presented identity, and `--actas-required` rejects any call with no identity attached. Capture the agent token and the secret without printing either. Link the agents page: `/agents`. ### 3\. Deploy the rules [#3-deploy-the-rules] Write `delegated-hr.cedar` and `delegated-hr-llm.cedar` as in the human tutorial (or copy from the reference repo). The LLM file permits `llm:invoke` on the `employee-summary` pool and forbids other inference — same shape as `hr-assistant-llm.cedar` from the pool tutorial, scoped to this agent: ```cedar title="delegated-hr-llm.cedar" permit( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource is Dome::LLMModel ) when { resource.pool == "employee-summary" }; forbid( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource ) unless { resource has pool && resource.pool == "employee-summary" }; ``` Deploy **both files in one apply** (a second apply replaces the previous agent bundle) and grant gateway access: ```bash dome rules apply delegated-hr.cedar delegated-hr-llm.cedar --agent delegated-hr --name delegated-hr dome gateways access grant Default delegated-hr ``` Explain the `principal has act_as` guard and that self-lookup compares `resource.arguments.employee_id` to `principal.act_as.sub` (personas use employee ids E005 / E001 / E003 as `sub`). Link `/gateways`. ### 4\. Simulate the three identities [#4-simulate-the-three-identities] Do this before running the app. Simulation needs no secret and makes no live call. Pass `--eval-arguments` whenever the rule reads `employee_id`. ```bash dome rules simulate --agent delegated-hr --action mcp:call \ --resource demo-hr/hr/get_employee --resource-type mcp_tool \ --eval-arguments '{"employee_id":"E001"}' \ --actas-sub E005 --actas-email eva@example.com --actas-groups hr dome rules simulate --agent delegated-hr --action mcp:call \ --resource demo-hr/hr/get_employee --resource-type mcp_tool \ --eval-arguments '{"employee_id":"E001"}' \ --actas-sub E001 --actas-email alice@example.com --actas-groups engineering dome rules simulate --agent delegated-hr --action mcp:call \ --resource demo-hr/hr/get_employee --resource-type mcp_tool \ --eval-arguments '{"employee_id":"E001"}' \ --actas-sub E003 --actas-email carol@example.com --actas-groups engineering dome rules simulate --agent delegated-hr --action mcp:call \ --resource demo-hr/finance/get_salary --resource-type mcp_tool \ --eval-arguments '{"employee_id":"E001"}' \ --actas-sub E005 --actas-email eva@example.com --actas-groups hr dome rules simulate --agent delegated-hr --action mcp:call \ --resource demo-hr/finance/get_salary --resource-type mcp_tool \ --eval-arguments '{"employee_id":"E001"}' \ --actas-sub E001 --actas-email alice@example.com --actas-groups engineering ``` Expect `ALLOW`, `ALLOW`, `DENY` for get\_employee, then `ALLOW` / `DENY` for get\_salary. If Eva and Carol return the same verdict on get\_employee, stop and report it. Also confirm `demo-hr/hr/list_employees` allows for all three. ### 5\. Configure and run the app [#5-configure-and-run-the-app] Confirm the clone from Prerequisites exists, then check out this tutorial's branch: ```bash cd demo-hr-desk git fetch origin git checkout tutorial/govern-per-end-user ``` Write `.env` (gitignored) for the **Node proxy only** — never `VITE_` or client env: ``` DOME_TOKEN= DOME_GATEWAY_URL=https:///gateways/ DOME_POOL=employee-summary DOME_ACTAS_SECRET= ``` ```bash npm install npm run dev ``` Before clicking around, make the architecture explicit: * Frontend sends only `persona` (`eva` | `alice` | `carol`) to `/api/chat` or `/api/tool` on localhost * Backend holds the agent token and act-as secret, signs `X-Dome-Act-As` with `signHMACActAs`, and calls Dome * `redactActAs` only truncates the header in the **View gateway call** sheet — the live request still sends the full signed value * The browser must never `fetch` the gateway or see `DOME_TOKEN` Walk the user through the `signHMACActAs` body in `server/actas.ts` (payload → canonical `|` ts → HMAC → base64 header). Do not rewrite the app. ### 6\. Walk the user through Eva, Alice, and Carol [#6-walk-the-user-through-eva-alice-and-carol] Tell the user to open [http://localhost:5173](http://localhost:5173). Confirm the **Act as** bar is visible. Have them stay on **tools**: 1. Eva → List employees (allow) → Who is E001? (allow · redacted) → What is Alice's salary? (allow) 2. Alice → Who is E001? (allow · self) → What is Alice's salary? (deny) 3. Carol → Who is E001? (deny) → open **View gateway call** and point out `X-Dome-Act-As` Optional: Chat with the same prompts across personas. Expected contrast: ``` Eva: get_employee allowed (email [REDACTED]); get_salary allowed Alice: get_employee allowed (self); get_salary denied Carol: get_employee denied by rule ``` Map any failure to its cause rather than retrying: missing Act as bar means no secret / restart needed, `400 act-as header required` means a call omitted the identity, `403 act-as verification failed` means the secret does not match the agent's, `403 agent act-as method does not meet workspace policy` means the workspace demands a stronger method such as `oidc`. If the masked email appears for Eva or Alice, that is the response filter from the first tutorial. Say so instead of treating it as a fault. ### 7\. Show the record [#7-show-the-record] ```bash dome audit query --limit 20 dome audit query --results denied --limit 10 ``` Point out that events carry both the agent and the verified end user, so the denial is attributable to a person rather than to a shared service account. A failed signature and a policy refusal are both denied `tool.call` operations; distinguish them by `denial.reason` (`act_as_rejected` versus `policy_denied` or `permission_denied`). Link `/audit/events`. ### 8\. Offer the exit [#8-offer-the-exit] This is the last tutorial in the Get Started track. Offer teardown: ```bash dome agents revoke-key delegated-hr delegated-hr-service dome workspaces delete studio-get-started ``` Remind the user to rotate the act-as secret anywhere it was copied, and to clear `DOME_ACTAS_SECRET` or switch back to `hr-assistant` if they return to earlier tutorials. Point them at [Delegated agents](/build/agents/delegated) and [Simulate Rules](/govern/rules/simulate) for next reading. # Govern your first agent — agent instructions (/agent/tutorials/get-started/govern-your-first-agent) These are the instructions an AI agent follows to run the [Govern your first agent](/tutorials/get-started/govern-your-first-agent) tutorial on your behalf. Read the tutorial instead if you are running the steps yourself. ## Goal [#goal] Stand up a governed HR assistant in a tutorial workspace, then hand the user the questions that demonstrate three outcomes: an allowed call, a call whose contact fields are redacted, and a denied call. The user asks those questions; you do not call the governed tools to demo them. ## Rules [#rules] Follow these even if the rest of this page is unreachable. * **Confirm before you start.** Before running any commands, present the plan below and wait for the user to say proceed. * **Narrate as you go.** Before each step, tell the user in one or two sentences what you are about to do and why it matters (workspace isolation, response filters, gateway grants, Cedar allowlists). Do not silently run the whole flow. * **Confirm the active context.** After switching context, run `dome context current` and confirm the workspace name starts with `studio-`. If it does not, stop and ask. Only change the workspace selected for this tutorial. * **Never print the agent token.** `dome agents create-key` returns a live bearer token once. Write it straight into the MCP client config, or a gitignored `.env` if the user is verifying with curl. Do not echo it, log it, or repeat it in chat. Confirm the config file is gitignored. * **Stop at both human handoffs.** `dome auth login` opens a browser; run it, then wait. You cannot reload the user's MCP config; after writing it, stop and wait for confirmation that the server is live. If the user prefers curl, skip the client reload and hand them the Verify the results curl tab instead. * **Hand off the demo.** Do not call `list_employees`, `get_employee`, `get_salary`, or `get_customer` yourself to prove the outcomes. After setup, give the user the AI Client prompts or the API via curl commands from the tutorial, then stop. * **Link the console.** After each create/grant/deploy step, give the user a markdown link into the Dome console for the resource you just touched. Derive the base URL from `dome auth status` → `Server` (for example `https://app.glint-8c.domesystems.ai`). Keep the user on the workspace context before linking. The console follows the active workspace. * **Expect re-runs.** Check for existing resources before creating them. Pass `--if-not-exists` where it exists. * **Show your evidence.** Never report a step as done without the command output that proves it. ## Quick setup [#quick-setup] Before running any commands, present the user with this checklist and wait for confirmation: ``` Here's what I'll do to get you set up with a governed HR assistant. 1. Install the Dome CLI (if needed) and sign in. This opens your browser. 2. Sync your contexts, then create a tutorial workspace 3. Register the demo HR tool server as demo-hr 4. Create a JSON Filter that redacts email and phone on the response path 5. Register an hr-assistant agent and mint its API key 6. Grant Gateway access and deploy Cedar Rules (allow IT and directory, deny the rest) 7. Write your MCP client config (or prepare curl against the gateway tools ingress) 8. Give you the questions to ask — or the matching curls — and what you should expect Shall I proceed? ``` Do not start step 1 until the user confirms. ## Steps [#steps] ### 1\. Install and authenticate [#1-install-and-authenticate] Check for the CLI. If it is missing, install it with `brew trust dome-systems/tap && brew install dome-systems/tap/dome`, or use the direct download described in [Install](/install): ```bash command -v dome && dome version || echo "Dome CLI not installed" ``` Authenticate, then confirm. `dome auth status` should report `Authenticated true`: ```bash dome auth login dome auth status ``` If the user was invited to a non-default stack, pass `--server`, for example `dome auth login --server https://app.glint-8c.domesystems.ai`. After a successful sign-in, sync contexts so stale workspaces from earlier sessions drop out of the local cache: ```bash dome context sync dome context list ``` ### 2\. Create a workspace [#2-create-a-workspace] ```bash dome workspaces create --name studio-get-started dome context sync dome context current ``` Confirm the workspace name starts with `studio-` before continuing. Record the gateway host from `dome context current`, and record the console base URL from `dome auth status` → `Server` (you will use it for links below). ### 3\. Register the demo tool [#3-register-the-demo-tool] Register the public demo server and attach it to Default. A tool is unreachable until it belongs to a gateway: ```bash dome tools add \ --name demo-hr \ --url https://demo-mcp.domesystems.ai/mcp \ --protocol streamable-http \ --auth-method none \ --gateway Default ``` The connection name prefixes every tool, so the demo server's tools become `demo-hr/it/get_incidents`, `demo-hr/hr/get_employee`, and so on. Use those qualified names in the rules below. Then point the user at the tools page so they can see `demo-hr`: `/tools` (for example [https://app.glint-8c.domesystems.ai/tools](https://app.glint-8c.domesystems.ai/tools)). Also link `/gateways` so they can confirm Default now lists the tool. ### 4\. Redact contact fields [#4-redact-contact-fields] Tool connections take JSON filters. Write `redact-contact.json`: ```json { "json": { "components": [ { "fieldActions": [ { "matcher": { "path": "**.email" }, "action": "FILTER_ACTION_REDACT" }, { "matcher": { "path": "**.phone" }, "action": "FILTER_ACTION_REDACT" } ] } ] } } ``` The `**.` prefix is recursive descent, so it matches the field at any depth. Create the filter, then assign it to the response direction — creating it does not apply it: ```bash dome guards filters create redact-contact \ --description "Redact contact fields in tool responses" \ --config-from redact-contact.json dome tools guards filters set demo-hr \ --direction response \ --filters redact-contact ``` Confirm the assignment landed before continuing: ```bash dome tools guards filters list demo-hr ``` This is what produces the redaction the user will see. If the chain is empty, stop and report it rather than continuing to a demo that will not hold. ### 5\. Register the agent and mint a key [#5-register-the-agent-and-mint-a-key] ```bash dome agents register --name hr-assistant --if-not-exists dome agents create-key hr-assistant --name agent-tutorial ``` Capture the token without printing it. Link the agents page so they can open `hr-assistant`: `/agents` (for example [https://app.glint-8c.domesystems.ai/agents](https://app.glint-8c.domesystems.ai/agents)). ### 6\. Grant access and narrow it [#6-grant-access-and-narrow-it] ```bash dome gateways access grant Default hr-assistant ``` Link `/gateways` (or `/gateways/`) so they can see `hr-assistant` under the gateway's granted agents. Explain briefly: the grant admits the agent at Default and permits every current and future member of that gateway. That is a useful baseline, but broader than this HR assistant's job. Then deploy three rules on top of it: a `permit` that keeps discovery open, a `permit` for the tools this assistant may call, and a `forbid … unless` that blocks everything else (`forbid` always wins). The last two share the same allowlist. Write `hr-assistant.cedar`: ```cedar permit( principal is Dome::Agent, action == Dome::Action::"mcp:discover", resource ); permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) when { resource in [ Dome::MCPTool::"demo-hr/hr/list_employees", Dome::MCPTool::"demo-hr/hr/get_employee", Dome::MCPTool::"demo-hr/hr/org_chart", Dome::MCPTool::"demo-hr/it/list_services", Dome::MCPTool::"demo-hr/it/get_incidents" ] }; forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) unless { resource in [ Dome::MCPTool::"demo-hr/hr/list_employees", Dome::MCPTool::"demo-hr/hr/get_employee", Dome::MCPTool::"demo-hr/hr/org_chart", Dome::MCPTool::"demo-hr/it/list_services", Dome::MCPTool::"demo-hr/it/get_incidents" ] }; ``` Deploy it scoped to the agent, which is what limits `principal is Dome::Agent` to `hr-assistant`: ```bash dome rules apply hr-assistant.cedar --agent hr-assistant --name hr-assistant ``` Verify all three cases before touching any client config: ```bash dome rules simulate --agent hr-assistant --action mcp:call \ --resource demo-hr/hr/get_employee --resource-type mcp_tool dome rules simulate --agent hr-assistant --action mcp:call \ --resource demo-hr/finance/get_salary --resource-type mcp_tool dome rules simulate --agent hr-assistant --action mcp:call \ --resource demo-hr/sales/get_customer --resource-type mcp_tool ``` Expect `ALLOW`, `DENY`, `DENY`. If `get_employee` is not `ALLOW`, or either denied tool is `ALLOW`, the rule did not deploy. Stop and report it rather than continuing to a demo that will not hold. Link the rules page so they can see the deployed `hr-assistant` bundle: `/rules` (for example [https://app.glint-8c.domesystems.ai/rules](https://app.glint-8c.domesystems.ai/rules)). ### 7\. Write the client config [#7-write-the-client-config] Get the agent token and Default gateway ID. `AGENT_API_KEY` is the `Token: dome_…` value from `dome agents create-key` earlier. Tokens are shown once; if the user did not save it, mint another with `dome agents create-key hr-assistant --name cursor` and use that value — never print it in chat. ```bash dome gateways list dome context current ``` The client URL is the Default gateway's **tools ingress** — MCP discovery and `tools/call` enter the data plane here: ``` https:///gateways//mcp ``` It is not `dome mcp serve`, which exposes platform management tools instead. If the user prefers curl over an MCP client, skip writing client config. Hand them the gateway URL and token (into a gitignored `.env`, never in chat), point them at the Verify the results curl tab, and continue to step 8. Otherwise write the config for the client you are running in. For Cursor, `.cursor/mcp.json`: ```json { "mcpServers": { "hr-assistant": { "url": "https:///gateways//mcp", "headers": { "Authorization": "Bearer " } } } } ``` For Claude Code: ```bash claude mcp add --transport http hr-assistant \ https:///gateways//mcp \ --header "Authorization: Bearer " ``` For Codex, export the token and reference it by variable name in `~/.codex/config.toml`: ```toml [mcp_servers.hr-assistant] url = "https:///gateways//mcp" bearer_token_env_var = "DOME_AGENT_TOKEN" ``` Then stop. Tell the user to enable the `hr-assistant` server in their client and wait for confirmation. ### 8\. Hand the user the demo [#8-hand-the-user-the-demo] Once the server is live — or if the user prefers not to use an MCP client — **stop calling tools yourself**. Give them the Verify the results path from the tutorial: * **AI Client** (default): the four prompts below, with expected results. * **API via curl**: the four `tools/call` curls in the tutorial, using `DOME_GATEWAY_URL` and `DOME_TOKEN` (never print the token). | Ask | Expect | | ---------------------------------------- | -------------------------------------------------- | | "Who works here?" | A list of demo employees with ids such as `E001`. | | "Who is E001, and how do I reach them?" | The record, with `"email": "[REDACTED]"`. | | "What is Alice's salary?" | Denied by the rule. | | "Pull up the Acme Corp customer record." | Denied, though nothing named that tool explicitly. | Explain why redaction happens: a response filter on the connection replaces `email` and `phone` at any depth before the result reaches the agent. The backend returned the real address. Governance applies to the agent's path, not to the user's prompt wording. If the user reports that the customer record returned data, say so plainly. The rule is broader than intended. ### 9\. Show the record and the exit [#9-show-the-record-and-the-exit] After the user has tried the prompts, offer to inspect the audit trail: ```bash dome audit query --limit 20 ``` Point out the attempted and completed stages of `tool.call`, the sibling `guard.filter.evaluate`, and the refused `tool.call` with `result=denied`, all attributed to `hr-assistant`. To show only rejections, run `dome audit query --results denied --limit 10`. Also link the console audit view: `/audit/events`, or the agent-scoped view `/audit/agents/`. Close by pointing the user at [Call a model through a pool](/tutorials/get-started/call-a-model-through-a-pool). Keep the `studio-get-started` workspace — later tutorials in this track reuse it. Do not tear it down. # Adopt an existing app — agent instructions (/agent/tutorials/production/adopt-an-existing-app) These are the instructions an AI agent follows to run the [Adopt an existing app](/tutorials/production/adopt-an-existing-app) tutorial on your behalf. Read the tutorial instead if you are running the steps yourself. ## Goal [#goal] Move the user's existing LLM app onto the governed path by changing configuration rather than logic, prove parity against the direct provider path, keep a one-variable rollback, then apply a rule and a spend cap. Report anything that cannot move yet. ## Rules [#rules] Follow these even if the rest of this page is unreachable. * **Read before you write.** Inspect the repository first and present what you found. Wait for the user to confirm before editing any file. * **Confirm the environment.** Ask which environment you are working in. Never touch production configuration. * **Change configuration, not logic.** Do not restructure code, swap SDKs, rename variables beyond what is required, or revise prompts. If a base URL or key is hardcoded, propose the smallest change that makes it configurable and explain why. * **Keep the rollback real.** The switch back must be a single environment variable, and you must demonstrate it works before proceeding. * **Never print or commit credentials.** Neither the provider key nor the `dome_...` agent token may appear in chat or in a tracked file. Confirm the env file is gitignored. * **Workspace first.** Create a workspace for the parity check unless the user directs otherwise. * **Never skip the parity check.** Run the same deterministic prompt through both paths and show both outputs before recommending the switch. * **Report blockers plainly.** If part of the app uses a surface Dome does not proxy, say so and leave that path alone. Do not attempt a workaround. * **Show your evidence.** Never report a step as done without the command output that proves it. ## Quick setup [#quick-setup] Inspect the repository first, then present the user with this checklist including your findings, and wait for confirmation: ``` Here's what I found and what I'll do to move your app onto Dome. Found: - Provider SDKs in use: - Client construction sites: - Model names passed: - Unsupported surfaces detected: Plan: 1. Create a workspace for the migration test 2. Create a Dome model connection mirroring your current provider and model 3. Register an agent for the app and grant it gateway access 4. Wire three config values so reverting is one environment variable 5. Run a parity check through both paths and compare 6. Once parity holds, deploy a rule and a spend cap, then remove the provider key Which environment am I working in? Shall I proceed? ``` Do not edit any file until the user confirms. ## Steps [#steps] ### 1\. Inspect the app [#1-inspect-the-app] Find unsupported surfaces first. This determines whether the app can move at all: ```bash grep -rn "responses.create\|/v1/responses\|moderations" --include="*.py" --include="*.ts" --include="*.js" . ``` Dome proxies `POST /v1/chat/completions`, `/v1/messages`, `/v1/messages/count_tokens`, `/v1/embeddings`, and `GET /v1/models`. It returns `501` for `/v1/responses` and `/v1/moderations`. Provider-specific endpoints go through `POST /v1/passthrough/`. Then find every client construction and model reference: ```bash grep -rn "OpenAI(\|Anthropic(\|base_url\|baseURL\|api_key\|apiKey" --include="*.py" --include="*.ts" --include="*.js" . ``` Report all of it to the user before changing anything. Call out hardcoded base URLs or keys as the one place a code change is warranted. ### 2\. Create a workspace [#2-create-a-workspace] ```bash dome workspaces create --name studio-adopt dome context sync dome context current ``` Confirm the workspace name starts with `studio-` before creating anything. ### 3\. Mirror the model [#3-mirror-the-model] Name the connection after the model id the app already passes, so the application's model string keeps working. Ask the user for their provider key at this point: ```bash dome models add gpt-4o \ --provider openai \ --model gpt-4o \ --api-key "" \ --gateway Default ``` For Anthropic, substitute `--provider anthropic` and the Anthropic model id as both the connection name and `--model`. Explain that this naming is a migration convenience rather than the end state: connection names are independent of provider models, so a name of their own choosing later lets them change providers without touching the app. Do not remove the provider key from the app's environment yet; the parity check needs it. ### 4\. Register the app's agent [#4-register-the-apps-agent] ```bash dome agents register --name checkout-service --if-not-exists dome agents create-key checkout-service --name production dome gateways access grant Default checkout-service ``` Use a name matching their app rather than `checkout-service` if one is obvious from the repository. Link the console: `/agents` and `/models`. ### 5\. Wire the switch [#5-wire-the-switch] Collect the endpoint values: ```bash dome context current dome gateways list ``` Make the routing conditional on one variable so rollback needs no deploy: ```python import os from openai import OpenAI def build_client() -> OpenAI: gateway_url = os.getenv("DOME_GATEWAY_URL") if gateway_url: return OpenAI(base_url=f"{gateway_url}/v1", api_key=os.environ["DOME_TOKEN"]) return OpenAI(api_key=os.environ["OPENAI_API_KEY"]) ``` Match the user's existing style and language rather than imposing this shape. For Anthropic clients, set `base_url` to the gateway **without** `/v1`, since their SDK appends `/v1/messages`. Smoke-test before pointing the app at it: ```bash curl -s https:///gateways//v1/models \ -H "Authorization: Bearer " ``` Note for the user that `GET /v1/models` skips the admission check, so a passing smoke test proves the URL and credential are right but does not prove the gateway grant exists. ### 6\. Verify parity [#6-verify-parity] Run the same deterministic prompt through both paths: ```python import os from openai import OpenAI PROMPT = "Reply with exactly the word: ready" def ask(client: OpenAI) -> str: response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": PROMPT}], temperature=0, ) return response.choices[0].message.content direct = OpenAI(api_key=os.environ["OPENAI_API_KEY"]) governed = OpenAI( base_url=os.environ["DOME_GATEWAY_URL"] + "/v1", api_key=os.environ["DOME_TOKEN"], ) print("direct: ", ask(direct)) print("governed:", ask(governed)) ``` Show the user both outputs. Beyond matching text, confirm the response object shape their code destructures is unchanged, that streaming still works if they use it, and that the added proxy hop fits their latency budget. Demonstrate the rollback by unsetting `DOME_GATEWAY_URL` and running again. Then show the record the direct path did not produce: ```bash dome audit query --limit 10 ``` Point out the attempted and completed `model.call` stages attributed to the agent; the completed event carries token usage. Map failures to causes rather than retrying: `400 select a gateway` means the `/gateways/` segment or `/v1` suffix is missing, `404 no connection for requested model` means the model string does not match a connection name, `403 model not available in this gateway` means the connection is not attached to Default, `403 agent is not granted access` means the admission grant is missing, `401` means the app is still sending the provider key, and `501` means an unsupported surface. ### 7\. Add the governance [#7-add-the-governance] Parity is the midpoint. Nothing is governed until this step. Write `checkout-service.cedar`: ```cedar permit( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource == Dome::LLMModel::"gpt-4o" ); forbid( principal is Dome::Agent, action == Dome::Action::"llm:invoke", resource ) unless { resource == Dome::LLMModel::"gpt-4o" }; ``` ```bash dome rules apply checkout-service.cedar --agent checkout-service --name checkout-service dome quotas set \ --subject agent \ --agent checkout-service \ --limit 200 \ --window monthly \ --name "checkout service" ``` Ask the user for the spend limit rather than assuming 200; they now have usage data to size it from. Verify both: ```bash dome rules simulate --agent checkout-service --action llm:invoke \ --resource gpt-4o --resource-type llm_model dome quotas list ``` ### 8\. Close the bypass [#8-close-the-bypass] Tell the user to remove the provider key from the app's environment. Until they do, the fallback branch can silently restore ungoverned access, which is worse than having no rollback because it works. Recommend rolling out the way they would any configuration change: one environment, then a share of production traffic, then the rest. Summarize the four claims and the command that proves each: | Claim | Proof | | -------------------------------------- | ------------------------------------------------------------- | | Reaches the provider only through Dome | No provider key in the app environment | | Calls are attributed | `dome audit query --limit 10` | | Only the intended model is reachable | `dome rules simulate` returns `DENY` for any other connection | | Spend is capped | `dome quotas list` | # Debug a tool call denial — agent instructions (/agent/tutorials/production/debug-a-denial) These are the instructions an AI agent follows to run the [Debug a tool call denial](/tutorials/production/debug-a-denial) tutorial on your behalf. Read the tutorial instead if you are running the steps yourself. ## Goal [#goal] Teach the user to diagnose Dome denials by planting three failures at three different layers and walking through each one with evidence: a Cedar rule denial, an explicit gateway access denial, and a malformed endpoint that never reaches authorization. Restore every change before finishing. ## Rules [#rules] Follow these even if the rest of this page is unreachable. * **Confirm before you start.** Before running any commands, present the plan below and wait for the user to say proceed. * **Narrate as you go.** For each failure, tell the user what you are about to break, what error to expect, and which gate produced it. Do not silently run the whole flow. * **Confirm the active context.** Run `dome context current` and confirm the workspace name starts with `studio-`. If it does not, stop and ask. You are deliberately breaking things in this tutorial, so this check is not optional. * **Restore everything.** Every change you make must be reverted in the same session, with command output proving it. Never end while the workspace is broken. If you cannot restore something, say so prominently. * **Diagnose from evidence.** For each failure, show the audit event and the simulation result, not just the client-side error. The client's message is a model's paraphrase and is not evidence. * **Never fix a denial by widening the rules.** Show what the rule says, then restore the original state. Do not deploy a broader bundle or add tools to an allowlist. * **Never print the agent token.** Use a placeholder in any command you show the user. * **Show your evidence.** Never report a step as done without the command output that proves it. ## Quick setup [#quick-setup] Before running any commands, present the user with this checklist and wait for confirmation: ``` Here's what I'll do to teach you denial diagnosis. I'll break three things on purpose, then restore them. 1. Confirm the workspace from the first tutorial is active 2. Reproduce a Cedar denial and attribute it to a specific rule 3. Revoke a Gateway grant so invocation is denied, then diagnose and restore it 4. Call a malformed endpoint to show what a non-authorization failure looks like 5. Show you the audit evidence and simulation for each 6. Verify the workspace is back to its original state Shall I proceed? ``` Do not start step 1 until the user confirms. ## Steps [#steps] ### 1\. Confirm the workspace [#1-confirm-the-workspace] ```bash dome context current ``` The workspace must read `studio-get-started`. If it does not, run `dome context current`. If that workspace does not exist, run the [Govern your first agent](/tutorials/get-started/govern-your-first-agent) setup first and say so. This tutorial needs its `hr-assistant` agent, rule bundle, and `demo-hr` connection. Record the baseline so you can prove restoration later: ```bash dome gateways access list Default dome rules show --agent hr-assistant ``` ### 2\. Explain the order of the gates [#2-explain-the-order-of-the-gates] Before breaking anything, give the user this ladder. The first gate to reject ends the call, so the gate that answered tells you where to look. | Order | Gate | Typical signal | | ----- | ------------------- | -------------------------------------------------------------- | | 1 | Authentication | `401`; `403` for suspended or revoked | | 2 | Act-as verification | `400 act-as header required`, `403 act-as verification failed` | | 3 | Endpoint selection | `400 select a gateway` | | 4 | gateway membership | `tool not available in this gateway` | | 5 | gateway admission | `agent is not granted access to this gateway` | | 6 | quota | `429 llm: quota exceeded` | | 7 | rules | `denied by rule: ` | Emphasize two points: quota sits above rules, so a correct-looking permit still fails if the spend cap is exhausted; and discovery is not an access check because the gateway grant is enforced on invocation. ### 3\. Diagnose a rule denial [#3-diagnose-a-rule-denial] The existing bundle already forbids payroll, so nothing needs breaking. Ask the user to send this to their assistant, or note that the denial is already reproducible: ``` What is Alice's salary? ``` Then gather evidence: ```bash dome audit query --results denied --limit 5 dome rules simulate --agent hr-assistant --action mcp:call \ --resource demo-hr/finance/get_salary --resource-type mcp_tool dome rules show --agent hr-assistant ``` Explain the distinction in the reason string: `denied by rule: ` means an explicit `forbid` matched, while a reason with no rule identifier or `no rule bundle loaded` means nothing permitted the call. Those have different fixes. Tell the user the first command to run in this situation is `dome audit query --results denied`. ### 4\. Diagnose a Gateway access denial [#4-diagnose-a-gateway-access-denial] Tell the user what you are about to do, then revoke the grant: ```bash dome gateways access revoke Default hr-assistant ``` Ask the user to reload MCP in their client and call `demo-hr/hr/list_employees`. The call fails with `agent is not granted access to this gateway`. Explain that discovery can still list the tool and therefore does not prove the grant exists. Show why a rules check misleads here. Cedar still permits discovery: ```bash dome rules simulate --agent hr-assistant --action mcp:discover \ --resource demo-hr/hr/list_employees --resource-type mcp_tool ``` That returns `ALLOW` while invocation is rejected, because gateway admission runs before resource authorization. Then show the command that actually answers the question: ```bash dome gateways access list Default ``` **Restore immediately** and prove it: ```bash dome gateways access grant Default hr-assistant dome gateways access list Default ``` Ask the user to retry the tool call and confirm it succeeds. Tell them the rule of thumb: when invocation reports a missing gateway grant, check access before changing rules. Mention `dome gateways get Default` for the neighboring membership failure, where a tool belongs to no gateway. ### 5\. Diagnose a malformed endpoint [#5-diagnose-a-malformed-endpoint] Show that not every failure is authorization. Use a placeholder for the token; do not print the real one: ```bash curl -i -X POST https:///mcp \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' ``` Expect `400` with `select a gateway: use /gateways/{id}/mcp`. Point out that nothing appears in audit, because the request never identified a gateway to evaluate against. Give the user the heuristic: `400` and `401` are the caller's problem, while `403` and JSON-RPC `-32001` are the policy's answer. Only the second kind is worth escalating. ### 6\. Distinguish denials from redactions [#6-distinguish-denials-from-redactions] Explain that `guard.filter.evaluate` is a verdictless sibling event. Its `direction` and `actions` fields say what the filter did; the enclosing call carries any denial. The call was authorized and something was changed rather than refused. If a field arrived as `[REDACTED]`, the rules are not the place to look: ```bash dome tools guards filters list demo-hr ``` Show how to follow one request end to end: ```bash dome audit chains --limit 10 dome audit chain dome audit get ``` ### 7\. Prove the workspace is restored [#7-prove-the-workspace-is-restored] Do not skip this. Compare against the baseline from step 1: ```bash dome gateways access list Default dome rules simulate --agent hr-assistant --action mcp:call \ --resource demo-hr/hr/list_employees --resource-type mcp_tool dome rules simulate --agent hr-assistant --action mcp:call \ --resource demo-hr/finance/get_salary --resource-type mcp_tool ``` Expect the grant to be present, then `ALLOW` followed by `DENY`. State explicitly that the workspace is back to its original state. Mention that `dome rules simulate` exits non-zero on a denial, so it works as a CI check asserting that calls which should be impossible stay impossible. ### 8\. Give the user the summary [#8-give-the-user-the-summary] Close with a short reference they can keep, mapping message to gate: | Message | Gate | | ------------------------------------------------ | ------------------------------------- | | `select a gateway` | Endpoint selection; nothing evaluated | | `401 invalid or expired token` | Authentication | | `agent is suspended` / `revoked` | Lifecycle state, not policy | | `act-as header required` / `verification failed` | Act-as | | `tool not available in this gateway` | Membership | | `agent is not granted access…` | Admission | | `llm: quota exceeded` | quota | | `denied by rule: ` | Cedar forbid | | `no rule bundle loaded` | Nothing deployed; default deny | | `policy stale` | Infrastructure, failing closed | # Govern callers with OIDC — agent instructions (/agent/tutorials/production/govern-callers-with-oidc) These are the instructions an AI agent follows for [Govern callers with OIDC](/tutorials/production/govern-callers-with-oidc). ## Goal [#goal] Build a standalone governed internal desk assistant in a tutorial workspace where authorization comes from each signed-in employee's OIDC token. Prove different outcomes for three real test users, then show the Callers registry and audit evidence. This tutorial depends on no other tutorial, and does not use HMAC, device-bound enrollment, or a persona map. ## Safety rules [#safety-rules] * Confirm the active context. Run `dome context current` and confirm the workspace starts with `studio-`. Stop and ask if it does not. * Never print the `dome_...` agent token or any end-user token. Write secrets into a gitignored env file and confirm it is ignored. * Use tokens issued by the user's identity provider for test users in a development or staging tenant. Never mint, forge, or hand-assemble claims. * Never place the agent token or an end-user token in browser code, client env, or a URL query string. * Do not widen Cedar to make a denial succeed. * Simulate with act-as flags before live calls. * Read the demo directory before choosing employee IDs. Do not assume which IDs exist. * Never report a step as done without showing the command output. ## Ask the user first [#ask-the-user-first] 1. The OIDC issuer base URL. Dome appends `/.well-known/openid-configuration`; do not store the discovery URL itself. 2. Whether tokens carry `groups` as a string array and a stable `sub`. 3. Development tokens for three test users, held in environment variables rather than pasted into chat: one in `engineering`, one in `sales`, one in `finance`. If tokens lack `groups`, stop and tell the user to add the claim mapping at the provider. A rule reading an absent claim denies everything and looks like a Dome fault. ## Procedure [#procedure] 1. Provision and enter the workspace: ```bash dome workspaces create --name studio-callers dome context sync dome context current ``` 2. Attach the demo backend: ```bash dome tools add \ --name internal-desk \ --url https://demo-mcp.domesystems.ai/mcp \ --protocol streamable-http \ --auth-method none \ --gateway Default ``` 3. Confirm discovery is reachable, then create the provider: ```bash curl --fail --silent "$OIDC_ISSUER/.well-known/openid-configuration" dome verification-providers create \ --name workforce-oidc \ --method oidc \ --oidc-url "$OIDC_ISSUER" dome verification-providers list --scope workspace --include-chain ``` Export the provider UUID as `OIDC_PROVIDER_ID`. 4. Register the delegated agent, mint its key, and grant gateway access: ```bash dome agents register --name desk-copilot \ --actas-method oidc \ --actas-provider "$OIDC_PROVIDER_ID" \ --actas-required \ --if-not-exists dome agents create-key desk-copilot --name desk-service dome gateways access grant Default desk-copilot ``` 5. Deploy `desk-copilot.cedar` exactly as published on the tutorial page: discovery open; `hr/list_employees` for any verified caller; `finance/expense_report` for `finance` or the subject itself; `sales/get_customer` for `sales`; `finance/department_budget` for `finance`; matching `forbid … unless` rules plus a closing allowlist forbid. ```bash dome rules apply desk-copilot.cedar --agent desk-copilot --name desk-copilot ``` Every claim read must sit behind `principal has act_as`, so an unverified call denies instead of erroring. 6. Define the call helper and read the directory to learn real employee IDs: ```bash call_as() { curl -sS -X POST "$DOME_GATEWAY_URL/mcp" \ -H "Authorization: Bearer $DOME_TOKEN" \ -H "X-Dome-Act-As: $1" \ -H "Content-Type: application/json" \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"$2\",\"arguments\":$3}}" } call_as "$IC_TOKEN" internal-desk/hr/list_employees '{}' ``` Export `OWN_ID` as the employee ID matching the engineering user's `sub`, and `OTHER_ID` as a different employee ID. If no ID matches that `sub`, stop and tell the user to align the claim at the provider rather than editing the rule to fit. 7. Simulate before the remaining live calls: ```bash dome rules simulate --agent desk-copilot --action mcp:call \ --resource internal-desk/finance/expense_report --resource-type mcp_tool \ --eval-arguments "{\"employee_id\":\"$OWN_ID\"}" \ --actas-sub "$OWN_ID" --actas-groups engineering dome rules simulate --agent desk-copilot --action mcp:call \ --resource internal-desk/finance/expense_report --resource-type mcp_tool \ --eval-arguments "{\"employee_id\":\"$OTHER_ID\"}" \ --actas-sub "$OWN_ID" --actas-groups engineering dome rules simulate --agent desk-copilot --action mcp:call \ --resource internal-desk/sales/get_customer --resource-type mcp_tool \ --actas-sub sales-user --actas-groups sales dome rules simulate --agent desk-copilot --action mcp:call \ --resource internal-desk/finance/department_budget --resource-type mcp_tool \ --actas-sub finance-user --actas-groups finance ``` Expect `ALLOW`, `DENY`, `ALLOW`, `ALLOW`. Stop and report if the second returns `ALLOW`. 8. Call the gateway as each user, changing only `X-Dome-Act-As`: | Caller | tool and arguments | Result | | ----------- | ------------------------------------------------------------------------ | -------- | | Engineering | `internal-desk/finance/expense_report` `{"employee_id":"$OWN_ID"}` | Allowed | | Engineering | `internal-desk/finance/expense_report` `{"employee_id":"$OTHER_ID"}` | Denied | | Engineering | `internal-desk/sales/get_customer` `{"customer_id":"C001"}` | Denied | | Sales | `internal-desk/sales/get_customer` `{"customer_id":"C001"}` | Allowed | | Sales | `internal-desk/finance/department_budget` `{"department":"Engineering"}` | Denied | | Finance | `internal-desk/finance/department_budget` `{"department":"Engineering"}` | Allowed | | no header | `internal-desk/hr/list_employees` `{}` | Rejected | Explain that curl stands in for the application backend, which takes the token from authenticated server-side session state and builds headers per request. 9. Show the registry and its evidence: ```bash dome callers list dome callers list --group finance dome callers get "$OWN_ID" dome audit query --limit 20 dome audit query --act-as-sub "$OWN_ID" --limit 10 dome audit query --results denied --limit 10 dome audit query --deny-reasons act_as_rejected --limit 10 ``` Explain that Callers are projected from verified traffic, keyed by provider and subject, never pre-provisioned, and that erasure removes the projection but not the audit evidence. 10. Raise the workspace floor in the workspace and re-verify: ```bash dome workspaces actas get dome workspaces actas update \ --required \ --allowed-methods oidc \ --required-provider "$OIDC_PROVIDER_ID" dome workspaces actas get ``` Note that this update is a full replace, that an agent may be stricter but not weaker, and that in a real workspace `dome agents list` must be reviewed first because standing agents would start failing. 11. Offer cleanup: ```bash dome workspaces delete studio-callers ``` ## Completion evidence [#completion-evidence] Show the provider and agent configuration without secrets, the simulation verdicts, at least one allowed and one denied live call per test user, the three Caller records, audit rows naming both the agent and the person, and the workspace floor before and after. Do not claim completion if only simulation was run, if any token or agent key reached chat, logs, or the browser, or if identity claims were constructed by code rather than issued by the provider. # Developer — agent instructions (/agent/tutorials/role/developer) These are the instructions an AI agent follows to run the [Developer](/tutorials/role/developer) tutorial on your behalf. Read the tutorial instead if you are running the steps yourself. ## Goal [#goal] Stand up `role-dev-agent` in `studio-role-developer`, attach `demo-hr`, deploy a directory-only Cedar allowlist, then hand the user curl or Python calls that prove allow (`list_employees`) and deny (`get_salary`), plus audit. ## Rules [#rules] * **Confirm before you start.** Present the plan below and wait for proceed. * **Narrate as you go.** One or two sentences before each step. * **Confirm the active context.** Confirm `dome context current` workspace starts with `studio-`. * **Never print the agent token.** Write it to a gitignored `.env`. * **Hand off verify.** Do not call governed tools yourself to demo outcomes. Give the user the curl/Python commands from the tutorial. * **Link the console.** After create/grant/deploy, link using `dome auth status` → `Server`. * **Show evidence.** Never report done without command output. ## Quick setup [#quick-setup] ``` Here's what I'll do for the Developer role tutorial. 1. Provision studio-role-developer and switch into it 2. Register role-dev-agent and mint a key (token into .env only) 3. Attach demo-hr to Default and grant gateway access 4. Deploy Cedar: allow directory tools, deny salary 5. Hand you curl and Python verify commands (allow + deny) 6. Show audit, then offer clean up Shall I proceed? ``` ## Steps [#steps] ### 1\. Provision workspace [#1-provision-workspace] ```bash dome workspaces create --name studio-role-developer dome context sync dome context current ``` Confirm workspace is `studio-role-developer`. ### 2\. Register agent [#2-register-agent] ```bash dome agents register --name role-dev-agent --if-not-exists dome agents create-key role-dev-agent --name service ``` Write token to `.env` as `DOME_TOKEN=...`. Do not print it. Link `/agents`. ### 3\. Attach tools and grant [#3-attach-tools-and-grant] ```bash dome tools add \ --name demo-hr \ --url https://demo-mcp.domesystems.ai/mcp \ --protocol streamable-http \ --auth-method none \ --gateway Default dome gateways access grant Default role-dev-agent ``` Link `/tools` and `/gateways`. ### 4\. Deploy rules [#4-deploy-rules] Write and apply `role-dev-agent.cedar` exactly as in the human tutorial (directory allowlist + forbid unless). Then simulate allow and deny. ```bash dome rules apply role-dev-agent.cedar --agent role-dev-agent --name role-dev-agent ``` ### 5\. Hand off verify [#5-hand-off-verify] Collect `DOME_GATEWAY_URL` from `dome context current` + `dome gateways list`. Tell the user to run the **API via curl** or **Python** tab from [Verify allow and deny](/tutorials/role/developer#verify-allow-and-deny). Do not execute those calls yourself unless the user asks. ### 6\. Audit [#6-audit] ```bash dome audit query --limit 20 dome audit query --results denied --limit 10 ``` ### 7\. Clean up (optional) [#7-clean-up-optional] ```bash dome workspaces delete studio-role-developer ``` Point next at [Security](/tutorials/role/security) or [Govern your first agent](/tutorials/get-started/govern-your-first-agent). # Operator — agent instructions (/agent/tutorials/role/operator) These are the instructions an AI agent follows to run the [Operator](/tutorials/role/operator) tutorial on your behalf. Read the tutorial instead if you are running the steps yourself. ## Goal [#goal] Create `studio-role-operator`, attach `demo-hr` to Default, register tutorial `role-ops-agent` for a smoke grant, deploy a minimal `list_employees` permit, hand the user one curl/Python smoke call, show audit. ## Rules [#rules] * **Confirm before you start.** Present the plan and wait for proceed. * **Narrate substrate why** (backends, gateway, grants) — not a full developer or security walkthrough. * **Call out scaffolding.** `role-ops-agent` is dedicated for the smoke test, not developer onboarding. * **Confirm the active context.** Confirm workspace starts with `studio-`. * **Never print the agent token.** Write to a gitignored `.env`. * **Hand off verify.** Do not call governed tools yourself to demo. * **Link the console** after create/grant/deploy. Derive base URL from `dome auth status` → `Server`. * **Show evidence.** Never report done without command output. ## Quick setup [#quick-setup] ``` Here's what I'll do for the Operator role tutorial. 1. Provision studio-role-operator 2. Attach demo-hr to Default 3. Register role-ops-agent (scaffolding), grant Default 4. Deploy minimal Cedar for list_employees 5. Hand you one curl/Python smoke call 6. Show audit, then offer clean up Shall I proceed? ``` ## Steps [#steps] ### 1\. Provision workspace [#1-provision-workspace] ```bash dome workspaces create --name studio-role-operator dome context sync dome context current ``` ### 2\. Attach demo-hr [#2-attach-demo-hr] ```bash dome tools add \ --name demo-hr \ --url https://demo-mcp.domesystems.ai/mcp \ --protocol streamable-http \ --auth-method none \ --gateway Default dome gateways get Default ``` ### 3\. Smoke-test agent + grant [#3-smoke-test-agent--grant] ```bash dome agents register --name role-ops-agent --if-not-exists dome agents create-key role-ops-agent --name smoke dome gateways access grant Default role-ops-agent ``` Write token to `.env` only. ### 4\. Minimal Cedar [#4-minimal-cedar] Write and apply `role-ops-agent.cedar` exactly as in the human tutorial (discover + `list_employees` only). ```bash dome rules apply role-ops-agent.cedar --agent role-ops-agent --name role-ops-agent ``` ### 5\. Hand off smoke verify [#5-hand-off-smoke-verify] Collect gateway URL from `dome context current` + `dome gateways list`. Hand the user [Smoke-test the substrate](/tutorials/role/operator#smoke-test-the-substrate). ### 6\. Audit [#6-audit] ```bash dome audit query --limit 10 ``` Mention optional `dome audit stream` for live tail. ### 7\. Clean up (optional) [#7-clean-up-optional] ```bash dome workspaces delete studio-role-operator ``` # Platform Admin — agent instructions (/agent/tutorials/role/platform-admin) These are the instructions an AI agent follows to run the [Platform Admin](/tutorials/role/platform-admin) tutorial on your behalf. Read the tutorial instead if you are running the steps yourself. ## Goal [#goal] Create `studio-role-platform-admin`, list members, optionally assign a role if the user provides a real teammate email, run `dome auth status` and `dome gateways list`, export today's audit (empty OK), offer clean up. ## Rules [#rules] * **Confirm before you start.** Present the plan and wait for proceed. * **Stay in the Manage lane.** No Cedar authoring, no tool attachment. * **Confirm the active context.** Confirm workspace starts with `studio-`. * **Never invent emails.** Ask for a real teammate address or skip `members set`. * **Empty export is success.** A zero-line audit file still proves the pipeline. * **Show evidence.** Never report done without command output. * **Link the console** after membership changes. ## Quick setup [#quick-setup] ``` Here's what I'll do for the Platform Admin role tutorial. 1. Provision studio-role-platform-admin 2. List members 3. Assign a role only if you give me a real teammate email — otherwise skip 4. Run `dome auth status` and `dome gateways list` 5. Export today's audit snapshot 6. Offer clean up Shall I proceed? ``` ## Steps [#steps] ### 1\. Provision workspace [#1-provision-workspace] ```bash dome workspaces create --name studio-role-platform-admin dome context sync dome context current ``` ### 2\. Members [#2-members] ```bash dome workspaces members list ``` If the user provides a real email: ```bash dome workspaces members set --user --role operator ``` Otherwise skip. ### 3\. Health [#3-health] ```bash dome auth status dome gateways list dome audit query --limit 10 ``` ### 4\. Export [#4-export] ```bash dome audit export \ --since "$(date -u +%Y-%m-%dT00:00:00Z)" \ --format jsonl > platform-audit.jsonl ``` ### 5\. Clean up (optional) [#5-clean-up-optional] ```bash dome workspaces delete studio-role-platform-admin ``` # Security — agent instructions (/agent/tutorials/role/security) These are the instructions an AI agent follows to run the [Security](/tutorials/role/security) tutorial on your behalf. Read the tutorial instead if you are running the steps yourself. ## Goal [#goal] Stand up `role-sec-agent` in `studio-role-security`, apply `redact-contact`, deploy restrictive Cedar, hand the user curl/Python verify (allow/redact/deny), then audit query + export. ## Rules [#rules] * **Confirm before you start.** Present the plan and wait for proceed. * **Narrate as you go.** One or two sentences before each step. * **Confirm the active context.** Confirm workspace starts with `studio-`. * **Never print the agent token.** Write to a gitignored `.env`. * **Hand off verify.** Do not call governed tools yourself to demo. * **Link the console** after create/grant/deploy. * **Show evidence.** Never report done without command output. ## Quick setup [#quick-setup] ``` Here's what I'll do for the Security role tutorial. 1. Provision studio-role-security 2. Register role-sec-agent, attach demo-hr, grant Default 3. Create and assign redact-contact Filter 4. Validate, simulate, deploy Cedar (directory allow; salary deny) 5. Hand you curl/Python verify (allow, redact, deny) 6. Audit query + export, then offer clean up Shall I proceed? ``` ## Steps [#steps] ### 1\. Provision workspace [#1-provision-workspace] ```bash dome workspaces create --name studio-role-security dome context sync dome context current ``` ### 2\. Substrate [#2-substrate] ```bash dome agents register --name role-sec-agent --if-not-exists dome agents create-key role-sec-agent --name service ``` Write token to `.env` only. ```bash dome tools add \ --name demo-hr \ --url https://demo-mcp.domesystems.ai/mcp \ --protocol streamable-http \ --auth-method none \ --gateway Default dome gateways access grant Default role-sec-agent ``` ### 3\. Filter [#3-filter] Write `redact-contact.json` and run create + `dome tools guards filters set` exactly as in the human tutorial. ### 4\. Cedar [#4-cedar] Write `role-sec-agent.cedar`, then: ```bash dome rules validate role-sec-agent.cedar dome rules simulate --agent role-sec-agent --action mcp:call \ --resource demo-hr/hr/list_employees --resource-type mcp_tool dome rules simulate --agent role-sec-agent --action mcp:call \ --resource demo-hr/finance/get_salary --resource-type mcp_tool dome rules apply role-sec-agent.cedar --agent role-sec-agent --name role-sec-agent ``` Expect ALLOW then DENY on simulate. ### 5\. Hand off verify [#5-hand-off-verify] Hand the user [Verify allow, redact, and deny](/tutorials/role/security#verify-allow-redact-and-deny). ### 6\. Audit + export [#6-audit--export] ```bash dome audit query --limit 20 dome audit query --results denied --limit 10 dome audit export --since "$(date -u +%Y-%m-%dT00:00:00Z)" --format jsonl > security-audit.jsonl ``` ### 7\. Clean up (optional) [#7-clean-up-optional] ```bash dome workspaces delete studio-role-security ``` # Code Execution Agent (/tutorials/examples/use-cases/code-agent) A code execution agent generates code from natural language and runs it in an isolated execution environment. The risk profile is unlike a traditional application: the agent decides what to write and execute, the "threat actor" and "authorized user" can be the same process, and static analysis doesn't apply to code that doesn't exist yet. Governance treats every execution as a first-class, authorizable event. The gateway restricts which tools the agent can call, Cedar rules bound the surfaces it can reach, response filtering strips sensitive data before it flows back to the model, and every call lands in an immutable audit trail. ## Threat Model [#threat-model] | Threat | Description | | -------------------------------- | -------------------------------------------------------------------------------------------------- | | **Arbitrary code execution** | The agent generates and runs malicious or unintended code that escapes the isolation boundary | | **Data exfiltration via output** | Code output contains file paths, credentials, environment variables, or internal network addresses | | **Resource exhaustion** | Generated code consumes unbounded CPU, memory, or disk, affecting other workloads | | **Unauthorized system access** | The agent accesses filesystem, network, or database resources outside its intended scope | ## Governance Approach [#governance-approach] | Threat | Dome Capability | How It Helps | | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | | Arbitrary code execution | [Register](/build/agents/external#register-agent) with allowed tools, [Authorize](/govern/rules) | Allow only the code-execution tool, so no other tool is reachable | | Data exfiltration via output | [Guards](/govern/guards) | Classify output fields containing paths and credentials, redact before returning to the agent | | Resource exhaustion | [Register](/build/agents/external#register-agent) with allowed tools, [Pass identity for delegated agents](/develop#pass-identity-for-delegated-agents) | Enforce tool-level authorization so the agent cannot invoke resource-intensive tools | | Unauthorized system access | [Authorize](/govern/rules), [Stream Live Events](/operate/observe) | Forbid access to production and database tools, audit every tool call for anomaly detection | ## Implementation [#implementation] 1. **Register the agent** Register the code execution agent and label its trust tier. The `tier` metadata is what the rules below test: ```bash dome agents register \ --name "code-exec-agent" \ --metadata tier=isolated ``` Once the code-execution backend exists, allow it on the agent with `dome agents update code-exec-agent --tool code-execution/run`. 2. **Configure the code-execution backend** Add the isolated code-execution environment as a backend with field classifications on sensitive output fields: ```bash dome tools add \ --name "code-execution" \ --url "https://executor.internal:8443" \ --protocol streamable-http \ --field-classification output_paths=SENSITIVE,env_vars=SENSITIVE,stderr=PII \ --gateway Default ``` `--gateway` makes the connection reachable through a [Gateway](/build/gateways); the agent also needs a [grant](/build/gateways#manage-agent-access) to that gateway. 3. **Define Cedar authorization rules** Write rules that permit the agent to call only code-execution tools and forbid access to production infrastructure: ```bash dome rules validate code-exec-rules.cedar dome rules apply code-exec-rules.cedar --name "code-exec-policy" ``` See the [Policy Example](#policy-example) below for the Cedar rule content. 4. **Simulate before deploying** Test the rules against historical events to verify they do not break existing workflows: ```bash dome rules simulate code-exec-rules.cedar ``` Review the DecisionDiffs to confirm that only the intended changes occur. 5. **Enable audit streaming** Stream audit events for real-time monitoring of code execution activity: ```bash dome audit stream --agent code-exec-agent ``` Every tool call, authorization decision, and field redaction action appears in the audit stream. ## Policy Example [#policy-example] ```cedar title="code-exec-rules.cedar" // Permit the code execution agent to call the code-execution tool permit( principal == Dome::Agent::"code-exec-agent", action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"code-execution/run" ); // Permit the agent to discover available tools permit( principal == Dome::Agent::"code-exec-agent", action == Dome::Action::"mcp:discover", resource ); // Keep every isolated-tier agent off production deploys, not just this one. forbid( principal, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"deployment/production-deploy" ) when { principal has metadata && principal.metadata has tier && principal.metadata.tier == "isolated" }; // Prevent the code execution agent from writing to databases. forbid( principal == Dome::Agent::"code-exec-agent", action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"database/write" ); ``` > **Note**: Cedar evaluates all rules against every request. If any `forbid` matches, the request is denied regardless of `permit` rules. The default decision when no rule matches is deny. ## Next steps [#next-steps] * [Authorize Access](/govern/rules) to write and deploy Cedar * [Tools](/connect/tools) to attach code-execution environments and catalogs * [Multi-Adapter Tools Agent](/tutorials/examples/use-cases/tools-agent) for multiple tool adapters * [Develop](/develop) to authenticate and route runtime traffic # Knowledge Base Agent (/tutorials/examples/use-cases/knowledge-agent) A knowledge base agent answers questions from a mix of sources — each end user's own documents (Notion, Google Drive, personal Confluence) and shared company-wide content (internal wikis, public runbooks). The same agent identity serves many users, and every read against a personal source must be scoped to the calling user's data while shared sources stay pooled. Governance binds every call to a verified end-user identity, then splits backend authentication by source type. Per-user OAuth backends route each call with the calling user's own upstream token, so per-user authorization is delegated to the upstream service. Shared backends use a single workspace credential for content the whole workspace should see. Cedar rules stay coarse-grained at the agent and backend level, field classifications redact sensitive document metadata before it reaches the model, and the audit trail captures both agent and end-user identity on every call. ## Threat Model [#threat-model] | Threat | Description | | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | **Cross-user data leakage** | The agent uses one user's credentials — or workspace-pooled credentials — to fetch another user's documents | | **Sensitive content surfacing through model context** | Documents returned to the agent contain PII, secrets, or financial data that bleed into the model's context window or outputs | | **Unauthorized backend access** | The agent reaches knowledge bases it should not query, or attempts write operations on a read-only role | | **Missing user attribution in audit** | Audit captures the agent identity but not which end user triggered the read, breaking compliance review | ## Governance Approach [#governance-approach] | Threat | Dome Capability | How It Helps | | --------------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Cross-user data leakage | [Authenticate Identities](/develop#authenticate), [Attach Backends](/connect/tools#add-tool) | `--actas-required` on the agent forces every call to carry verified user identity; per-user OAuth backends route each call with that user's upstream token, so the upstream enforces per-user data access | | Sensitive content surfacing | [Guards](/govern/guards) | Field classifications on document metadata redact PII and SECRET fields before the response reaches the agent | | Unauthorized backend access | [Authorize](/govern/rules) | Cedar rules pin the agent to specific knowledge backends and forbid write operations | | Missing user attribution | [Stream Live Events](/operate/observe), [Audit and Export](/operate/audit) | Every audit event captures both agent and act-as identities; per-user backend events (`connection.credentiallink.issue`, `connection.credentiallink.consume`, and `connection.consent.grant`) trace provisioning history per user | ## Implementation [#implementation] 1. **Register the agent with required act-as identity** Register the agent so every request must carry a verified end-user identity. The `access_scope` label is metadata the rules in step 4 read: ```bash dome agents register \ --name "knowledge-agent" \ --metadata access_scope=knowledge-read \ --actas-method oidc \ --actas-provider vp_workspace_oidc \ --actas-required ``` With `--actas-required`, the gateway rejects any tool call without a verified act-as token. The per-user OAuth flow in step 2 keys credentials off this same act-as `sub`. Once the backends exist, allow them on the agent with `dome agents update knowledge-agent --tool notion-personal/search --tool company-wiki/search`. > **Note**: `vp_workspace_oidc` is a placeholder ID for a [workspace verification provider](/build/agents/delegated#create-a-verification-provider). Create one for your IdP and pass its returned ID, or skip the provider step and inline the discovery URL on the agent with `--actas-oidc-url `. 2. **Configure a per-user OAuth backend for personal knowledge bases** Add the personal knowledge base as a per-user OAuth backend. Each end user provisions their own upstream credential through a magic-link flow on first use — the gateway never holds a single shared credential that could span users: ```bash dome tools add \ --name "notion-personal" \ --url "https://api.notion.com" \ --protocol streamable-http \ --auth-method oauth \ --credential-type per-user \ --oauth-authorize-url "https://api.notion.com/v1/oauth/authorize" \ --oauth-token-url "https://api.notion.com/v1/oauth/token" \ --oauth-client-id "$NOTION_CLIENT_ID" \ --oauth-client-secret "$NOTION_CLIENT_SECRET" \ --oauth-default-scope "read_content" \ --field-classification author_email=PII,owner_email=PII,page_content=SENSITIVE ``` On the first call from a new user, the gateway returns a `401` with a magic-link `provision_url`. The user opens it, completes Notion's OAuth consent against their own account, and the next `tools/list` reflects their newly provisioned backend. 3. **Configure a shared backend for company-wide knowledge** Add the shared internal wiki as a shared OAuth backend. One operator-supplied credential serves every caller — appropriate for content the whole workspace should see: ```bash dome tools add \ --name "company-wiki" \ --url "https://wiki.internal:8443" \ --protocol streamable-http \ --auth-method api-key \ --credential-type shared \ --authorization "Bearer $WIKI_TOKEN" \ --field-classification author_email=PII \ --gateway Default ``` 4. **Define agent-level Cedar rules** Write authorization rules that key off the agent identity and act-as presence — not per-user identity. Per-user authorization is delegated to the upstream service via the per-user OAuth credential: ```bash dome rules validate knowledge-agent-rules.cedar dome rules apply knowledge-agent-rules.cedar --name "knowledge-agent-policy" ``` See the [Policy Example](#policy-example) below for the Cedar rule content. 5. **Simulate the rules** Test rules against historical events before deploying: ```bash dome rules simulate knowledge-agent-rules.cedar ``` Verify that requests without an act-as token are denied for the personal backend and that write operations are universally forbidden. 6. **Monitor provisioning and access patterns** Stream audit events to watch both per-user provisioning health and read activity: ```bash dome audit stream --agent knowledge-agent ``` Look for `connection.credentiallink.issue` (a user hit the magic-link flow), `connection.consent.grant` (a user successfully provisioned), `connection.credential.refresh` with an `error` (a user's token needs re-consent), and `tool.call` events to see read patterns per user. ## Policy Example [#policy-example] ```cedar title="knowledge-agent-rules.cedar" // Permit reads from personal knowledge bases only when act-as identity is present. // Per-user authorization is enforced upstream via the per-user OAuth credential. permit( principal == Dome::Agent::"knowledge-agent", action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"notion-personal" ) when { principal has act_as }; // Permit reads from the shared company wiki for any authenticated request. permit( principal == Dome::Agent::"knowledge-agent", action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"company-wiki" ); // Forbid any tool with SENSITIVE classifications when act-as identity is missing. forbid( principal == Dome::Agent::"knowledge-agent", action == Dome::Action::"mcp:call", resource ) when { resource.field_classifications.contains("SENSITIVE") && !(principal has act_as) }; // Forbid write and delete for every read-only agent, this one included. forbid( principal, action == Dome::Action::"mcp:call", resource ) when { principal has metadata && principal.metadata has access_scope && principal.metadata.access_scope == "knowledge-read" && (context.method == "write" || context.method == "delete") }; // Permit tool discovery so the agent sees its provisioned backends. permit( principal == Dome::Agent::"knowledge-agent", action == Dome::Action::"mcp:discover", resource ); ``` > **Note**: Per-user OAuth keeps Cedar rules coarse-grained. The upstream service decides which documents the calling user can see, because the gateway forwards the user's own access token. Cedar's job is to gate which backends the agent can reach and to block reads when the user identity is missing — not to enumerate per-user document permissions. ## Next steps [#next-steps] * [Authorize Access](/govern/rules) to write and deploy Cedar * [Tools](/connect/tools) to attach retrieval backends * [Code Execution Agent](/tutorials/examples/use-cases/code-agent) for workspace execution * [Audit events](/operate/audit) to verify retrieval and denials # Multi-Adapter Tools Agent (/tutorials/examples/use-cases/tools-agent) A multi-adapter tools agent reaches several backends through the gateway — CRM, analytics, payments, internal APIs. Each backend has different sensitivity, authentication, and compliance posture, so a single compromise cascades across services. Governance treats every backend as its own authorizable surface with its own policy. Per-backend Cedar rules grant narrow, named access to the exact tools the agent needs on each service. Act-as identity propagates end-to-end, so backends authorize the real user, not the bot. Field classifications travel with each backend, and every cross-service call lands in a unified audit trail. ## Threat Model [#threat-model] | Threat | Description | | ---------------------------------------- | -------------------------------------------------------------------------------------------------- | | **Over-privileged tool access** | The agent has broader access than it needs, reaching backends it should never call | | **Credential leakage between backends** | A vulnerability in one backend exposes credentials for another through shared agent context | | **Unauthorized cross-service data flow** | The agent reads from a sensitive backend and writes that data to a less-secured one | | **Backend configuration drift** | Backend credentials or field classifications fall out of sync with actual service security posture | ## Governance Approach [#governance-approach] | Threat | Dome Capability | How It Helps | | ------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | | Over-privileged tool access | [Authorize](/govern/rules), [Pass identity for delegated agents](/develop#pass-identity-for-delegated-agents) | Per-backend Cedar rules grant only the specific tools each agent needs | | Credential leakage between backends | [Attach Backends](/connect/tools#add-tool), [Route Traffic](/develop#route-traffic) | The gateway manages credentials per-backend — agents never see backend credentials | | Unauthorized cross-service data flow | [Guards](/govern/guards), [Authenticate Identities](/develop#authenticate) | Field classifications prevent sensitive data from leaving its backend, act-as identity enforces user-level access | | Backend configuration drift | [Stream Live Events](/operate/observe), [Audit and Export](/operate/audit) | Audit trail captures every backend interaction for drift detection and compliance review | ## Implementation [#implementation] 1. **Register the agent with required act-as identity** Register the agent and label the service domains it serves. The `service_domain` metadata is what the rules in step 3 read: ```bash dome agents register \ --name "multi-tools-agent" \ --metadata service_domain=revenue \ --actas-method oidc \ --actas-provider vp_workspace_oidc \ --actas-required ``` Setting `--actas-required` ensures every request carries end-user identity. The gateway rejects requests without a valid act-as header. Once the backends exist, allow them on the agent with `dome agents update multi-tools-agent --tool analytics-api/query --tool crm-api/lookup --tool payments-api/read`. > **Note**: `vp_workspace_oidc` is a placeholder ID for a [workspace verification provider](/build/agents/delegated#create-a-verification-provider). Create one for your IdP and pass its returned ID, or skip the provider step and inline the discovery URL on the agent with `--actas-oidc-url `. 2. **Configure backends with field classifications** Add each backend with its own credentials and field classifications: ```bash # Analytics backend — read-only, no sensitive fields. --gateway # makes each connection reachable; the agent also needs a grant to the Gateway # (see /build/gateways#add-resource-memberships). dome tools add \ --name "analytics-api" \ --url "https://analytics.internal:8443" \ --protocol streamable-http \ --auth-method api-key \ --credential-type shared \ --authorization "Bearer $ANALYTICS_TOKEN" \ --gateway Default # CRM backend — contains PII, requires identity forwarding dome tools add \ --name "crm-api" \ --url "https://crm.internal:8443" \ --protocol streamable-http \ --header-actas "X-Dome-Act-As" \ --auth-method api-key \ --credential-type shared \ --authorization "Bearer $CRM_TOKEN" \ --field-classification email=PII,phone=PII,address=PII \ --gateway Default # Payment backend — highly sensitive dome tools add \ --name "payments-api" \ --url "https://payments.internal:8443" \ --protocol streamable-http \ --auth-method api-key \ --credential-type shared \ --authorization "Bearer $PAYMENTS_TOKEN" \ --field-classification card_number=SENSITIVE,account_id=SENSITIVE \ --gateway Default ``` 3. **Define per-backend Cedar rules** Write authorization rules that grant different access levels per backend: ```bash dome rules validate multi-tools-rules.cedar dome rules apply multi-tools-rules.cedar --name "multi-tools-policy" ``` See the [Policy Example](#policy-example) below for the Cedar rule content. 4. **Simulate the rules** Verify the rules against historical events before they take effect: ```bash dome rules simulate multi-tools-rules.cedar ``` 5. **Monitor cross-backend activity** Stream audit events filtered to the agent to watch for unexpected cross-service access patterns: ```bash dome audit stream --agent multi-tools-agent ``` ## Policy Example [#policy-example] ```cedar title="multi-tools-rules.cedar" // Permit the registered agent read-only access to analytics tools. permit( principal == Dome::Agent::"multi-tools-agent", action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"analytics-api" ) when { context.method == "read" }; // Permit CRM access only when act-as identity is present permit( principal == Dome::Agent::"multi-tools-agent", action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"crm-api" ) when { principal has act_as }; // Forbid CRM write operations unless act-as identity has the editor role forbid( principal, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"crm-api" ) when { context.method == "write" && !(principal.act_as.roles.contains("editor")) }; // Permit the registered agent read-only access to payments. permit( principal == Dome::Agent::"multi-tools-agent", action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"payments-api" ) when { context.method == "read" }; // Forbid all write operations on payments forbid( principal, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"payments-api" ) when { context.method == "write" }; // Keep the CRM closed to any agent outside the revenue domain. forbid( principal, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"crm-api" ) unless { principal has metadata && principal.metadata has service_domain && principal.metadata.service_domain == "revenue" }; // Permit tool discovery so the agent sees its available tools permit( principal == Dome::Agent::"multi-tools-agent", action == Dome::Action::"mcp:discover", resource ); ``` > **Warning**: The payment backend rules demonstrate defense in depth: the `forbid` on write operations applies even when a permit matches. Layer forbid rules to create hard boundaries that no permit can bypass. ## Next steps [#next-steps] * [Adapters](/sdks/python/adapters) for framework wrappers * [Tools](/connect/tools) to attach catalogs and credentials * [Gateways](/build/gateways) for membership and grants * [Authorize Access](/govern/rules) to permit and forbid tool calls # Deploy an always-on agent (/tutorials/production/deploy-your-agent/always-on) An always-on agent has an address. A person, webhook, or application sends it a request; the service decides what work to do and answers on that request's timeline. It must be ready for concurrent traffic, expose health separately from work, and survive instances being replaced underneath it. This lab builds an incident-desk API. Each `POST /incidents` request makes one governed tool call through Dome and returns the result. You will containerize it, keep its agent key in a secret manager, deploy it as a private HTTP service, invoke it, and find the call in Audit. Deploy the always-on incident-desk agent from this lab. First, show me this plan and ask me to confirm before running anything: 1. Confirm my Dome and Google Cloud accounts and choose a workspace, project, and region 2. Create the incident-desk app exactly as documented and run it locally 3. Attach the public demo operations server to Dome 4. Register `incident-desk-api`, deploy its one-tool Cedar boundary, and create its API key 5. Build the container and push it to Artifact Registry 6. Put the agent key in Secret Manager and deploy a private Cloud Run service 7. Invoke `/health` and `/incidents`, then show the matching Dome audit event 8. Deploy a second revision, show the rollback command, and clean up only after I confirm Follow the commands at [https://docs.domesystems.ai/agent/tutorials/production/deploy-your-agent/always-on.md](https://docs.domesystems.ai/agent/tutorials/production/deploy-your-agent/always-on.md) exactly. Non-negotiable rules: * Work in a Dome workspace and a non-production Google Cloud project. Show both before changing anything. * Never print or commit `DOME_AGENT_API_KEY`. Read it silently and write it directly to Secret Manager. * Keep the Cloud Run service private. Do not use `--allow-unauthenticated`. * Do not put the agent key in the image, Docker build arguments, ordinary environment variables, source, or logs. * Keep `/health` independent of Dome and the upstream tool. A dependency outage must not make the process fail its liveness check. * Do not widen Cedar when a call fails. Diagnose the deployment, credential exchange, gateway grant, and rule separately. * Use an immutable image tag derived from the Git commit. Do not deploy `latest`. * Never report a step as done without showing the non-secret command output. At the end, explain which parts belong to the always-on operating model and which commands are specific to Cloud Run. To do this, you will: 1. **Build the HTTP process**: Create a health endpoint and a request handler that makes one governed tool call. 2. **Provision the agent**: Give the process one identity and one allowed tool. 3. **Build the image**: Produce an immutable container and push it to a registry. 4. **Inject the credential**: Store the long-lived agent key outside the image. 5. **Deploy and invoke**: Run the private service, send a request, and inspect Audit. 6. **Roll back and clean up**: Prove the service can move between revisions without changing its Dome identity. ## Why this application stays available [#why-this-application-stays-available] The incident desk answers requests initiated by another system. It cannot know when the next request will arrive, and the caller expects an HTTP response. That makes a request-serving process the right shape: * start once and listen on `$PORT` * handle more than one request per process * keep request state local and short-lived * keep durable state in external systems * expose a cheap liveness endpoint * expect instances to start, stop, and overlap during rollout Cloud Run may scale the service to zero between requests. “Always-on” here describes the application contract—an address that accepts requests—not a promise that one VM runs forever. ## What the deployment receives [#what-the-deployment-receives] The deployment target never receives a GitHub token, model key, or tool credential. It receives: * a long-lived `DOME_AGENT_API_KEY` stored in the platform's secret manager * `DOME_CONTROL_PLANE`, used to exchange that key for a short-lived token * `DOME_GATEWAY_MCP_URL`, where the application calls its governed tools The application image contains no secrets. Dome keeps the tool credential at the gateway, enforces the same Cedar rule regardless of runtime, and records the resulting calls in Audit. ## When event-driven fits better [#when-event-driven-fits-better] Deployment starts with the process shape, not the platform. This lab is for an agent that keeps an address and answers on a request timeline: | | Always-on (this lab) | Event-driven | | ------------- | ----------------------------------------- | -------------------------------------- | | Starts when | An HTTP request arrives | A schedule or event fires | | Process shape | Web server listening on `$PORT` | Handler called with one event | | Finishes when | The service is replaced or scaled down | The event is complete | | State | Externalize it; instances are replaceable | Treat each invocation as independent | | Retries | Client/load balancer behavior | Trigger retry and dead-letter behavior | | Concurrency | Multiple requests may share an instance | Multiple invocations may overlap | If the agent should wake for a schedule or queue message, finish one bounded job, and exit, use [Deploy an event-driven agent](/tutorials/production/deploy-your-agent/event-driven) instead. > **Note**: This lab uses [Google Cloud Run](https://docs.cloud.google.com/run/docs/deploying) to make the steps executable. The same process can run on [Amazon ECS Express Mode](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-express-mode.html), [Azure Container Apps](https://learn.microsoft.com/azure/container-apps/overview), [Fly.io](https://fly.io/docs/launch/), or [Render](https://render.com/docs/web-services). Translate the registry, secret, service, and identity commands; keep the process contract and Dome configuration. ## Prerequisites [#prerequisites] You will need: * Docker with Buildx * the [Google Cloud CLI](https://cloud.google.com/sdk/docs/install), authenticated with `gcloud auth login` * a non-production Google Cloud project where you may use Cloud Build, Artifact Registry, Secret Manager, IAM, and Cloud Run * the Dome CLI, signed in as a tenant `admin` (or org `owner` / `admin`) with permission to attach a tool, register an agent, and deploy rules Set the Google Cloud values used throughout: ```bash export PROJECT_ID="" export REGION="us-central1" export REPOSITORY="agent-labs" export SERVICE="incident-desk" export SERVICE_ACCOUNT="incident-desk" gcloud config set project "$PROJECT_ID" gcloud auth list ``` Confirm the project is not production before continuing. ## Build the HTTP process [#build-the-http-process] Create an empty project: ```bash mkdir incident-desk cd incident-desk ``` Create the dependencies: ```text title="requirements.txt" fastapi httpx uvicorn ``` Create `app.py`. The application exchanges its long-lived agent API key for a short-lived bearer token on each request, then calls one MCP tool through its gateway: ```python title="app.py" import json import os import httpx from fastapi import FastAPI, HTTPException app = FastAPI() CONTROL_PLANE = os.environ["DOME_CONTROL_PLANE"].rstrip("/") GATEWAY_MCP_URL = os.environ["DOME_GATEWAY_MCP_URL"] AGENT_API_KEY = os.environ["DOME_AGENT_API_KEY"] def exchange_token() -> str: response = httpx.post( f"{CONTROL_PLANE}/dome.identity.v1.Identity/ExchangeToken", json={"grantType": "api_key", "apiKey": AGENT_API_KEY}, headers={"Content-Type": "application/json"}, timeout=10, ) response.raise_for_status() return response.json()["accessToken"] def parse_mcp(response: httpx.Response) -> dict: if "text/event-stream" not in response.headers.get("content-type", ""): return response.json() for line in response.text.splitlines(): if line.startswith("data:"): message = json.loads(line[5:].strip()) if "result" in message or "error" in message: return message raise ValueError("MCP stream ended without a response") def call_incident_tool() -> dict: response = httpx.post( GATEWAY_MCP_URL, json={ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "demo-ops/it/get_incidents", "arguments": {}, }, }, headers={ "Authorization": f"Bearer {exchange_token()}", "Content-Type": "application/json", "Accept": "application/json, text/event-stream", }, timeout=20, ) response.raise_for_status() return parse_mcp(response) @app.get("/health") def health() -> dict: return {"status": "ok"} @app.post("/incidents") def incidents() -> dict: try: result = call_incident_tool() except (httpx.HTTPError, KeyError, ValueError) as exc: raise HTTPException(status_code=502, detail="governed tool call failed") from exc if "error" in result: raise HTTPException(status_code=403, detail=result["error"]) return result["result"] ``` `/health` proves only that the process can answer. It deliberately does not exchange a token or call the tool; liveness checks should not generate agent activity or restart a healthy process because one dependency is down. Create the container: ```dockerfile title="Dockerfile" FROM python:3.13-slim ENV PYTHONUNBUFFERED=1 WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY app.py . CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port ${PORT:-8080}"] ``` Exclude local credentials and build output: ```text title=".dockerignore" .git .env .venv __pycache__ *.pyc ``` ## Provision the agent [#provision-the-agent] Create a Dome workspace for the deployed service: ```bash dome workspaces create --name studio-deploy-http dome context sync dome context current ``` Stop if the workspace does not start with `studio-`. Attach the public demo backend: ```bash dome tools add \ --name demo-ops \ --url https://demo-mcp.domesystems.ai/mcp \ --protocol streamable-http \ --auth-method none \ --gateway Default ``` Register the workload identity and admit it to the Default gateway: ```bash dome agents register --name incident-desk-api --if-not-exists dome gateways access grant Default incident-desk-api ``` Create `incident-desk.cedar`. Discovery and one incident read are allowed; everything else is forbidden: ```cedar title="incident-desk.cedar" permit( principal is Dome::Agent, action == Dome::Action::"mcp:discover", resource ); permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"demo-ops/it/get_incidents" ); forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) unless { resource == Dome::MCPTool::"demo-ops/it/get_incidents" }; ``` Deploy and simulate it: ```bash dome rules apply incident-desk.cedar \ --agent incident-desk-api \ --name incident-desk-api dome rules simulate --agent incident-desk-api --action mcp:call \ --resource demo-ops/it/get_incidents --resource-type mcp_tool dome rules simulate --agent incident-desk-api --action mcp:call \ --resource demo-ops/finance/get_salary --resource-type mcp_tool ``` Expect `ALLOW`, then `DENY`. Create the long-lived API key. It is an exchange credential, not a bearer token to send directly to the gateway: ```bash dome agents create-key incident-desk-api --name cloud-run ``` Keep the one-time `Token: ...` value available for the Secret Manager step without saving it in source. Read the control-plane and gateway endpoints: ```bash dome auth status dome agents get incident-desk-api --gateway Default ``` Set: ```bash export DOME_CONTROL_PLANE="https://api.domesystems.ai" export DOME_GATEWAY_MCP_URL="https:///gateways//mcp" ``` Use the server and gateway returned by your active environment rather than these example hosts when they differ. ## Test the container locally [#test-the-container-locally] Read the API key without echoing it: ```bash read -rsp "Dome agent API key: " DOME_AGENT_API_KEY echo ``` Build and run: ```bash docker build -t incident-desk:local . docker run --rm -p 8080:8080 \ -e DOME_AGENT_API_KEY \ -e DOME_CONTROL_PLANE \ -e DOME_GATEWAY_MCP_URL \ incident-desk:local ``` In another terminal: ```bash curl --fail http://localhost:8080/health curl --fail -X POST http://localhost:8080/incidents ``` The first call returns `{"status":"ok"}` and creates no Dome activity. The second returns incident data and records a `tool.call`. ## Build and push the image [#build-and-push-the-image] Enable the APIs and create an Artifact Registry repository: ```bash gcloud services enable \ artifactregistry.googleapis.com \ cloudbuild.googleapis.com \ run.googleapis.com \ secretmanager.googleapis.com gcloud artifacts repositories create "$REPOSITORY" \ --repository-format=docker \ --location="$REGION" \ --description="Dome agent lab images" ``` Use an immutable tag: ```bash export IMAGE_TAG="$(git rev-parse --short HEAD 2>/dev/null || date +%Y%m%d%H%M%S)" export IMAGE="$REGION-docker.pkg.dev/$PROJECT_ID/$REPOSITORY/$SERVICE:$IMAGE_TAG" gcloud builds submit --tag "$IMAGE" . ``` The image contains code and dependency metadata only. `DOME_AGENT_API_KEY` was runtime input and never entered the build context. ## Store the agent key [#store-the-agent-key] Create a dedicated runtime service account: ```bash gcloud iam service-accounts create "$SERVICE_ACCOUNT" \ --display-name="Incident desk Cloud Run service" export SERVICE_ACCOUNT_EMAIL="$SERVICE_ACCOUNT@$PROJECT_ID.iam.gserviceaccount.com" ``` Write the key directly from the shell variable into Secret Manager: ```bash printf '%s' "$DOME_AGENT_API_KEY" | \ gcloud secrets create incident-desk-agent-key --data-file=- unset DOME_AGENT_API_KEY ``` Allow only the runtime identity to read it: ```bash gcloud secrets add-iam-policy-binding incident-desk-agent-key \ --member="serviceAccount:$SERVICE_ACCOUNT_EMAIL" \ --role="roles/secretmanager.secretAccessor" ``` ## Deploy and invoke [#deploy-and-invoke] Deploy a private service from the immutable image: ```bash gcloud run deploy "$SERVICE" \ --image="$IMAGE" \ --region="$REGION" \ --service-account="$SERVICE_ACCOUNT_EMAIL" \ --set-secrets="DOME_AGENT_API_KEY=incident-desk-agent-key:1" \ --set-env-vars="DOME_CONTROL_PLANE=$DOME_CONTROL_PLANE,DOME_GATEWAY_MCP_URL=$DOME_GATEWAY_MCP_URL" \ --no-allow-unauthenticated ``` Get its URL: ```bash export SERVICE_URL="$( gcloud run services describe "$SERVICE" \ --region="$REGION" \ --format='value(status.url)' )" ``` Invoke it with your Google identity: ```bash export GOOGLE_ID_TOKEN="$(gcloud auth print-identity-token)" curl --fail \ -H "Authorization: Bearer $GOOGLE_ID_TOKEN" \ "$SERVICE_URL/health" curl --fail -X POST \ -H "Authorization: Bearer $GOOGLE_ID_TOKEN" \ "$SERVICE_URL/incidents" ``` If Cloud Run returns `403`, your Google identity needs `roles/run.invoker` on this service. Do not make the service public to bypass that boundary. Inspect the service logs without exposing the secret: ```bash gcloud run services logs read "$SERVICE" \ --region="$REGION" \ --limit=20 ``` Then inspect the governed call: ```bash dome audit query --types tool.call --limit 10 ``` The Cloud Run request log proves the HTTP process ran. The Dome event proves `incident-desk-api` called `demo-ops/it/get_incidents` through its one-tool boundary. You need both records to investigate the full request. ## Roll out and roll back [#roll-out-and-roll-back] Each Cloud Run deploy creates a revision. Make a harmless response change, build a second immutable tag, and deploy it with the same service account, secret, and Dome endpoints. List revisions: ```bash gcloud run revisions list \ --service="$SERVICE" \ --region="$REGION" ``` To roll all traffic back: ```bash gcloud run services update-traffic "$SERVICE" \ --region="$REGION" \ --to-revisions="=100" ``` The revision changes the code carrying the agent. It does not create another Dome agent or widen its rule. Stable identity across replaceable revisions is the deployment property this lab is proving. **Troubleshooting** * The container exits immediately. Confirm it listens on `0.0.0.0:$PORT`. Binding only to localhost makes it unreachable from Cloud Run. * `/health` works but `/incidents` returns `502`. Read the Cloud Run logs, then check `DOME_CONTROL_PLANE` and `DOME_GATEWAY_MCP_URL`. Confirm the service account can read secret version `1`. * Token exchange returns `401`. The stored API key is wrong or revoked. Rotate it in Dome, add a new Secret Manager version, deploy a revision pinned to that version, verify it, then disable the old version. * The gateway returns a policy denial. Simulate `demo-ops/it/get_incidents` for `incident-desk-api`. Do not grant every tool or remove the closing forbid. * Multiple requests overlap. That is normal for an HTTP service. Keep request state inside the handler, avoid mutable module-level request data, and make downstream operations safe to retry. ## Clean up [#clean-up] Delete the deployment first, then the secret and image repository: ```bash gcloud run services delete "$SERVICE" --region="$REGION" gcloud secrets delete incident-desk-agent-key gcloud artifacts repositories delete "$REPOSITORY" --location="$REGION" gcloud iam service-accounts delete "$SERVICE_ACCOUNT_EMAIL" ``` Delete the Dome workspace: ```bash dome workspaces delete studio-deploy-http ``` ## Next steps [#next-steps] You deployed a request-serving agent whose code is replaceable, identity is stable, credential is external to the image, and tool boundary is enforced at the gateway. * [Deploy an event-driven agent](/tutorials/production/deploy-your-agent/event-driven) to build a handler that runs once and exits * [Govern callers with OIDC](/tutorials/production/govern-callers-with-oidc) when the agent acts for a signed-in person # Deploy an event-driven agent (/tutorials/production/deploy-your-agent/event-driven) An event-driven agent has no address of its own. A scheduler, queue, or event bus supplies one unit of work; the runtime starts a handler, the handler finishes that work, and the invocation ends. Retries and concurrency belong to the trigger rather than to an HTTP client waiting for a response. This lab builds an incident-digest handler. Each event makes one governed tool call, writes a structured result, and returns. You will package it as a Lambda container, keep its agent key in Secrets Manager, invoke it manually, attach an EventBridge schedule, and find the call in Dome Audit. Deploy the event-driven incident-digest agent from this lab. First, show me this plan and ask me to confirm before running anything: 1. Confirm my Dome and AWS accounts and choose a workspace and region 2. Create the incident-digest handler exactly as documented and invoke its container locally 3. Attach the public demo operations server to Dome 4. Register `incident-digest-job`, deploy its one-tool Cedar boundary, and create its API key 5. Build the Lambda container and push it to ECR 6. Put the agent key in Secrets Manager and create a least-privilege Lambda role 7. Deploy the function and invoke it once with a test event 8. Show the CloudWatch result and matching Dome audit event 9. Add a disabled EventBridge schedule, inspect it, then enable it after I confirm 10. Disable the schedule before cleanup Follow the commands at [https://docs.domesystems.ai/agent/tutorials/production/deploy-your-agent/event-driven.md](https://docs.domesystems.ai/agent/tutorials/production/deploy-your-agent/event-driven.md) exactly. Non-negotiable rules: * Work in a Dome workspace and a non-production AWS account. Show both before changing anything. * Never print or commit `DOME_AGENT_API_KEY`. Read it silently and write it directly to Secrets Manager. * Do not put the agent key in the image, Docker build arguments, Lambda environment variables, source, event payload, or logs. * Keep the handler bounded: one event, one governed read, one structured result, then return. * Treat delivery as at least once. Do not add a write action unless it has an idempotency key. * Create the schedule disabled, show me its target and payload, and wait before enabling it. * Do not widen Cedar when a call fails. * Tag the image immutably and deploy by image digest or immutable tag, never `latest`. * Never report a step as done without showing non-secret command output. At the end, explain which parts belong to the event-driven operating model and which commands are specific to Lambda and EventBridge. To do this, you will: 1. **Build the handler**: Accept one event, make one governed call, emit one result, and return. 2. **Provision the agent**: Give the job one identity and one allowed tool. 3. **Build the function image**: Package the handler with the Lambda runtime interface. 4. **Inject the credential**: Let the function identity read one secret. 5. **Invoke and verify**: Send a test event and correlate CloudWatch with Dome Audit. 6. **Attach the schedule**: Add the production trigger only after the handler works in isolation. ## Why this application exits [#why-this-application-exits] The incident digest has no user waiting on an HTTP response. It runs because an event says “produce the digest now.” The handler should: * take all input from the event and configuration * finish one bounded unit of work * emit structured output * return success or raise an error * tolerate the same event arriving again * assume another invocation can overlap It should not start a web server, wait between runs, or contain its own scheduler. Those responsibilities belong to the runtime and trigger. ## What the deployment receives [#what-the-deployment-receives] The deployment target never receives a GitHub token, model key, or tool credential. It receives: * a long-lived `DOME_AGENT_API_KEY` stored in the platform's secret manager * `DOME_CONTROL_PLANE`, used to exchange that key for a short-lived token * `DOME_GATEWAY_MCP_URL`, where the application calls its governed tools The application image contains no secrets. Dome keeps the tool credential at the gateway, enforces the same Cedar rule regardless of runtime, and records the resulting calls in Audit. ## When always-on fits better [#when-always-on-fits-better] Deployment starts with the process shape, not the platform. This lab is for an agent that wakes for one event, finishes bounded work, and exits: | | Event-driven (this lab) | Always-on | | ------------- | -------------------------------------- | ----------------------------------------- | | Starts when | A schedule or event fires | An HTTP request arrives | | Process shape | Handler called with one event | Web server listening on `$PORT` | | Finishes when | The event is complete | The service is replaced or scaled down | | State | Treat each invocation as independent | Externalize it; instances are replaceable | | Retries | Trigger retry and dead-letter behavior | Client/load balancer behavior | | Concurrency | Multiple invocations may overlap | Multiple requests may share an instance | If a person, webhook, or application needs an address and a response on a request timeline, use [Deploy an always-on agent](/tutorials/production/deploy-your-agent/always-on) instead. > **Note**: This lab uses an [AWS Lambda container image](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html) and an EventBridge scheduled rule to make the steps executable. The same process shape fits [Cloud Run jobs](https://docs.cloud.google.com/run/docs/create-jobs), [Azure Functions triggers](https://learn.microsoft.com/azure/azure-functions/functions-triggers-bindings), [Amazon ECS scheduled tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html), and [Kubernetes CronJobs](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/). Keep the bounded handler and Dome configuration; translate the image, secret, function, and trigger resources. ## Prerequisites [#prerequisites] You will need: * Docker with Buildx * AWS CLI v2, authenticated to a non-production account * permission to use ECR, Lambda, IAM, Secrets Manager, CloudWatch Logs, and EventBridge * the Dome CLI, signed in as a tenant `admin` (or org `owner` / `admin`) with permission to attach a tool, register an agent, and deploy rules Set and verify the AWS values: ```bash export AWS_REGION="us-east-1" export FUNCTION_NAME="incident-digest" export ECR_REPOSITORY="agent-labs/incident-digest" export AWS_ACCOUNT_ID="$( aws sts get-caller-identity --query Account --output text )" aws sts get-caller-identity ``` Confirm this is not a production account before continuing. ## Build the handler [#build-the-handler] Create an empty project: ```bash mkdir incident-digest cd incident-digest ``` The Lambda base image already includes the Python runtime interface client. Add only the application dependencies: ```text title="requirements.txt" boto3 httpx ``` Create `handler.py`: ```python title="handler.py" import json import os from functools import lru_cache import boto3 import httpx CONTROL_PLANE = os.environ["DOME_CONTROL_PLANE"].rstrip("/") GATEWAY_MCP_URL = os.environ["DOME_GATEWAY_MCP_URL"] SECRET_ID = os.environ["DOME_AGENT_SECRET_ID"] @lru_cache(maxsize=1) def agent_api_key() -> str: response = boto3.client("secretsmanager").get_secret_value( SecretId=SECRET_ID ) return response["SecretString"] def exchange_token() -> str: response = httpx.post( f"{CONTROL_PLANE}/dome.identity.v1.Identity/ExchangeToken", json={"grantType": "api_key", "apiKey": agent_api_key()}, headers={"Content-Type": "application/json"}, timeout=10, ) response.raise_for_status() return response.json()["accessToken"] def parse_mcp(response: httpx.Response) -> dict: if "text/event-stream" not in response.headers.get("content-type", ""): return response.json() for line in response.text.splitlines(): if line.startswith("data:"): message = json.loads(line[5:].strip()) if "result" in message or "error" in message: return message raise ValueError("MCP stream ended without a response") def get_incidents() -> dict: response = httpx.post( GATEWAY_MCP_URL, json={ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "demo-ops/it/get_incidents", "arguments": {}, }, }, headers={ "Authorization": f"Bearer {exchange_token()}", "Content-Type": "application/json", "Accept": "application/json, text/event-stream", }, timeout=20, ) response.raise_for_status() result = parse_mcp(response) if "error" in result: raise RuntimeError(result["error"]) return result["result"] def lambda_handler(event: dict, context) -> dict: run_id = event.get("id") or context.aws_request_id trigger = event.get("source", "manual") result = { "run_id": run_id, "trigger": trigger, "incidents": get_incidents(), } print(json.dumps(result, separators=(",", ":"))) return result ``` This code is intentionally not an HTTP service. Lambda calls `lambda_handler` with one event. The handler reads one governed resource, prints one JSON result, and returns. The secret is cached only within one warm execution environment. Another concurrent environment retrieves its own copy. Token exchange still happens for each event, so the gateway receives a short-lived bearer token rather than the long-lived API key. Create the Lambda image: ```dockerfile title="Dockerfile" FROM public.ecr.aws/lambda/python:3.13 COPY requirements.txt ${LAMBDA_TASK_ROOT} RUN pip install --no-cache-dir -r requirements.txt \ --target ${LAMBDA_TASK_ROOT} COPY handler.py ${LAMBDA_TASK_ROOT} CMD ["handler.lambda_handler"] ``` Exclude local credentials: ```text title=".dockerignore" .git .env .venv __pycache__ *.pyc response.json ``` ## Provision the agent [#provision-the-agent] Create and enter a Dome workspace: ```bash dome workspaces create --name studio-deploy-event dome context sync dome context current ``` Attach the public demo backend: ```bash dome tools add \ --name demo-ops \ --url https://demo-mcp.domesystems.ai/mcp \ --protocol streamable-http \ --auth-method none \ --gateway Default ``` Register the job identity and grant gateway access: ```bash dome agents register --name incident-digest-job --if-not-exists dome gateways access grant Default incident-digest-job ``` Create `incident-digest.cedar`: ```cedar title="incident-digest.cedar" permit( principal is Dome::Agent, action == Dome::Action::"mcp:discover", resource ); permit( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource == Dome::MCPTool::"demo-ops/it/get_incidents" ); forbid( principal is Dome::Agent, action == Dome::Action::"mcp:call", resource ) unless { resource == Dome::MCPTool::"demo-ops/it/get_incidents" }; ``` Deploy and simulate: ```bash dome rules apply incident-digest.cedar \ --agent incident-digest-job \ --name incident-digest-job dome rules simulate --agent incident-digest-job --action mcp:call \ --resource demo-ops/it/get_incidents --resource-type mcp_tool dome rules simulate --agent incident-digest-job --action mcp:call \ --resource demo-ops/sales/get_customer --resource-type mcp_tool ``` Expect `ALLOW`, then `DENY`. Create the API key: ```bash dome agents create-key incident-digest-job --name lambda ``` Keep the one-time value for Secrets Manager. Get the environment endpoints: ```bash dome auth status dome agents get incident-digest-job --gateway Default ``` Set them from the output: ```bash export DOME_CONTROL_PLANE="https://api.domesystems.ai" export DOME_GATEWAY_MCP_URL="https:///gateways//mcp" ``` ## Build and push the function image [#build-and-push-the-function-image] Create the ECR repository: ```bash aws ecr create-repository \ --repository-name "$ECR_REPOSITORY" \ --image-scanning-configuration scanOnPush=true \ --region "$AWS_REGION" ``` Authenticate Docker: ```bash aws ecr get-login-password --region "$AWS_REGION" | \ docker login \ --username AWS \ --password-stdin "$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com" ``` Build one architecture and disable provenance metadata, both required by Lambda container images: ```bash export IMAGE_TAG="$(git rev-parse --short HEAD 2>/dev/null || date +%Y%m%d%H%M%S)" export IMAGE_URI="$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REPOSITORY:$IMAGE_TAG" docker buildx build \ --platform linux/amd64 \ --provenance=false \ --tag "$IMAGE_URI" \ --push \ . ``` ## Store the agent key [#store-the-agent-key] Read the one-time value without echoing it and write it through a mode-`600` temporary file: ```bash read -rsp "Dome agent API key: " DOME_AGENT_API_KEY echo SECRET_FILE="$(mktemp)" chmod 600 "$SECRET_FILE" printf '%s' "$DOME_AGENT_API_KEY" > "$SECRET_FILE" unset DOME_AGENT_API_KEY export SECRET_ARN="$( aws secretsmanager create-secret \ --name dome/incident-digest/agent-api-key \ --secret-string "file://$SECRET_FILE" \ --region "$AWS_REGION" \ --query ARN \ --output text )" rm -f "$SECRET_FILE" ``` The key is now outside the image and outside Lambda environment variables. ## Create the function role [#create-the-function-role] Create the Lambda trust policy: ```json title="lambda-trust.json" { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole" }] } ``` Create the role and attach basic logging: ```bash aws iam create-role \ --role-name incident-digest-lambda \ --assume-role-policy-document file://lambda-trust.json aws iam attach-role-policy \ --role-name incident-digest-lambda \ --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole ``` Give it read access to exactly one secret: ```bash cat > secret-policy.json <" \ --region "$AWS_REGION" ``` The function image and version change. The Secrets Manager reference, Dome agent identity, gateway grant, and rule remain stable. Roll back by updating the function to the previous immutable image URI. **Troubleshooting** * The image fails with a runtime or handler error. Confirm the base image is an AWS Lambda runtime image and `CMD` names `handler.lambda_handler`. A normal web image does not implement the Lambda Runtime API. * The function cannot read the secret. Compare `DOME_AGENT_SECRET_ID` with the inline IAM policy resource. Do not grant `secretsmanager:*` on `*`. * Token exchange returns `401`. Rotate the Dome API key, create a new secret version, verify one manual invocation, then disable the previous version. * The manual invocation works but the schedule does not. Check the rule is enabled, its target is the function ARN, and the Lambda resource policy contains `AllowIncidentDigestSchedule` scoped to the rule ARN. * Two reports appear for one time window. Event-driven delivery is at least once. Keep reads replay-safe; require idempotency before adding writes. * Lambda times out while the tool is still running. Keep the HTTP timeouts below the Lambda timeout, then decide whether the work is still bounded enough for a function. A long workflow belongs in a job or orchestration service. ## Clean up [#clean-up] Disable and remove the trigger first: ```bash aws events disable-rule \ --name incident-digest-hourly \ --region "$AWS_REGION" aws events remove-targets \ --rule incident-digest-hourly \ --ids incident-digest \ --region "$AWS_REGION" aws events delete-rule \ --name incident-digest-hourly \ --region "$AWS_REGION" ``` Delete the function, secret, image repository, and role: ```bash aws lambda delete-function \ --function-name "$FUNCTION_NAME" \ --region "$AWS_REGION" aws secretsmanager delete-secret \ --secret-id "$SECRET_ARN" \ --force-delete-without-recovery \ --region "$AWS_REGION" aws ecr delete-repository \ --repository-name "$ECR_REPOSITORY" \ --force \ --region "$AWS_REGION" aws iam delete-role-policy \ --role-name incident-digest-lambda \ --policy-name ReadDomeAgentKey aws iam detach-role-policy \ --role-name incident-digest-lambda \ --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole aws iam delete-role --role-name incident-digest-lambda ``` Delete the Dome workspace: ```bash dome workspaces delete studio-deploy-event ``` ## Next steps [#next-steps] You deployed a bounded handler whose trigger controls when it runs, whose image contains no credential, and whose one-tool boundary stays the same across invocations and image updates. * [Deploy an always-on agent](/tutorials/production/deploy-your-agent/always-on) to build a request-serving process * [Scheduled agent](/tutorials/examples/noninteractive-agent) to build a richer GitHub report before choosing its production trigger # Deploy your agent (/tutorials/production/deploy-your-agent) This chooser is deprecated. The operating-model comparison and shared deployment guidance now live on the labs themselves: * [Deploy an always-on agent](/tutorials/production/deploy-your-agent/always-on) for a request-serving process * [Deploy an event-driven agent](/tutorials/production/deploy-your-agent/event-driven) for bounded work triggered by a schedule or event # Deploy an always-on agent — agent instructions (/agent/tutorials/production/deploy-your-agent/always-on) These are the instructions an AI agent follows for [Deploy an always-on agent](/tutorials/production/deploy-your-agent/always-on). ## Goal [#goal] Build the documented FastAPI incident-desk service, give it a one-tool Dome identity, run it locally, then deploy it as a private Cloud Run service using an immutable container image and a Secret Manager reference. Invoke it and correlate the Cloud Run request with Dome Audit. ## Rules [#rules] * Show the active Dome context, Google account, project, and region before changing anything. Require a Dome workspace and non-production Google Cloud project. * Create `app.py`, `requirements.txt`, `Dockerfile`, and `.dockerignore` exactly as published on the human tutorial page. * Never print or commit `DOME_AGENT_API_KEY`. Read it silently, pipe it into Secret Manager, then unset it. * Never put the key in source, a Docker build argument, image layer, ordinary Cloud Run environment variable, log, or chat. * Keep the service private. Do not use `--allow-unauthenticated`. * Keep `/health` local: it must not exchange a token, call Dome, or call the upstream tool. * Use an immutable image tag from the current Git commit; do not deploy `latest`. * Do not widen Cedar. The agent may call only `demo-ops/it/get_incidents`. * Show command output for every completed step, excluding secret values. * Do not delete resources until the user confirms. ## Plan to present [#plan-to-present] 1. Build and run the request-serving process locally 2. Create `studio-deploy-http`, `demo-ops`, and `incident-desk-api` 3. Deploy and simulate the one-tool Cedar boundary 4. Create the API key and store it in Secret Manager 5. Build and push an immutable image 6. Deploy the private Cloud Run service 7. Invoke `/health` and `/incidents` 8. Correlate Cloud Run logs with Dome Audit 9. Show revision rollback and offer cleanup Wait for confirmation before step 1. ## Required evidence [#required-evidence] Before reporting completion, show: * `dome context current` naming `studio-deploy-http` * one `ALLOW` for `demo-ops/it/get_incidents` and one `DENY` for another tool * local `/health` and `/incidents` responses * the immutable Artifact Registry image URI * the Cloud Run service account and secret reference, without secret content * a private Cloud Run service URL * one authenticated `/incidents` response * the corresponding `tool.call` in Dome Audit * the previous revision and exact rollback command ## Interpretation [#interpretation] Explain that “always-on” means a request-serving contract, even when Cloud Run scales to zero. The application listens on `$PORT`, may handle concurrent requests, and lives across many requests. Cloud Run, Artifact Registry, and Secret Manager are implementation choices; the HTTP process, externalized credential, stable Dome identity, and one-tool rule transfer to equivalent platforms. Do not claim the event-driven lab could use this image unchanged. A Lambda function needs a handler and runtime interface rather than a web server. # Deploy an event-driven agent — agent instructions (/agent/tutorials/production/deploy-your-agent/event-driven) These are the instructions an AI agent follows for [Deploy an event-driven agent](/tutorials/production/deploy-your-agent/event-driven). ## Goal [#goal] Build the documented Python incident-digest handler, give it a one-tool Dome identity, package it with the Lambda runtime interface, then deploy it from ECR. Keep the agent key in Secrets Manager, invoke one test event, correlate CloudWatch with Dome Audit, and attach a disabled EventBridge schedule before asking to enable it. ## Rules [#rules] * Show the active Dome context, AWS identity, account, and region before changing anything. Require a Dome workspace and non-production AWS account. * Create `handler.py`, `requirements.txt`, `Dockerfile`, and `.dockerignore` exactly as published on the human tutorial page. * Never print or commit `DOME_AGENT_API_KEY`. Read it silently and write it through a mode-`600` temporary file to Secrets Manager; delete the file immediately. * Never put the key in source, an image layer, Lambda environment variables, event input, logs, or chat. * Keep one event bounded to one governed read and one structured result. * Treat trigger delivery as at least once. Do not add a write action or weaken Cedar. * Build one `linux/amd64` image with provenance disabled and an immutable tag. Never deploy `latest`. * Scope the Lambda role to `GetSecretValue` on the exact secret ARN. * Create the EventBridge rule disabled. Show the rule, target, and fixed payload, then wait for confirmation before enabling it. * Disable the rule before cleanup. * Show non-secret output for every completed step. ## Plan to present [#plan-to-present] 1. Build the bounded handler and Lambda image 2. Create `studio-deploy-event`, `demo-ops`, and `incident-digest-job` 3. Deploy and simulate the one-tool Cedar boundary 4. Create the API key and store it in Secrets Manager 5. Build and push the immutable image to ECR 6. Create the least-privilege Lambda role and function 7. Invoke `manual-001`, then correlate CloudWatch and Dome Audit 8. Create and inspect the disabled hourly EventBridge rule 9. Ask before enabling it 10. Disable the rule and offer cleanup Wait for confirmation before step 1. ## Required evidence [#required-evidence] Before reporting completion, show: * `dome context current` naming `studio-deploy-event` * one `ALLOW` for `demo-ops/it/get_incidents` and one `DENY` for another tool * the immutable ECR image URI * the exact secret ARN in the Lambda inline policy, without secret content * the Lambda function configuration and successful `manual-001` result * the CloudWatch request ID and corresponding Dome `tool.call` * the disabled EventBridge rule, function target, and payload * user confirmation before enabling the rule * the exact previous image URI used for rollback ## Interpretation [#interpretation] Explain that the trigger owns timing, retry, and concurrency. The handler receives one event, performs one bounded operation, and returns; it does not listen on `$PORT` or contain a scheduler. Lambda, ECR, Secrets Manager, and EventBridge are implementation choices. The bounded handler, replay-safe behavior, externalized credential, stable Dome identity, and one-tool rule transfer to equivalent platforms. Do not reuse the always-on FastAPI image. This image implements the Lambda Runtime API through the AWS base image and names `handler.lambda_handler` as its entrypoint.