Rules
Control which tools and models each agent is allowed to use
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
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:
- Write Rules manually or with the Rules assistant.
- Validate the Rules for Cedar errors and advisory warnings.
- Simulate representative decisions before changing production behavior.
- Apply the Rules to activate the change.
- Inspect the Rules that apply to an agent and roll back if the result is not expected.
Requirements
Before you begin:
- Authenticate to Dome and select a workspace
- Register at least one agent
- Identify the tools or models the Rules will govern
- Choose the workspace or agent scope where the Rules should apply
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 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 to translate natural-language requirements into a draft. Assistant drafts never deploy automatically.
rules.deploy.Map the sentence to a Rule in five steps.
- Choose
permitfor an allowed request orforbidfor a denied request. - Set the principal to the agent's UUID or use a broader form when the Rule should cover every agent in scope.
- Choose the action that represents the operation.
- Set the resource to the specific tool or model, or use a resource type when the Rule should cover every resource of that type.
- Add a
whencondition if the Rule should apply only under certain circumstances or addunlessto 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.<key>. Per-call values appear as resource.arguments.<key> after resource has arguments. The full action catalog and attribute tables are on the Rules reference.
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 from any row.
Permit a tool call
Replace AGENT_ID with the registered agent's UUID. The tool resource uses CONNECTION_NAME/TOOL_NAME.
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.
permit(
principal,
action == Dome::Action::"mcp:discover",
resource
);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.
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
Gate an LLM call on a connection attribute (resource.<key>) or a per-call argument (resource.arguments.<key>). Guard argument reads with resource has arguments first. Dereferencing a missing argument errors the Rule out.
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 replaces the current user-authored bundle.
After writing the files, validate the Rules before simulation or deployment.
Validate Rules
Validate one or more Cedar files without deploying them. Validation returns blocking Cedar errors and advisory warnings for resource references.
rules.view. Scope-less CLI and API validation require authentication.dome rules validate rules.cedarAdd --agent data-pipeline to check tool references against that agent's workspace catalog. Without --agent, the CLI checks Cedar syntax and semantics only.
dome rules validateTool: dome_rules_validate
{
"files": [
{
"name": "rules.cedar",
"content": "permit(principal == Dome::Agent::\"data-pipeline\", action == Dome::Action::\"mcp:call\", resource == Dome::MCPTool::\"database-query\");"
}
]
}dome_rules_validatePOST /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.
ValidateRulesValidate rules.cedar for the active workspace and explain every error or warning.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.
rules.view.dome rules simulate \
--agent data-pipeline \
--action mcp:call \
--resource database-query \
--resource-type mcp_tooldome rules simulateTool: dome_rules_simulate
{
"agent_id": "data-pipeline",
"action": "mcp:call",
"resource": "database-query",
"resource_type": "mcp_tool"
}dome_rules_simulatePOST /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.
EvaluateSimulate whether "data-pipeline" may call the "database-query" MCP tool.Refer to Simulate Rules for request arguments, Agent Act-As claims, and historical replay.
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.
rules.deploy.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.
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.
dome rules applyTool: dome_rules_deploy
{
"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.
dome_rules_deployPOST /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.
DeployBundleApply rules.cedar to the active workspace as a bundle named "production-v2".After applying Rules, show the effective Rules to confirm that the new bundle contributes to the expected agents. Gateways pick up the change through effective Rules caching. Allow time for the next sync before testing requests.
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.
rules.view.dome rules show --agent data-pipelineOmit --agent to show the effective Rules for every agent in the active workspace.
dome rules showGET /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.
GetAgentEffectivePolicyShow every Rule that applies to "data-pipeline" and identify the contributing bundles.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.
rules.view.Tool: dome_rules_get_active
{
"scope_kind": "workspace",
"scope_id": "{{WORKSPACE_ID}}"
}dome_rules_get_activeGET /v1/rules/active?scope_kind=workspace&scope_id={{WORKSPACE_ID}}GetBundleGet the active user-authored Rules for the current workspace.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.
rules.view.dome rules list --limit 20Add --agent data-pipeline to list the history for one agent.
dome rules listTool: dome_rules_list_versions
{
"scope_kind": "workspace",
"scope_id": "{{WORKSPACE_ID}}",
"limit": 20
}dome_rules_list_versionsGET /v1/rules?scope_kind=workspace&scope_id={{WORKSPACE_ID}}&limit=20ListBundlesList the 20 most recent Rule deployments for the active workspace.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.
rules.rollback.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.
dome rules rollback {{BUNDLE_ID}}The bundle ID identifies its scope, so no scope flag is required.
dome rules rollbackPOST /v1/rules/rollback
Content-Type: application/json
{
"bundle_id": "{{BUNDLE_ID}}"
}RollbackBundleRoll back to Rule bundle "{{BUNDLE_ID}}" and confirm the new active bundle.After rollback, show the effective Rules to confirm that the restored content contributes at the expected scope.
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.
rules.deploy.Deleting Rules removes the active authorization contribution from the selected scope. Broader, narrower, and system-generated Rules can still apply.
DELETE /v1/rules?scope_kind=workspace&scope_id={{WORKSPACE_ID}}DeleteRulesDelete the active user-authored Rules from the current workspace while preserving bundle history.After deletion, list Rule history and show effective Rules to confirm the resulting authorization state.
Generate starter Rules
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 or the 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.
rules.view. CLI generation runs locally.dome rules generate --output starter.cedarOmit --output to print the generated Rules to standard output.
dome rules generateGenerate 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
- Rules concept for how authorization decisions work
- Rules reference for actions and attributes
- Draft with the Rules assistant when you prefer natural-language drafts
- Simulate Rules to probe decisions and replay history
- Authorization model concept for evaluation semantics