Generative AI
Generative AI Capstone: Design and Defend a Grounded Product
Design an end-to-end generative AI product and produce the evidence required to launch, limit, or reject it.
By the end you can
- Translate a consequential product need into a bounded generative AI system contract
- Select model, retrieval, tools, adaptation, and serving components using explicit evidence
- Construct release, safety, monitoring, and incident plans for the complete workflow
- Defend a deployment, limited-pilot, redesign, or non-deployment recommendation
Example
The assignment: a grounded technical-maintenance copilot
A manufacturer operates industrial chillers across hospitals and food-distribution sites. Technicians need help diagnosing alarms, finding procedures, drafting service notes, and proposing parts orders. The deliverable is not a demo. It is a release argument: a recommendation with the measurements that justify its scope, written so that a reviewer who disagrees can check every number that supports it.
- Evidence: Manuals, service bulletins, live telemetry, parts inventory, site history, and jurisdictional safety rules.
- Users: Apprentices, senior technicians, dispatchers, parts staff, and safety managers with different authority.
- Actions: Search, summarize, calculate, draft, create a work order, reserve a part, or escalate an emergency.
- Risks: Unsupported procedure, stale bulletin, wrong equipment identity, unsafe tool action, privacy breach, and delayed repair.
- Constraint: The system must continue safely during model, network, inventory, or retrieval degradation.
- Decision: Recommend broad launch, limited pilot, non-actionable assistant, redesign, or non-deployment.
Visual
A complete design contains several accountable layers
Every layer needs an owner, version, test, and fallback. That is not house style. It is now written into a published specification with a counted set of obligations. ETSI TS 104 223, published on 23 April 2025, sets 13 core principles that expand into 72 trackable provisions. They spread across five lifecycle phases: secure design, development, deployment, maintenance, and end of life. The specification grew out of a UK voluntary code of practice for the cyber security of AI, published on 31 January 2025.
Two details of that structure matter for the capstone. The first is that the provisions are trackable — 72 of them, each something a reviewer can ask you to point at. That is the difference between a diagram and an accountable architecture. The second is that the list does not stop at launch. End of life is a named phase alongside secure design, which is why the control-and-operations layer below carries retirement next to monitoring. Scott Cadzow, who chairs ETSI's Technical Committee for Securing Artificial Intelligence, put it this way: “Security must be a core requirement, not just in the development phase, but throughout the lifecycle of the system.”
The five layers of this product — user and authority; evidence and context; reasoning workflow; model and serving; control and operations — should each be readable as an owner, a version, a test, and a fallback.
- 01
User and authority
Identity, role, equipment, task, action permissions, and escalation.
- 02
Evidence and context
Manuals, bulletins, telemetry, history, inventory, metadata, and freshness.
- 03
Reasoning workflow
Prompting, retrieval, claim verification, calculations, tools, and structured state.
- 04
Model and serving
Candidate models, routing, decoding, latency, caching, cost, and fallback.
- 05
Control and operations
Authorization, evaluation, monitoring, incidents, governance, and retirement.
Steps
Stage 1: define the product contract
Do not select a model until the decision and authority boundaries are explicit. The contract is the artifact every later stage is measured against. The bake-off compares candidates on it, the evaluation turns it into gates, and the memo recommends a scope inside it. Enumerate the user jobs, and keep information lookup, diagnosis support, drafting, reservation, and emergency escalation separate. Distinguish suggestions from verified facts, calculations, and proposed actions. Name who may approve work orders, part reservations, and safety-critical steps. Specify authoritative sources, effective dates, equipment identity, and telemetry freshness. Describe safe behavior during missing evidence, tool failure, or model unavailability. Then list the non-goals: the decisions the system must never make autonomously. A capability added later cannot quietly annex them if they are written down first.
1. Enumerate user jobs
Separate information lookup, diagnosis support, drafting, reservation, and emergency escalation.
2. Define allowed outputs
Distinguish suggestions, verified facts, calculations, and proposed actions.
3. Assign authority
Name who may approve work orders, part reservations, and safety-critical steps.
4. Set evidence rules
Specify authoritative sources, effective dates, equipment identity, and telemetry freshness.
5. Define fallback
Describe safe behavior during missing evidence, tool failure, or model unavailability.
6. Establish non-goals
List decisions the system must never make autonomously.
Comparison
Stage 2: compare candidate system designs
The capstone requires at least three defensible alternatives, including a simpler baseline. Search and templates uses structured search, calculators, and controlled forms, with no free generation. Source visibility is strong and generative risk is low, synthesis is limited, and it is the important baseline for regulated steps. A grounded assistant adds retrieval, structured outputs, calculators, and proposed tool calls with review. It balances assistance and control, needs claim verification, supports broader user language, and is the likely candidate for a limited pilot. An agentic workflow allows planning and multiple tool calls under bounded authority. It can automate complex sequences. It also carries the highest security and recovery burden, and requires state and transaction controls. Nothing justifies it except measured incremental value over the two designs above it.
Search and templates
Use structured search, calculators, and controlled forms without free generation.
- Strong source visibility
- Limited synthesis and conversational flexibility
- Low generative risk
- Important baseline for regulated steps
Grounded assistant
Use retrieval, structured outputs, calculators, and proposed tool calls with review.
- Balances assistance and control
- Needs evidence and claim verification
- Supports broader user language
- Likely candidate for limited pilot
Agentic workflow
Allow planning and multiple tool calls with bounded authority.
- Can automate complex sequences
- Highest security and recovery burden
- Requires state and transaction controls
- Justified only by measured incremental value
Steps
Stage 3: build the evidence pipeline
Make the source of every consequential claim and action inspectable. And treat the arrangement of that evidence as a measured variable rather than a formatting preference. Where a passage sits inside the context window changes whether the model uses it. Liu and colleagues moved the relevant passage around and watched retrieval-augmented accuracy move with it. Their 2023 abstract states the result: “In particular, we observe that performance is often highest when relevant information occurs at the beginning or end of the input context, and significantly degrades when models must access relevant information in the middle of long contexts, even for explicitly long-context models.”
Levy and colleagues reached a companion result independently, in an ACL 2024 outstanding paper: reasoning degrades at input lengths far below a model's technical maximum. Together the two make step 3 a testable rule instead of an aesthetic one. The current alarm, the equipment identity, and the effective bulletin belong at the ends of the assembled context, where the measurement says they are used. Conversational history is what gets dropped first. A context length the model accepts is not a context length the model reads.
Around that ordering, the rest of the pipeline stays conventional and auditable. Version the corpus of manuals, bulletins, rules, equipment mappings, and rights. Combine identifiers, lexical search, embeddings, metadata, and reranking in retrieval. Verify procedure, units, part compatibility, date, and jurisdiction against sources or tools. When sources conflict, prefer authority, expose the disagreement, and escalate what stays unresolved. Record source IDs, versions, retrieval stages, claims, and final decisions, so the placement itself can be replayed after an incident.
1. Construct the corpus
Version manuals, bulletins, rules, equipment mappings, and rights.
2. Design retrieval
Combine identifiers, lexical search, embeddings, metadata, and reranking.
3. Assemble context
Place equipment, alarm, current evidence, conflicts, and tool state in a stable order.
4. Verify claims
Check procedure, units, part compatibility, date, and jurisdiction against sources or tools.
5. Handle conflicts
Prefer authority, expose disagreement, and escalate unresolved evidence.
6. Preserve provenance
Record source IDs, versions, retrieval stages, claims, and final decisions.
Example
Stage 4: run a matched model and workflow bake-off
Candidates must be compared as complete workflows rather than isolated chat completions, and a published agent benchmark shows what that changes. τ-bench, released in June 2024, scores a tool-using agent by comparing the final database state against an annotated goal state. Did the reservation actually change? It adds a pass^k metric that reruns the same task to see whether the agent does it again. Its abstract reports what that found: “Our experiments show that even state-of-the-art function calling agents (like gpt-4o) succeed on <50% of the tasks, and are quite inconsistent (pass^8 <25% in retail).” Single-attempt success and eight-attempt consistency are different numbers. Only one of them describes a technician who asks the same thing on Tuesday that they asked on Monday.
The second lesson is in the fine print around a headline. Anthropic published its own τ-bench results for Claude 3.7 Sonnet on 24 February 2025. It also disclosed what those scores required: a planning-tool prompt addendum to the Airline Agent Policy, and a step limit raised from 30 to 100. The score moved with the scaffold, the prompt, and the step budget. A bake-off that records only the number has recorded the least portable part of the experiment. Fix the scaffold, the policy text, the step limit, and the retry policy across candidates, and report them beside every result.
- Quality cases: Routine alarms, ambiguous symptoms, long histories, incomplete telemetry, and conflicting bulletins, each rerun to expose inconsistency rather than scored once.
- Action cases: Work-order drafts, part reservations, calculations, denied permissions, and transaction rollback, judged on final system state rather than on the wording of the reply.
- Safety cases: Emergency signals, prohibited procedures, stale instructions, and malicious documents.
- Operational cases: Long context, concurrent technicians, offline sites, tool latency, and model failover.
- Cost cases: Token use, retrieval, tools, retries, review, queue delay, and incident exposure.
- Baselines: Current search, senior-technician workflow, forms, calculators, and deterministic rules, run through the identical scaffold and step budget.
Steps
Stage 5: design the release evaluation
Every criterion must connect to an action, gate, or operating limit. The cost of skipping that step has been measured on a widely implemented clinical model. The Epic Sepsis Model is proprietary, and it was already running in hospitals when Wong and colleagues validated it externally at Michigan Medicine: 27,697 patients, 38,455 hospitalizations. The area under the curve was 0.63 (95% CI, 0.62-0.64). 1,709 septic patients — 67% — were missed. Alerts fired on 6,971 of the 38,455 hospitalizations, 18% of them. JAMA Internal Medicine published the result on 21 June 2021, and the study's conclusion is one sentence: “This external validation cohort study suggests that the ESM has poor discrimination and calibration in predicting the onset of sepsis.”
An independent replication reached the same place from different data. Ostermayer and colleagues ran the Epic sepsis predictive model across 145,885 encounters at two county emergency departments, and published in 2024. Sensitivity was 14.7%. The median lead time was 0 minutes — a warning that arrives at the moment it stops being a warning.
Read those two results as a specification for this stage. The model was in production before either measurement existed. That is what a missing release gate looks like from the outside. Both numbers are site-level, which is why slices — equipment family, site type, user role, language, severity, evidence quality, network condition — are not an optional refinement. They were the only level at which the failure was visible. And 18% alerting is the queue-burden figure. A copilot that raises unsupported claims or escalations on that share of jobs consumes the senior technicians who are its own review capacity, whatever its average quality score says. So set task metrics on retrieval, claim support, calculations, tool validity, abstention, and technician usefulness. Add behavioral tests using paraphrases, conflicts, missing evidence, prompt injection, and long-context placement. Validate automated rubrics against senior technicians and safety reviewers. Declare thresholds for critical errors, queue burden, latency, cost, and incident readiness before the results are in. Version the cases, restrict the final sets, and admit new incidents only through controlled review.
1. Define slices
Equipment family, site type, user role, language, severity, evidence quality, and network condition.
2. Set task metrics
Measure retrieval, claim support, calculations, tool validity, abstention, and technician usefulness.
3. Add behavioral tests
Use paraphrases, conflicts, missing evidence, prompt injection, and long-context placement.
4. Validate graders
Compare automated rubrics with senior technicians and safety reviewers.
5. Declare release gates
Set thresholds for critical errors, queue burden, latency, cost, and incident readiness.
6. Protect the suite
Version cases, restrict final sets, and add incidents through controlled review.
Key idea
Stage 6: bound authority before adding autonomy
Retrieved manuals, technician notes, and supplier pages are untrusted content. The application must prevent them from becoming instructions that authorize tools or expose sensitive site data. That rule is not this course's house opinion. It is the first entry in a numbered industry list. The OWASP Gen AI Security Project's Top 10 for LLM Applications 2025 ranks prompt injection at number one, as LLM01:2025. Below it come LLM02 Sensitive Information Disclosure, LLM03 Supply Chain, LLM04 Data and Model Poisoning, LLM05 Improper Output Handling, LLM06 Excessive Agency, LLM07 System Prompt Leakage, LLM08 Vector and Embedding Weaknesses, LLM09 Misinformation, and LLM10 Unbounded Consumption. Half of that list is a description of this capstone's own architecture.
The entry also closes the escape route a grounded design is tempted to take. The whole of Stage 3 was retrieval. Retrieval is not the mitigation. OWASP writes it out under LLM01:2025: “While techniques like Retrieval Augmented Generation (RAG) and fine-tuning aim to make LLM outputs more relevant and accurate, research shows that they do not fully mitigate prompt injection vulnerabilities.”
So the controls sit in the application, not in the prompt: role-bound credentials, destination allowlists, argument validation, confirmation for consequential actions, transaction idempotency, rate limits, and circuit breakers. The model may propose. The application must authorize.
A capstone plan should also assume its attacker is a program. Perez and colleagues automated the adversarial half of this work at EMNLP in 2022. One language model wrote the test cases, and a classifier scored the target's replies. That uncovered tens of thousands of offensive replies from a 280-billion-parameter chatbot. One more requirement belongs in the memo. Article 50 of the EU AI Act requires people to be told when they are interacting with an AI system, unless that is obvious.
No increase in model capability should silently expand operational permission.
Visual
Stage 7: design for degraded operation
The product must remain safe when one component becomes slow, unavailable, or stale. Route by task and risk, using deterministic components, smaller models, or stronger models as the contract requires. Budget context so current equipment evidence outranks conversational history. Set performance SLOs over queue, prefill, first token, tools, completion, and review delay. Define fallbacks: search-only mode, cached authoritative procedures, read-only tools, or human dispatch. Canary every change. Retire safely, removing aliases, revoking credentials, preserving evidence, and identifying remaining consumers.
The canary step is the one teams treat as ceremony, and there is a dated account of what it costs. A content update crashed machines on 19 July 2024. CrowdStrike's own root cause analysis of Channel File 291, published 6 August 2024, traced the crash to a Content Interpreter that was supplied 20 input values for a Template Type declaring 21 fields. An out-of-bounds read. Microsoft put the blast radius at 8.5 million Windows devices in a statement the next day, 20 July 2024, less than one percent of all Windows machines. Less than one percent of a large enough population is still 8.5 million machines. That is the arithmetic a per-site copilot deployment shares.
What failed was not the model or the engine. It was a content update to an already validated system — the same category as this product's prompt, parser, index, retrieval corpus, and tool schema, all of which ship faster than code and usually with less staging. CrowdStrike's remedy list, written afterwards, puts staged deployment on it: “New Template Instances that have passed canary testing are to be successively promoted to wider deployment rings or rolled back if problems are detected.” Write that sentence into the serving plan for every artifact that can change without a build. Give each one a rollback path that does not depend on the component that just broke.
- 1
Route by task and risk
Use deterministic components, smaller models, or stronger models according to the contract.
- 2
Budget context
Prioritize current equipment evidence over conversational history.
- 3
Set performance SLOs
Measure queue, prefill, first token, tools, completion, and review delay.
- 4
Define fallbacks
Search-only mode, cached authoritative procedures, read-only tools, or human dispatch.
- 5
Canary changes
Limit new model, prompt, parser, index, or tool versions to controlled traffic.
- 6
Retire safely
Remove aliases, revoke credentials, preserve evidence, and identify remaining consumers.
Steps
Stage 8: connect monitoring to response
Dashboards are incomplete until every signal has an owner and action. Monitor the service: availability, tail latency, queue, resource use, and tool errors. Monitor the components: parser, retrieval, reranking, truncation, verifier, routing, and permissions. Monitor behavior: unsupported claims, abstention, tool denial, safety violations, and correction rate. Then join the delayed outcomes back to the interaction traces that preceded them — repair success, repeat visit, part return, escalation, incident, and technician override. A fluent answer and a fixed chiller are different measurements. Investigate by slice, comparing sites, devices, languages, user roles, and evidence freshness rather than reading the aggregate. And attach a playbook to each threshold: rollback, disable an action, narrow scope, notify, preserve evidence, retrain reviewers. A signal with no named owner and no triggered action is decoration.
1. Monitor service
Availability, tail latency, queue, resource use, and tool errors.
2. Monitor components
Parser, retrieval, reranking, truncation, verifier, routing, and permissions.
3. Monitor behavior
Unsupported claims, abstention, tool denial, safety violations, and correction rate.
4. Join outcomes
Repair success, repeat visit, part return, escalation, incident, and technician override.
5. Investigate slices
Compare sites, devices, languages, user roles, and evidence freshness.
6. Trigger playbooks
Rollback, disable action, narrow scope, notify, preserve evidence, and retrain reviewers.
Analogy
A flight manual is useful because authority and procedure are explicit
Cockpit systems retrieve the correct checklist, show the source revision, compute values, and require the pilot to confirm critical actions. Their value comes from coordinated evidence and bounded authority, not conversational charm. And that explicitness is a legal requirement, not a professional culture. US federal aviation regulation 14 CFR § 121.315 requires each certificate holder to provide an approved cockpit check procedure for each aircraft type. It must cover every item needed before starting engines, taking off, or landing, and in engine and systems emergencies. It also states the design constraint the whole artifact exists to satisfy: “The procedures must be designed so that a flight crewmember will not need to rely upon his memory for items to be checked.” That is the maintenance copilot's own contract in one sentence — externalized evidence, approved per equipment type, with the emergency cases written down in advance rather than recalled under load.
The artifact does not work on its own, either. A 1990 NASA report by Degani and Wiener documents that non-use of the checklist is repeatedly cited as a probable cause of accidents. A procedure that is correct and skipped, and a copilot whose citations nobody opens, fail in the same way. That is why Stage 8 monitors technician override and correction rate rather than assuming the evidence panel is read.
A cockpit also works inside a narrow, heavily instrumented envelope, and one aircraft type has one approved procedure. Field repairs bring open-ended language, changing environments, and telemetry with holes in it. The copilot has to carry far more uncertainty handling than any checklist needs.
Design the assistant as an evidence-and-control system whose language interface serves a bounded operational process.
Key idea
Stage 9: write the decision, including the option not to deploy
The final memo should state the recommended scope, rejected alternatives, supporting evidence, unresolved risks, owners, pilot limits, release gates, and stop conditions. It must distinguish measured facts from assumptions. A non-deployment or search-only recommendation is acceptable when the grounded assistant fails to outperform simpler workflows safely. That option is the explicit advice of a national cyber-security authority, not a teaching preference. Prompt injection may never be totally mitigated the way SQL injection is: that was the UK National Cyber Security Centre's argument on 8 December 2025. Its CTO for Architecture, Dave Chismon, wrote: “Rather than hoping we can apply a mitigation that fixes prompt injection, we instead need to approach it by seeking to reduce the risk and the impact. If the system’s security cannot tolerate the remaining risk, it may not be a good use case for LLMs.”
NIST supplies the reason that advice is not defeatism. Its March 2025 taxonomy of adversarial machine learning records that mitigations are adopted empirically, with no security guarantee. A control that has not failed in testing is not a control that has been proved. That is exactly the epistemic status of the allowlists, validators, and confirmations in Stage 6. A memo that presents them as closing the risk is claiming something two national bodies say is not available.
Submit a system map, data and source inventory, threat model, retrieval and tool contracts, representative eval suite, model bake-off, serving budget, monitoring plan, incident playbook, governance record, and decision memo. A reviewer should be able to trace every consequential output to evidence, policy, authority, and a recovery path. That traceability is the final standard of the course.
The strongest design is the one whose evidence supports its scope, including a deliberately narrow scope.
Key takeaways
- A grounded product begins with user jobs, evidence authority, action permissions, fallback, and explicit non-goals. ETSI TS 104 223 turns that discipline into 13 core principles and 72 trackable provisions across five lifecycle phases, and the last of them is end of life.
- Candidate designs should include deterministic baselines, grounded assistance, and bounded autonomy where justified. τ-bench separates single-attempt success, where gpt-4o stays under 50%, from consistency, where pass^8 is under 25% in retail; Anthropic's disclosure of 24 February 2025 shows a headline score moving with a prompt addendum and a step limit raised from 30 to 100.
- Consequential claims and actions require source, calculation, policy, authorization, and provenance evidence, and their placement is measured. Liu and colleagues found accuracy highest at the beginning or end of the context and degraded in the middle. Levy and colleagues found reasoning degrading far below a model's technical maximum.
- Release evaluation must cover quality, critical slices, adversarial behavior, operations, cost, and incident readiness. The Epic Sepsis Model reached production first and was measured afterwards: AUC 0.63, 67% of septic patients missed, alerts on 18% of 38,455 hospitalizations. A 2024 replication over 145,885 encounters found 14.7% sensitivity at 0 minutes of median lead time.
- Serving, monitoring, security, governance, rollback, and retirement belong in the initial architecture. An unstaged content update to an already validated system reached 8.5 million Windows devices on 19 July 2024, and prompt injection is ranked LLM01:2025 by the OWASP Gen AI Security Project, which states that retrieval and fine-tuning do not fully mitigate it.
- The final recommendation may be launch, limited pilot, redesign, search-only support, or non-deployment. The UK NCSC advises reducing risk and impact, and declining the use case when security cannot tolerate what remains; NIST notes that adversarial-ML mitigations carry no security guarantee.