Examples
Infrastructure Change Approval
What this example shows
Infrastructure change management is high risk by default. This pattern introduces explicit governance checkpoints: AI blast-radius analysis, human SRE approval, and then automation-controlled rollout. Every handoff carries evidence and attributed actors.
Loop diagram
1IDLE --[start_analysis]--> ANALYZING2ANALYZING --[submit_analysis]--> PENDING_APPROVAL3PENDING_APPROVAL --[approve_change]--> APPROVED --[execute_rollout]--> ROLLING_OUT --[complete_rollout]--> COMPLETE4PENDING_APPROVAL --[reject_change]--> REJECTEDActors
| Actor | Type | Role | Guards that apply |
|---|---|---|---|
| change analyzer | ai-agent | Produces blast-radius assessment and recommendation | evidence-required, confidence-threshold |
| sre approver | human | Approves or rejects rollout | human-only |
| deploy controller | automation | Executes approved rollout steps | state/transition constraints |
Key annotated snippet
1import Anthropic from "@anthropic-ai/sdk";2import { createLoopSystem } from "@loop-engine/sdk";3import { createAnthropicActorAdapter } from "@loop-engine/adapter-anthropic";4 5const anthropic = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });6const adapter = createAnthropicActorAdapter(anthropic, { modelId: "claude-opus-4-6" });7const { engine } = await createLoopSystem({ loops: [changeApprovalLoop] });8 9const { actor, decision } = await adapter.createSubmission({10 loopId: "infrastructure.change_approval",11 loopName: "Infrastructure Change Approval",12 currentState: "ANALYZING",13 availableSignals: [{ signalId: "submit_analysis", name: "Submit Analysis" }],14 instruction: "Assess blast radius and rollback readiness.",15 evidence: { changeId: "CHG-10021", service: "payments-api" }16});17 18await engine.transition({19 aggregateId: "chg-2026-03-13-001" as never,20 transitionId: "submit_analysis" as never,21 actor,22 evidence: {23 ...decision,24 blast_radius_score: 0.22,25 affected_services: ["payments-api", "settlement-worker"],26 rollback_plan: "revert migration and recycle workers"27 }28});What emitted events look like
1{2 type: "loop.transition.executed",3 loopId: "infrastructure.change_approval",4 aggregateId: "chg-2026-03-13-001",5 transitionId: "approve_change",6 fromState: "PENDING_APPROVAL",7 toState: "APPROVED",8 actor: { type: "human", id: "sre@company.com" },9 evidence: { approvalTicket: "SRE-4451", approved: true }10}