Integration patterns

How to roll the gate out across agents safely.

Roll out one agent at a time

  1. 1
    Register the agent

    Add it to the inventory with its tools and owner.

  2. 2
    Observe first

    Record state and call the gate, but log verdicts without enforcing them for a short period.

  3. 3
    Tune policies

    Adjust required keys and thresholds until blocks are the ones you expect.

  4. 4
    Enforce

    Act only on ALLOW, and route approvals and blocks to people.

  5. 5
    Expand

    Move to the next agent, starting with the ones whose actions carry the most consequence.

Where the gate call goes

async function act(action, args) {
  // 1. Make sure the facts this action relies on are recorded
  await recordState(args.facts);

  // 2. Ask immediately before acting
  const decision = await gate.evaluate({ session_id, action });

  // 3. Fail closed
  if (decision.verdict === 'BLOCK') return escalate(decision);
  if (decision.verdict === 'WARN' && needsApproval(decision)) return waitForApproval(decision);

  // 4. Act, and keep the decision ID with the result
  const result = await tools[action](args);
  return { result, decision_id: decision.decision_id };
}
Last reviewed October 2026Suggest a change