Policy Engine

Simulate policies

Changed on

Simulates policy evaluation for one operation against the project's current policies and returns the action the real operation would take, the rule that decided it, and the first unmet criterion of every rule that did not match. Nothing is signed, broadcast, or persisted, and gas and nonce are not populated: the transaction is evaluated as submitted. Each unmet criterion (observed) and each matched-rule criterion (observations) can include the value observed in the request, with messages and decoded arguments returned up to their documented size limits. Rate-limiting criteria are read but not consumed. netUSDChange criteria run transaction simulation, and pass successfully on testnets, as in the real operation. The result is a snapshot: policies, rate-limit counters, or chain state may change before a real call. A policy rejection returns 200 with action: reject; this endpoint never returns policy_violation. A criterion that cannot be evaluated for this input returns 422.

post/v2/policy-engine/simulate

Request

  • Base URL
    https://api.cdp.coinbase.com/platform
  • Auth
    HTTP bearer

Query parameters

groupType, 'project' | 'entity'

Whether policy operations use the entity ID or the project ID from the caller's credential.

Selects whether this request uses the entity ID or the project ID from the caller's credential as the policy group for lookups, writes, and simulation. Defaults to project. Use entity for the policies of an entity's custodial accounts. This is independent of a policy's scope, which says whether a policy applies to a single account or to the whole project.

Request body

union required

Inputs for one operation, without signing credentials. operation is the policy rule operation name (for example signSolTransaction), not the HTTP operation ID (signSolanaTransaction).

SignEvmTransactionSimulationInput required
OR
SendEvmTransactionSimulationInput required
OR
SignEvmHashSimulationInput required
OR
SignEvmMessageSimulationInput required
OR
SignEvmTypedDataSimulationInput required
OR
PrepareUserOperationSimulationInput required
OR
SendUserOperationSimulationInput required
OR
SignSolTransactionSimulationInput required
OR
SendSolTransactionSimulationInput required
OR
SignSolMessageSimulationInput required
OR
SignEndUserEvmHashSimulationInput required
OR
SignEndUserEvmTransactionSimulationInput required
OR
SendEndUserEvmTransactionSimulationInput required
OR
SignEndUserEvmMessageSimulationInput required
OR
SignEndUserEvmTypedDataSimulationInput required
OR
SendEndUserOperationSimulationInput required
OR
SignEndUserSolTransactionSimulationInput required
OR
SendEndUserSolTransactionSimulationInput required
OR
SignEndUserSolMessageSimulationInput required
OR
SendEndUserEvmAssetSimulationInput required
OR
SendEndUserSolAssetSimulationInput required
OR
CreateEndUserEvmSwapSimulationInput required

Example request

{
  "operation": "signEvmTransaction",
  "address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
  "transaction": "0x02f082210580843b9aca00847735940082520894123456789012345678901234567890123456789087038d7ea4c6800080c0"
}

Response

Policy simulation result.

PolicySimulationResult required

The action the real operation would take and why. matchedRule is present exactly when reason is rule_accepted or rule_rejected.

action, 'accept' | 'reject' required

Whether the real operation would be accepted or rejected.

reason, 'rule_accepted' | 'rule_rejected' | 'no_rule_matched' | 'no_rule_for_operation' required

Why the operation got its action. Each value implies exactly one action. Within a policy, a matching reject rule overrides any matching accept rule, regardless of rule order. With accept: rule_accepted means matchedRule matched all of its criteria, its action is accept, and no reject rule in the same policy matched. no_rule_for_operation means no rule targeted the operation, so it was accepted by default. With reject: rule_rejected means matchedRule matched all of its criteria and its action is reject, so the rejection is caused by the entire rule. no_rule_matched means at least one rule targeted the operation but none matched, so it was rejected by default; unmatchedRules shows the criterion that disqualified each one.

matchedRule, MatchedPolicyRule

The rule whose action decided the evaluation.

unmatchedRules, UnmatchedPolicyRule[] required

Rules targeting the operation that were evaluated and did not match. Within a policy, reject rules are evaluated before accept rules, and evaluation stops at matchedRule. Rules that were not evaluated are omitted. When there is no matchedRule, every rule that targeted the operation appears here. Among matching rules with the same action, the first in policy order is matchedRule.

evaluatedPolicies, EvaluatedPolicy[] required

Policies iterated, in order: the project policy, then the account policy. Evaluation stops at the policy containing matchedRule. End-user operations consult only the project policy.

evaluatedUnit, EvaluatedUnit

The unit this result describes. Present only when the operation was evaluated as more than one unit: one unit per call for user operations, and one unit per signing account for Solana transactions. Each unit is evaluated against the policies separately, and matchedRule, unmatchedRules, evaluatedPolicies, and every observed value describe this unit only. When action is reject, this is the first unit that was rejected. When action is accept, every unit was accepted and this is the last one.

Example response

{
  "action": "reject",
  "reason": "no_rule_matched",
  "unmatchedRules": [
    {
      "policy": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "scope": "project",
        "updatedAt": "2026-09-01T12:00:00Z"
      },
      "ruleIndex": 0,
      "criterionIndex": 0,
      "criterion": {
        "type": "ethValue",
        "ethValue": "1",
        "operator": "<="
      },
      "observed": {
        "type": "ethValue",
        "ethValue": "500000000000000000"
      }
    }
  ],
  "evaluatedPolicies": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "scope": "project",
      "updatedAt": "2026-09-01T12:00:00Z"
    }
  ]
}

Changes

    • breaking

      added to the matchedRule/rule/allOf[#/components/schemas/Rule] response property oneOf list for the response status

    • warning

      added the new policy_not_applicable enum value to the errorType response property for the response status

    • warning

      added the new policy_not_applicable enum value to the errorType response property for the response status

    8 more changes in this revision