Integration patterns

Roll the gate out across agents safely.

Roll out one agent at a time#

  1. 01
    Register the agent

    Add it to the inventory with its tools and owner, and issue its token.

  2. 02
    Connect its sources

    Connect the systems where the facts it relies on are created.

  3. 03
    Observe first

    Call the gate with evaluationMode observe. Decisions are recorded, nothing is blocked.

  4. 04
    Tune policies

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

  5. 05
    Enforce

    Switch to enforce, and route defer and block to people.

  6. 06
    Expand

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

Where the gate call goes#

async function act(actionType, payload) {
  // 1. Ask immediately before acting; reuse the ID on retry
  const result = await gate.evaluate({ threadId, actionType, payload, clientRequestId });

  // 2. Fail closed
  if (!result || result.error) return escalate(result);
  if (result.decision === 'block') return escalate(result);
  if (result.decision === 'defer') return waitForApproval(result);
  if (result.decision === 'warn') log.warn(result.reasonCodes);

  // 3. Act, and keep the receipt with the result
  const outcome = await tools[actionType](payload);
  return { outcome, receiptId: result.lineage.receiptId };
}
Last reviewed October 2026Suggest a change