← All examples
ResearchAgentRun
examples/ResearchAgentRun.intent
ResearchAgentRun.intent
1# ResearchAgentRun.intent2# Domain: AI agent workflow. An autonomous, tool-using agent needs guardrails as3# explicit as its goal: bounded steps, a spend budget, no irreversible action4# without approval, and cited answers. The control policy runs as a decision.56mission ResearchAgentRun7use product89title "Run a tool-using research agent within hard guardrails"10for AgentOperator1112note pm:13 The agent is useful only if it stops, asks, or escalates before it does harm.1415goal16 Let an agent answer a research task by calling tools, while staying inside its17 step, budget, and safety limits.1819why20 An unbounded agent loops forever, overspends, or takes irreversible actions no21 one approved. The guardrails are the product, not an afterthought.2223requires24 ResearchTask25 ToolAllowlist2627input28 task: ResearchTask29 stepsTaken: Count30 spendUsd: Money31 budgetUsd: Money32 actionIsIrreversible: Flag33 humanApproved: Flag3435output36 answer: GroundedAnswer3738guarantee every claim in the answer cites a retrieved source39 because an uncited agent answer is indistinguishable from a hallucination40 verify citation coverage test4142guarantee the agent halts at its step and budget limits43 because an unbounded loop is how agents overspend and hang44 verify budget and step limit test4546never47 take an irreversible action without human approval48 call a tool outside the allowlist49 exceed the spend budget5051never take an irreversible action without human approval52 because a delete, a payment, or a send cannot be undone by a retry53 verify approval gate test5455never call a tool outside the allowlist56 because the allowlist is the agent's entire authority boundary57 verify tool allowlist test5859never exceed the spend budget60 because runaway token or API cost is a direct financial loss61 verify budget and step limit test6263# The agent control loop, one deterministic step decision. `intent run` / `intent test`.64decision AgentNextAction65 inputs66 stepsTaken67 maxSteps68 spendUsd69 budgetUsd70 actionIsIrreversible71 humanApproved72 rule overBudget73 when spendUsd >= budgetUsd74 return Halt75 rule outOfSteps76 when stepsTaken >= maxSteps77 return Halt78 rule needsApproval79 when actionIsIrreversible == true and humanApproved == false80 return Escalate81 default82 return Continue8384target85 TypeScript86 Tests8788test AgentNextAction89 case within limits keeps going90 given stepsTaken 3, maxSteps 20, spendUsd 0.4, budgetUsd 5, actionIsIrreversible false, humanApproved false91 expect Continue92 case over budget halts93 given stepsTaken 3, maxSteps 20, spendUsd 5, budgetUsd 5, actionIsIrreversible false, humanApproved false94 expect Halt95 case out of steps halts96 given stepsTaken 20, maxSteps 20, spendUsd 1, budgetUsd 5, actionIsIrreversible false, humanApproved false97 expect Halt98 case irreversible action without approval escalates99 given stepsTaken 3, maxSteps 20, spendUsd 1, budgetUsd 5, actionIsIrreversible true, humanApproved false100 expect Escalate101 case irreversible action with approval proceeds102 given stepsTaken 3, maxSteps 20, spendUsd 1, budgetUsd 5, actionIsIrreversible true, humanApproved true103 expect ContinueDraft syntax. This file is illustrative and does not run yet.
More examples
AlertRoutingApiGatewayBillingServiceCalculateRiskScoreCertificationAttemptCertificationCheckoutCertificationEligibilityCertificationStudyPlanCreateInvoiceCreateStudyPlanCustomerDataRequestDuplicateInvoicePreventionGroundedAnswerIngestClickstreamInvoiceCreatedNetworkEgressPolicyPlaceOrderResetPasswordStorefrontStyleSubscriptionUpgradeTenantIsolationUploadStudyMaterial