Skip to main content

The problem

Your agent proposes the next action:
The JSON is valid, but the action conflicts with current state. A ticket that still needs review should not be closed. The same pattern matters for higher-risk tools: refunds, permissions, state transitions, account changes, and any action where a plausible-looking model response can trigger a real side effect.

The contract

Fetch policy and current state before the contract. Then keep the rules deterministic and synchronous.

Run the model

The model can still propose the action. Boundary decides whether that action is consistent with the state and policy you passed in.

Accept or reject

Do not execute a rejected action. Use the attempt history to ask for review, retry with more state, or return a safe fallback.

When to use this pattern

  • Agent tool calls that mutate state
  • Refunds, account credits, and billing adjustments
  • Support workflow transitions
  • Permission or access changes
  • Any action where policy depends on current state