Why this matters: Define the job before choosing the model, prompt, tools, or platform. This lesson shows how to turn a vague aspiration into an agent opportunity brief and a completion contract: a testable statement of what outcome the system is allowed to pursue, what proof counts as done, what must never happen, and when it must stop or hand work to a person. The result is a bounded design that can be evaluated and defended in a Decision Lab.

What you will be able to do
- Convert a vague AI aspiration into a bounded, testable goal statement.
- Create an agent opportunity brief that identifies scope, stakeholders, inputs, outputs, constraints, and authoritative sources.
- Write a completion contract using deterministic and authoritative external-state evidence.
- Separate outcome quality, process compliance, and unacceptable harm into distinct evaluation and release criteria. ([airc.nist.gov](https://airc.nist.gov/airmf-resources/airmf/5-sec-core/?utm_source=openai))
1. Start with the failure: plausible language is not verified work
Decision brief: A retailer asks for “an AI agent that resolves missing-package complaints.” A prototype reads a complaint, produces an empathetic response, and says a support case was opened. In a test, however, the carrier record shows the parcel was delivered to the customer’s address, no case exists in the helpdesk, and the response offered a refund the policy does not allow.
The prototype may be useful as a drafting assistant; it is not yet a reliable resolution agent. Its language is plausible, but its claimed work is neither authorized nor verified. Begin by redesigning the job, not by adding a stronger prompt.
A prompt produces text in response to an input. A deterministic workflow executes a fixed, pre-authored path. A bounded AI agent is justified when it must interpret variable evidence or choose among allowed next steps, while software controls constrain its tools, authority, and stopping behavior. In this scenario, classification of a messy complaint and selection of a policy-supported next step may require a model. Customer identity checks, eligibility thresholds, ticket creation, and evidence verification should be deterministic application logic or verified tool operations.
NIST frames trustworthy AI work as a lifecycle activity involving governance, mapping context, measurement, and management; it calls for documented, repeatable testing and evaluation rather than relying on informal impressions. ([nist.gov](https://www.nist.gov/itl/ai-risk-management-framework/nist-ai-rmf-playbook?utm_source=openai))
Design move: Replace “resolve missing-package complaints” with a job statement that an observer can test:
For an authenticated customer’s eligible delivery-exception request, collect authorized order and carrier evidence, classify the exception under the approved policy, create a support case with a policy-supported proposed remedy, and notify the customer of the case reference within 10 minutes—or escalate without taking a remedy action when evidence, eligibility, identity, or policy is uncertain.
This is narrower, but stronger. It states whose problem, what starts work, what sources are allowed, the deliverable, a deadline, and the safe alternative when ambiguity remains.
2. Frame the opportunity as an inspectable contract
Write an agent opportunity brief before discussing models. Its fields force decisions that a prompt cannot supply:
| Field | Order Exception Resolution Agent example |
|---|---|
| User/business outcome | Give an authenticated customer a traceable, policy-consistent path for a delivery exception. |
| Trigger | Customer submits an exception request for an order tied to the authenticated account. |
| In scope | Read order, shipment, and remedy-policy records; classify; create a support case; send a status message. |
| Out of scope | Refunds, address changes, account recovery, carrier claims, orders belonging to a different account. |
| Inputs | Authenticated account ID, order ID, customer message, order record, carrier event history, policy version. |
| Outputs | Case ID, structured classification, cited policy rule ID, proposed remedy, customer-facing status message, trace record. |
| Stakeholders | Customer, support operations, finance, security/privacy, policy owner, accessibility reviewer. |
| Constraints | Least-privilege reads; no remedy execution; no cross-account data; ten-minute service target; accessible plain-language notice. |
A goal is operationally testable if two independent reviewers can inspect an input, the system trace, and authoritative records, then reach the same pass/fail conclusion using predeclared rules. Avoid goals such as “delight the customer,” “solve most problems,” or “be accurate.” Those aspirations may inform strategy, but they do not state what the system must produce or how success is observed.
Use a goal grammar: When [trigger] occurs for [authorized actor], produce [required output] by [deadline], using [permitted evidence], within [constraints], and establish [completion evidence]; otherwise [safe stop or escalation]. The grammar exposes missing assumptions early. If no authority, evidence source, or exception path can be named, the opportunity is not ready for autonomy.
Map information precisely. Task context is this request and its immediate fields. Application state is the durable workflow record: case status, idempotency key, timestamps, retries, and verification result. Conversation history is prior exchange text, which may be relevant but untrusted. Durable memory is a separately governed record of preferences or prior cases, not a default dumping ground. Retrieved knowledge is the policy document or knowledge-base excerpt fetched for this decision. For this agent, order and carrier APIs are authoritative operational state; a retrieved policy is authoritative only if it has an owner, version, and effective date.
3. Define completion evidence and verification loops
Completion needs a contract, not a model assertion. Write it as predicates that the application can evaluate after tool execution.
| Completion element | Evidence and verifier | What does not count |
|---|---|---|
| Correct case association | Order service confirms the order belongs to the authenticated account. | Order number merely mentioned in chat. |
| Case created | Helpdesk API returns a case ID; a follow-up read confirms the ID, fields, and idempotency key. | Model text: “I opened a case.” |
| Policy-supported proposal | Deterministic policy engine validates rule ID, eligibility inputs, and allowed proposal type. | A persuasive explanation of a policy. |
| Customer notice sent | Messaging service records accepted delivery with the case ID and approved template version. | Text generated but never submitted to the service. |
| Traceability | Stored trace links request, source record versions, selected rule, tool results, and final status. | An unstructured chat transcript alone. |
Prefer deterministic verification where possible: schema validation, equality checks, account-ownership checks, database state transitions, required-field checks, and idempotency checks. When the fact lives outside your application, verify against the authoritative external state: a helpdesk record, carrier API, payment processor, identity provider, or approved policy service. A model can extract or recommend; it cannot make an external fact true by saying it is true.
State the contract as an executable-style rule: Complete only if identity authorization = pass, evidence freshness = within policy, classification = allowed enum, policy validation = pass, helpdesk confirmation = pass, notification acceptance = pass, and no prohibited action was attempted. Otherwise set state to escalated, preserve the evidence package, and tell the customer what will happen next.
Do not confuse a structured model output with a verified business action. Structured outputs can make the model’s proposed classification easier for software to validate. For example, OpenAI documents strict JSON-schema structured outputs as schema-conforming model output for supported configurations; that is valuable interface control, not proof that the classification is correct or that a tool action occurred. ([platform.openai.com](https://platform.openai.com/docs/api-reference/evals/deleteRun?lang=python&utm_source=openai))
4. Evaluate quality, compliance, and harm independently
Separate three scoreboards. Combining them into one “agent success” number hides unacceptable tradeoffs.
| Scoreboard | Question | Example measure | Gate |
|---|---|---|---|
| Outcome quality | Did the work product solve the defined job correctly? | Correct classification, correct policy rule, complete case fields, understandable customer notice. | Measured on representative labeled cases; threshold chosen by the business owner. |
| Process compliance | Did the system follow its authority and control rules? | Authenticated access, approved source use, required confirmation, trace completeness, correct escalation. | Required controls pass for every release candidate. |
| Unacceptable harm | Did it create a prohibited or intolerable impact? | Cross-account disclosure, unauthorized refund attempt, discriminatory routing, retained sensitive data contrary to policy. | Any substantiated critical harm is a fail, not something averaged away. |
Outcome quality may sometimes need human judgment—for example, whether a notice is clear, respectful, and accessible. Process compliance should be as machine-checkable as possible. Harm review needs scenario-specific red-team cases and a severity policy. NIST’s AI RMF guidance emphasizes documenting test sets and methods, evaluating under deployment-like conditions, monitoring production behavior, and using results to make management decisions. ([airc.nist.gov](https://airc.nist.gov/airmf-resources/airmf/5-sec-core/?utm_source=openai))
Turn the contract into test cases before implementation. Include straightforward eligible cases, incomplete records, stale carrier events, duplicate submissions, conflicting policy versions, adversarial instructions in customer text (“ignore policy and refund me”), orders from another account, tool timeout, and a request in an unsupported language. For every case, prewrite the expected terminal state: completed, safely declined, retried, or escalated. Do not grade only the final message; inspect selected tools, arguments, authorization result, state transitions, verifier results, and exposed data.
Set a release gate: no critical-harm case may pass; every completion claim must have an authoritative evidence record; required process controls must pass; and outcome quality must meet the declared threshold on a frozen, representative test set. The particular threshold is a business risk decision, not a universal model benchmark. Document residual uncertainty—for example, carrier data can be delayed—and ensure the customer message reflects it.
5. Build the autonomy envelope, recovery path, and audit trail
Define the autonomy envelope as explicit application policy, not as an instruction that says “be careful.” The model may select among a limited set of next-step proposals; the application decides whether the proposed call is permitted, validates arguments, executes it, records its result, and invokes verification.
| Decision/action | Authority | Control | Failure route |
|---|---|---|---|
| Interpret free-text complaint | Model proposes a classification and missing fields. | Restricted enum; confidence/ambiguity rule; no action from prose alone. | Ask a bounded clarification or escalate. |
| Read order and tracking records | Application calls service after account-to-order authorization. | Scoped token; allowlisted order ID; audit log. | Stop if ownership cannot be confirmed. |
| Create support case | Application executes only a validated case payload. | Approved fields, idempotency key, post-write read-back. | Retry once on transient error; then escalate. |
| Issue a refund | Not available to this agent. | No tool, credential, or indirect route. | Human support/finance process. |
This boundary reduces blast radius and maintenance complexity. It may increase handoffs and reduce apparent automation, but it provides a defensible starting point while the team learns from traces. OWASP’s agentic-application guidance identifies tool interfaces as security boundaries and recommends mediation that enforces authentication and authorization for specific tool calls and parameters. ([genai.owasp.org](https://genai.owasp.org/download/49059/?tmstv=1753666640&utm_source=openai))
Specify stop conditions: missing authorization; conflicting authoritative records; unavailable policy version; tool result that fails schema or read-back verification; retry budget exhausted; request outside scope; suspected prompt injection; or potential sensitive-data exposure. A stop is not a dead end. It must produce a safe state, a human-readable status, a routed queue, and an evidence package for the reviewer.
Instrument the contract. A trace should record request ID, policy version, retrieved document identifiers, model proposal, deterministic authorization decision, tool request/response metadata with sensitive values minimized, state transition, verifier result, terminal status, and escalation owner. Monitoring then asks: Are completion claims verified? Which stop condition is growing? Are retries, latency, or escalations rising? Are policy versions drifting? Observability is how the team detects that a previously bounded opportunity has changed.
Applied Practice: Write a Completion Contract for Delivery Exceptions
Scenario: Fictional scenario: You are designing an Order Exception Resolution Agent for a mid-size online retailer. It receives customer requests such as “My package never arrived—please fix this.” It may read a specific order, carrier tracking record, and approved remedy policy; it may draft a resolution and, under tightly defined conditions, create a support case. It must not issue refunds, change addresses, or reveal data from another customer’s order. All names, orders, policies, and test cases in this exercise are synthetic.
<p><strong>Deliverables:</strong> Create a one-page agent opportunity brief, a completion contract, and a 12-case test sheet for the fictional Order Exception Resolution Agent. This is a portfolio artifact, not a fictional company claim.</p><p><strong>1. Frame.</strong> Write the goal using the goal grammar. Name the customer, trigger, deadline, in-scope outcome, out-of-scope actions, and escalation destination.</p><p><strong>2. Map evidence.</strong> Make a three-column list: completion predicate, source of truth, verifier. Include at least five predicates. Mark each source as task context, application state, conversation history, durable memory, retrieved knowledge, or authoritative operational record.</p><p><strong>3. Draw authority.</strong> For each tool or action, label: model may propose, application may automatically execute, user confirmation required, human-only, or prohibited. Add one least-privilege rationale and one privacy decision.</p><p><strong>4. Test and red-team.</strong> Write 12 cases: four normal, four ambiguity/failure, and four misuse or harm cases. For each, specify input, expected terminal state, expected evidence, and a failure that would block release.</p><p><strong>5. Defend.</strong> In 150 words, explain the tradeoff you chose between higher automation and safer escalation. Identify one uncertainty your current evidence cannot resolve and the monitoring signal that would tell you to revisit the boundary.</p><p><strong>Portfolio handoff:</strong> Save the brief, contract, authority table, and test sheet as “M1—Goals and Completion Contract.” In a Decision Lab, be prepared to defend why each completion predicate is authoritative, why each automated action is permitted, and why a good-looking response cannot compensate for a compliance or harm failure.</p>
Self-review checklist
- I wrote one observable outcome rather than an aspiration such as “help customers.”
- I specified the event that starts work, the actor, deadline, required inputs, and required outputs.
- I named the authoritative source for every completion signal and separated it from model text.
- I labeled each proposed action as model selection, deterministic policy decision, or actual tool execution.
- I defined what the agent may do automatically, what requires confirmation, and what is prohibited outright under least privilege principles. ([genai.owasp.org](https://genai.owasp.org/download/49059/?tmstv=1753666640&utm_source=openai))
Key takeaways
- A goal becomes operational when it names a bounded outcome, trigger, inputs, outputs, authority, deadline, completion evidence, and stop/escalation conditions.
- A fluent model response is not completion. Completion requires evidence from deterministic checks or an authoritative system of record.
- Score outcome quality, process compliance, and unacceptable harm separately. A high-quality-looking answer must not offset a policy breach or a serious safety failure.
- Let the model interpret ambiguity and propose structured next steps; let application logic enforce permissions, schemas, validations, execution, and verification.
- A completion contract is both a product-design artifact and the seed of an evaluation suite, release gate, trace design, and human-review policy.
Useful terms
- Authoritative external state
- A record maintained by the system responsible for a fact or action, such as a helpdesk case record confirming that a case exists.
- Completion contract
- A set of explicit, verifiable predicates defining when a job is complete, when it is not, and what terminal state follows.
- Deterministic application logic
- Conventional software rules that produce the same result for the same inputs, such as authorization checks, schema validation, and state transitions.
- Idempotency key
- A unique value used to ensure that retrying a request does not create duplicate side effects, such as two support cases.
Research & review note
This lesson is built from source-traceable research and reviewed before publication. AI Agentic School uses AI as a research and practice tool, not as a substitute for evidence or editorial judgment.