Dome Systems

Simulate rules

Test Rules against real and synthetic scenarios before they reach production

Simulation replays candidate Rules against recorded authorization decisions to show which outcomes would change. Dome compares each historical event with the decision the candidate Rules would produce.

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 for deploy and rollback.

The typical workflow is:

  1. Run a simulation for one agent, action, and resource against the Rules in effect.
  2. Optionally simulate draft Rules in the editor before you apply.
  3. Optionally simulate with Agent Act-As or simulate with arguments.
  4. Read results for historical DecisionDiffs when you replay candidate Rules against audit history.

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

Simulation and DecisionDiff reads require rules.view. All workspace roles hold it.

Default rolesPermissionGrants
All workspace rolesrules.viewRun simulations and read DecisionDiff results

Run a simulation

Simulate an authorization decision for one agent, action, and resource against the Rules currently in effect.

Requires rules.view.

Write or refine the Cedar Rules you want to test before you deploy them:

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:

dome rules simulate \
  --agent data-pipeline \
  --action mcp:call \
  --resource database-query \
  --resource-type mcp_tool
FlagTypeDefaultDescription
--agentstringRequiredAgent name or ID to simulate as the caller
--actionstringRequiredAction to evaluate (for example mcp:call)
--resourcestringRequiredResource identifier (for example database-query)
--resource-typestringmcp_toolmcp_tool, llm_model, or resource
--eval-contextkey=value—Context key=value pair (repeatable)
--eval-argumentsJSON object—Per-call arguments surfaced as resource.arguments.<key> (for example '{"query":"Atlas"}')
--actas-substring—Act-as subject identifier
--actas-emailstring—Act-as email
--actas-rolesstring—Act-as roles (comma-separated)
--actas-groupsstring—Act-as groups (comma-separated)

Tool: dome_rules_simulate

{
  "agent_id": "data-pipeline",
  "action": "mcp:call",
  "resource": "database-query",
  "resource_type": "mcp_tool"
}
ParamTypeDefaultDescription
agent_idstringRequiredAgent ID or name (names are resolved to UUIDs by the tool)
actionstringRequiredAction to evaluate
resourcestringRequiredResource identifier
resource_typestringRequiredmcp_tool, llm_model, or resource
contextobject—Additional context key-value pairs
actas_substring—Act-as subject identifier
actas_emailstring—Act-as email
actas_rolesstring—Act-as roles (comma-separated)
actas_groupsstring—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.

POST /v1/authz/evaluate
Content-Type: application/json

{
  "caller": {
    "agent_id": "<agent-uuid>"
  },
  "action": "mcp:call",
  "resource": "database-query",
  "resource_type": "mcp_tool",
  "workspace_id": "<workspace-uuid>"
}
FieldTypeDefaultDescription
caller.agent_idstringRequiredAgent UUID
actionstringRequiredAction to evaluate
resourcestringRequiredResource identifier
resource_typestringRequiredmcp_tool, llm_model, or resource (lowercase string)
workspace_idstringRequired (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).
contextmap<string,string>—Additional context key-value pairs
act_asActAs—End-user identity (sub, email, roles, groups, claims)
argumentsbytes—JSON object encoded as bytes. Top-level keys become resource.arguments.<key> (for example {"query":"Atlas"})
Reference: Evaluate
Simulate Rules
Simulate authorization for agent "data-pipeline" doing mcp:call on mcp_tool "database-query".

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.

{
  "caller": { "agent_id": "<agent-uuid>" },
  "action": "mcp:call",
  "resource": "database-query",
  "resource_type": "mcp_tool",
  "workspace_id": "<workspace-uuid>",
  "override": {
    "scope_kind": "workspace",
    "scope_id": "<workspace-uuid>",
    "files": [
      { "path": "rules.cedar", "content": "permit(principal, action, resource);" }
    ]
  }
}
FieldDescription
override.scope_kindworkspace or agent
override.scope_idUUID of the scope whose bundle is overridden
override.filesDraft 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

Include Act-As claims when your Cedar Rules reference end-user identity and you want to verify behavior for specific profiles.

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 verification before the same values become available to Rules.

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
FlagCedar value
--actas-subprincipal.act_as.sub
--actas-emailprincipal.act_as.email
--actas-rolesprincipal.act_as.roles
--actas-groupsprincipal.act_as.groups

Tool: dome_rules_simulate

{
  "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"
}
POST /v1/authz/evaluate
Content-Type: application/json

{
  "caller": {
    "agent_id": "<agent-uuid>"
  },
  "action": "mcp:call",
  "resource": "customer-records",
  "resource_type": "mcp_tool",
  "workspace_id": "<workspace-uuid>",
  "act_as": {
    "sub": "user-123",
    "email": "admin@example.com",
    "roles": ["admin", "manager"],
    "groups": ["support"]
  }
}
FieldTypeDefaultDescription
act_as.substring—Subject identifier
act_as.emailstring—Email claim
act_as.rolesstring[]—Roles claim
act_as.groupsstring[]—Groups claim
act_as.claimsmap<string,string>—Additional custom claims
Reference: Evaluate
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

Pass per-call arguments when your Rules reference resource.arguments.<key> 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 for the full shape.

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.

dome rules simulate \
  --agent data-pipeline \
  --action mcp:call \
  --resource vector-search \
  --resource-type mcp_tool \
  --eval-arguments '{"query":"Atlas","limit":50}'
FlagTypeDefaultDescription
--eval-argumentsJSON object—Per-call arguments as a JSON object surfaced as resource.arguments.<key>

In the Simulate panel, open the Arguments section and add one key-value row per argument. Each row becomes resource.arguments.<key> for the evaluation.

POST /v1/authz/evaluate
Content-Type: application/json

{
  "caller": { "agent_id": "<agent-uuid>" },
  "action": "mcp:call",
  "resource": "vector-search",
  "resource_type": "mcp_tool",
  "workspace_id": "<workspace-uuid>",
  "arguments": "eyJxdWVyeSI6IkF0bGFzIn0="
}
FieldTypeDefaultDescription
argumentsbytes—Base64-encoded JSON object. Top-level keys are surfaced as resource.arguments.<key>. Non-object payloads are dropped silently.
Reference: Evaluate

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
{
  "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?

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

On this page

Was this page helpful?