← All examples
TwelveFactorAgent
examples/TwelveFactorAgent.thunder
TwelveFactorAgent.thunder
1# A 12-factor-aligned agent intent: deterministic control flow, structured I/O, a human gate,2# bounded errors, a resumable lifecycle, and event triggers. Score it:3# intent twelve-factor examples/TwelveFactorAgent.thunder4mission TriageIncident5goal "triage an incoming incident and route it deterministically, pausing for a human on high-stakes actions"6why "on-call engineers need reliable, auditable triage, not an autonomous loop that can spin out"78requires monitoring signal9requires runbook access1011scope12 include incident severity, service ownership, runbook steps13 exclude unrelated services, incidents older than 30 days1415input16 severity: Severity17 service: ServiceId18 actor: UserId1920output21 routing: RoutingDecision2223guarantee every high-severity incident is acknowledged within the SLA24guarantee no destructive action runs without human approval2526decision RouteIncident27 inputs28 severity29 ownerAvailable30 rule page31 when severity == "high" and ownerAvailable == true32 return PageOwner33 rule escalate34 when severity == "high" and ownerAvailable == false35 return EscalateToLead36 default37 return FileTicket3839approval required from40 incident-commander4142errors43 RunbookUnavailable44 DownstreamTimeout4546on DownstreamTimeout47 compensate retry with backoff48 notify on-call channel4950lifecycle IncidentLifecycle51 state Triaged52 state Routed53 state AwaitingApproval54 state Resolved55 transition route56 from Triaged57 to Routed58 transition await59 from Routed60 to AwaitingApproval61 transition resolve62 from AwaitingApproval63 to Resolved64 terminal Resolved6566event IncidentRaised6768demonstrates explains why high-severity incidents pause for human approval69requires_skill Incident Response, Distributed SystemsDraft syntax. This file is illustrative and does not run yet.
More examples
AlertRoutingApiGatewayBillingServiceCalculateRiskScoreCertificationAttemptCertificationCheckoutCertificationEligibilityCertificationStudyPlanCreateInvoiceCreateStudyPlanCustomerDataRequestDuplicateInvoicePreventionGroundedAnswerIngestClickstreamInvoiceCreatedNetworkEgressPolicyPlaceOrderResearchAgentRunResetPasswordStorefrontStyleSubscriptionUpgradeTenantIsolationUploadStudyMaterial