Integration patterns
Roll the gate out across agents safely.
Roll out one agent at a time#
- 01Register the agent
Add it to the inventory with its tools and owner, and issue its token.
- 02Connect its sources
Connect the systems where the facts it relies on are created.
- 03Observe first
Call the gate with evaluationMode observe. Decisions are recorded, nothing is blocked.
- 04Tune policies
Adjust required keys and thresholds until blocks are the ones you expect.
- 05Enforce
Switch to enforce, and route defer and block to people.
- 06Expand
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