Skip to main content
Policy simulation evaluates one operation against your project’s current policies and returns the action the real operation would take. The result names the rule that decided it and the first unmet criterion of every rule that did not match. Simulation does not sign, broadcast, or persist anything. Gas and nonce are not populated, so the transaction is evaluated exactly as you submit it. Use simulation to:
  • Check a new or updated policy against sample transactions before you rely on it.
  • Find out why a real operation was rejected.
  • Decide in your application whether to attempt an operation.

Simulate an operation

Set operation to the policy rule operation you want to test, such as signEvmTransaction or signEndUserEvmTransaction, and pass the same inputs the real operation takes. See Supported operations for the full list.

Read the result

A policy rejection is a successful response: the request returns 200 with action: reject. Simulation never returns a policy_violation error.

Reasons

Rejected by a rule

When reason is rule_rejected, the whole matched rule caused the rejection. matchedRule.rule is the rule as defined at the evaluated policy version. matchedRule.observations[i] is the value that rule.criteria[i] was compared against.

Rejected by default

When reason is no_rule_matched, read unmatchedRules. It lists every rule that targets the operation. Criteria are evaluated in order and evaluation stops at the first unmet one, so each entry shows one criterion: In this example, the transaction exceeds the value limit of the project policy’s first rule and targets the wrong network for the account policy’s third rule:
Fixing the listed criterion does not guarantee the rule matches. Later criteria in the same rule were not evaluated. When a rule matches, unmatchedRules contains only the rules evaluated before it. Within a policy, reject rules are evaluated before accept rules.

Evaluated policies

evaluatedPolicies lists the project policy, then the account policy. Evaluation stops at the policy that contains matchedRule. End-user operations consult only the project policy. Each policy’s updatedAt identifies the version evaluated. ruleIndex and criterionIndex refer to that version, so compare updatedAt with the current policy before you edit rules by index.

Evaluated unit

User operations are evaluated once per call, and Solana transactions once per signing account. When an operation is split this way, evaluatedUnit gives the unit’s zero-based index, the total count, and, for Solana, the signing address. A rejected result describes the first rejected unit. An accepted result describes the last unit.

Errors

Limitations

  • The result is a snapshot. Policies, rate-limit counters, or chain state can change before you make the real call.
  • rateLimiting criteria read the current usage but do not consume it, so simulating does not count toward a limit.
  • netUSDChange criteria run transaction simulation as the real operation does, and pass on testnets.