Gate API

Ask whether an action may run.

Evaluate an action#

POST https://api.cognaone.com/api/actions/evaluate
Authorization: Bearer <agent token>
Content-Type: application/json

{
  "threadId": "thr_claims_0142",
  "actionType": "payment.release",
  "clientRequestId": "req_7f3c91",
  "payload": { "amount": 48000, "currency": "AUD" },
  "evaluationMode": "enforce"
}

Request fields#

FieldRequiredDescription
threadIdYesThe thread whose governed state the action relies on
actionTypeYesThe action, for example payment.release; gate policies are set per action type
clientRequestIdRecommendedYour ID for this request; reuse it on retries
payloadNoThe details of the action, as a JSON object
evaluationModeNoenforce (default) or observe
runtimeIdNoA registered runtime of this agent, for telemetry

Decisions#

DecisionYour agent should
AllowProceed with the action
WarnProceed, and surface the warnings
DeferNot act yet. An approval or more facts are needed; evaluate again once resolved
BlockNot act. Show the reasons to a person, or fix them and evaluate again

Reason codes explain the decision, for example gate_block_missing_key, gate_block_conflict or gate_warn_policy_violation. See Decisions and verdicts.

Observe, then enforce#

With evaluationMode: "observe", the gate evaluates and records the decision as observed, not enforced, so you can see what would have been blocked before enforcing anything.

Good practice#

  1. 01
    Call the gate immediately before acting

    Not at the start of a long task: state may change in between.

  2. 02
    Treat errors as a block

    If the gate cannot be reached or returns an error, do not act. Fail closed.

  3. 03
    Reuse the clientRequestId on retries

    A retry then returns the original decision rather than a second evaluation.

  4. 04
    Keep the receipt ID

    Log lineage.receiptId with the action so outcomes can be traced to their receipt.

Last reviewed October 2026Suggest a change