Agile, Waterfall, and Lean are just a few of the project-centric methodologies for software development that you'll find in this Zone. Whether your team is focused on goals like achieving greater speed, having well-defined project scopes, or using fewer resources, the approach you adopt will offer clear guidelines to help structure your team's work. In this Zone, you'll find resources on user stories, implementation examples, and more to help you decide which methodology is the best fit and apply it in your development practices.
We’re Not Paid to Practice Scrum, but Answer 5 Product Questions
Treat AI Agents Like Long-Running Background Jobs: A Production Reference Architecture
What Is TypeSafe Jev? Jev is a model that answers questions about text with typed values and probabilities instead of generated output. It is TypeSafe’s flagship model and the first of its System One models, a class of models built “to make fast, structured decisions that software can use directly” (Reference 2). A general-purpose LLM such as GPT or Claude also understands natural language, but it answers by generating text. When a program needs a decision, the usual pattern is to prompt for JSON, parse the reply, validate it, and handle the cases where the model wrote something else. Jev removes that step. You send a state (the data to judge) and a set of named questions, and each answer comes back in the exact type the question declared. The differences that matter for a developer: No text generation. Jev does not write replies, produce code, or explain its reasoning. It returns a decision and the probabilities behind it.Typed contract. The question type fixes the shape of the answer, so there is nothing to parse and no output format variation.Calibrated probabilities. The models are trained so that their probabilities “reflect uncertainty” against real outcomes. Code can further set thresholds and route low-confidence cases to humans.Parallel, independent questions. Questions in one request are evaluated separately and in parallel. Adding questions “barely changes the response time” and avoids context-rot (Reference 1). The division of labor is simple. Your code owns the workflow, rules, and calculations. Jev supplies the semantic judgment that ordinary code cannot. Ultimately the code decides. The Three Primitives: Noul, Choice, and Score Every question has a type, instructions (the question itself) and where the type needs it, criteria (the possible answers). The question name is a key for your code only. It is not sent to the model, so the instructions must carry the full meaning (Reference 3). primitiveasksCRITERIAReturnsnoulDoes a condition hold?Optional object with true and false descriptionsnoul: probability of yes, 0 to 1choiceWhich one of a fixed set of options applies?Required map of option name to descriptionchoice, probabilities per option, confidencescoreWhere does the state sit on an ordered scale?Required ordered list of levels (up to 10)score, legend, probabilities per level, confidence Noul (Reference 4) is a yes/no question that returns the probability that the answer is yes. Phrase the question so a high value means yes, ask one condition per noul, and set thresholds in code according to the cost of being wrong. For multi-label problems, ask one noul per label in the same request. Choice (Reference 4) picks exactly one option from the set you define. The full distribution shows how the options compete and confidence summarizes how concentrated it is. Include a catch-all option for when nothing fits. Score (Reference 4) places the state on ordered levels numbered from 0. The score is the probability-weighted average of the level numbers, so it can fall between levels: The model judges each level on its own and does not see its number, so each level should describe a concrete situation rather than a degree like “moderately”. Because different distributions can give the same score, read probabilities and confidence alongside it. Confidence on choice and score describes how peaked the answer is, not whether it is correct (Reference 5). Experimenting in the Playground The fastest way to try Jev is the TypeSafe Playground (Reference 7), which runs real requests from the browser without any code. You need a TypeSafe account and an API key, which you generate in the console. Keep the same key for later API or SDK work, ideally in a TYPESAFE_API_KEY environment variable. A typical session: Open the Playground and log in.Paste the text to evaluate as the state.Add a question: give it a name, pick the type (noul, choice, or score), write the instructions and, where needed, the criteria. The questions editor also accepts JSON, so you can paste a whole questions object directly.Add more questions of any mix. They all run against the same state in one request.Run it and read every answer side by side: the value, the probability distribution, and, for choice and score, the confidence. The Playground is ideal for tuning questions before writing code. Change one word in an instruction or a criterion, rerun, and see how the probabilities move. Once the questions behave, the same JSON goes unchanged into a call as the one below (Reference 6). Plain Text POST https://api.typesafe.ai/v1/systemone From code, the same request is a single HTTP call. The example below sends a request containing only the blocking question: PowerShell curl https://api.typesafe.ai/v1/systemone \ -H "Authorization: Bearer $TYPESAFE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "jev-preview", "state": "This builds the SQL query by concatenating `userId` from the request, which allows SQL injection. Please switch to a PreparedStatement before we merge.", "questions": { "blocking": { "type": "noul", "instructions": "Does this code review comment require a change before the pull request can be merged?" } } }' The response holds one entry per question under answers, for example "blocking": {"type": "noul", "noul": 0.98}. Additionally, GET /v1/models lists the available model names. Concrete Example: Analyzing Code Review Comments Three code review comments go to Jev in three separate requests, each asking the same three questions: Is it blocking? (noul)What is it about? (choice) How constructive is it? (score). A tool built on these answers could hold a merge until blocking comments are resolved, label comments by topic, or flag a hostile tone to the other team members. The States (The Comments) requeststatea“This builds the SQL query by concatenating userId from the request, which allows SQL injection. Please switch to a PreparedStatement before we merge.”b“Nit: I’d rename tmp to pendingOrders so the loop reads better. Not a blocker.”c“Did you even run this? The cache is never invalidated, so users will see stale prices.” The Questions All three requests share this questions object. Only the state changes. JSON { "blocking": { "type": "noul", "instructions": "Does this code review comment require a change before the pull request can be merged?", "criteria": { "true": "Points out a defect or risk that must be fixed, or explicitly asks for a change before merging", "false": "An optional suggestion, nit, question or praise that does not block the merge" } }, "category": { "type": "choice", "instructions": "What is the main concern of this code review comment?", "criteria": { "bug": "Incorrect behavior, a logic error or a missing case", "security": "A vulnerability such as injection, leaked secrets or missing authorization", "performance": "Speed, memory or resource usage", "readability": "Naming, formatting, structure or style", "other": "Anything else, such as tests, documentation or a question" } }, "tone": { "type": "score", "instructions": "How constructive is the tone of this code review comment towards the author?", "criteria": [ "Hostile: insults or mocks the author", "Curt: dismissive or sarcastic, no explanation", "Neutral: states the problem without explaining or suggesting a fix", "Constructive: explains the problem and suggests a fix", "Very constructive: explains the problem, suggests a fix and is encouraging" ] } } The three primitives each do a different job here. Blocking is a yes/no condition, so it is a noul with a threshold set in code. Category is one of five exclusive options, with other as the catch-all. Tone is ordered, so it is a score from 0 (hostile) to 4 (very constructive). Expected Results Requestblocking (noul)category (choice)tone (score, 0–4)aHigh, near 1: a vulnerability and an explicit “before we merge”securityAbout 3, Constructive: explains the risk and names the fixbLow, near 0: labelled a nit and “Not a blocker”readabilityAbout 3, Constructive: suggests a rename and says whycHigh: stale prices are a real defect even without an explicit requestbugLow, about 1, Curt: the opening question is sarcastic, and no fix is offered Comment c is the interesting one. It mixes a valid bug report with a dismissive tone, and Jev should separate the two: blocking and bug on one side, a low tone score on the other. Actual Results Request a, the SQL injection comment: Jev matched all three predictions. blocking is 98% true, category is security at 100%, and tone scores 3.04: 96% Constructive and 4% Very constructive, with 97% confidence. All three runs used the jev-preview model. Request b, the naming nit: blocking is 5% true and category is readability at 100%, as expected. tone scores 3.44, higher than predicted: probability splits 56% Constructive and 44% Very constructive, so confidence drops to 63%. The friendly “Not a blocker” reads to Jev as partly encouraging, and the split is an honest signal that this comment sits between two levels. Request c, the stale cache comment: Jev separated the defect from the tone, as expected. blocking is 87% true and category is bug at 100%, while tone scores 1.3: 72% Curt, 20% Neutral, 6% Constructive, and 2% Hostile, with 72% confidence. The spread went toward Neutral rather than Hostile, so Jev reads the comment as sarcastic but not insulting. The lower blocking value (87% versus 98% for request a) also fits, since this comment reports a defect without explicitly asking for a change. Conclusion Jev turns a semantic judgment into a function call with a typed return value. Three primitives cover most needs: noul for conditions, choice for categories, and score for degrees. Each answer comes with probabilities that code can threshold, combine, or escalate. The code review example shows the pattern in miniature: one request, three independent judgments, no parsing. The Playground is the quickest way to design and tune such questions before moving them into an application. As with any model, validate the answers and thresholds on your own data before relying on them. Resources [1] – TypeSafe Introduction [2] – TypeSafe System One [3] – TypeSafe Primitives (Questions) [4] – TypeSafe Noul, Choice and Score [5] – TypeSafe Confidence [6] – TypeSafe HTTP API [7] – TypeSafe Playground and API keys [8] – The picture was taken in Zakynthos, Greece
Why Local Lift Does Not Mean System Growth A marketplace team tests a new ranking policy. On the home surface, the share of user activity rises from 30% in control to 45% in treatment: a 15-percentage-point lift. Assignment is balanced, tracking is complete, and the confidence interval excludes zero. The result looks ready to ship. Then the team expands the analysis. Search activity falls by almost 15 points, browse is unchanged, and total activity per user remains flat. The treatment did not create more engagement. It changed where that engagement happened. The home surface gained activity, but the product as a whole did not. Nothing about the local calculation is wrong. The A/B test correctly answered, “Did activity increase on home?” The mistake was treating that answer as proof that total activity increased. A precise local estimate can still support the wrong launch decision when users, suppliers, or product surfaces compete for a shared resource. Teams often respond by reaching for a switchback, cluster randomization, or separate budgets. Before changing the design, answer two simpler questions: Did the treatment increase the system total or redistribute an existing outcome?Were treatment and control isolated at the level where the shared resource operated? This article presents a practical workflow for answering both questions. It reconciles local changes against a system total using the randomized-user denominator, then screens for coupling inside the resource pools shared by the experiment arms. Why Shared Constraints Change the Meaning of Lift An ordinary user-level experiment assumes that one user’s assignment does not change another user’s outcome. This condition is part of the Stable Unit Treatment Value Assumption (SUTVA). It becomes questionable when experimental units compete through a shared constraint: The first three examples can create interference between experimental units. The fourth can create cannibalization between product surfaces even when user assignment itself is clean. These mechanisms are related, but they are not the same claim: Interference means that treatment assigned to one unit changes another unit’s outcome.Cannibalization means that a measured gain comes from a corresponding loss elsewhere in the system.Incrementality means that the treatment increases the outcome the system ultimately values, rather than changing its location or attribution. Assignment, sample-ratio, exposure, and telemetry checks still come first. Once they pass, the next review asks whether the success metric covers the system outcome and whether the randomization unit isolates the rollout effect. Use a Local-to-System Reconciliation The local-to-system reconciliation brings those checks into one review. It has five parts: Define the shared constraint and system boundary. Identify the supply, inventory, budget, attention, or capacity through which outcomes can move, and decide what must be counted for the launch decision.Measure each local change. Estimate treatment-control differences for the components inside that boundary.Reconcile the total. Aggregate those components with one denominator tied to the randomization unit.Check isolation inside shared pools. Examine whether the arms move together inside markets, regions, seller clusters, or budget groups.Classify the evidence. Treat the result as incremental, redistributive, isolation-sensitive, or inconclusive before deciding whether to ship or redesign. Figure 1: Decision flow from local lift through system reconciliation and isolation review Start with the boundary. It must correspond to the business decision, and every component inside it must use a compatible unit of analysis. A convenient total that excludes the surface likely to lose value simply moves the blind spot. Reconcile Outcomes per Randomized User Here is what the reconciliation looks like in a deterministic synthetic experiment with three mutually exclusive surfaces: The home result is real. It just does not show incremental engagement: search loses almost exactly what home gains. Calculate the treatment-control change for every affected surface using the randomized-user denominator. The system change is the sum of those component changes. The total absolute movement shows how much behavior shifted across surfaces. When movement is large, but the system change is close to zero, the treatment is primarily redistributive. The implementation preserves the randomized-unit denominator: Python arm_size = df.groupby("variant")["user_id"].nunique() surface_per_user = ( df.groupby(["variant", "surface"])["activity"] .sum() .unstack(fill_value=0) .div(arm_size, axis=0) ) system_per_user = surface_per_user.sum(axis=1) surface_delta = ( surface_per_user.loc["treatment"] - surface_per_user.loc["control"] ) system_delta = surface_delta.sum() local_movement = surface_delta.abs().sum() Counting event rows instead would let an engagement-changing treatment alter its own denominator. Per-user outcomes preserve the connection between the reported effect and the randomization design. Figure 2: Control and treatment have different surface shares while total outcome remains flat. What To Watch For Do not interpret shares without levels. A surface share can fall while its absolute activity rises if the total grows.Make the parts add up. Overlapping or incomplete surfaces do not produce a clean system total. State what is excluded, and avoid double counting.Keep the statistical review. Reconciliation is a diagnostic, not a standalone hypothesis test. Component and system estimates still need confidence intervals that respect the experiment design. Use the system total as part of the Overall Evaluation Criterion (OEC): the metric or combination of metrics used to judge experimental success and connect short-term measurement to longer-term goals (Kohavi, Tang, and Xu, Chapter 7). Home activity explains where behavior moved; it should not decide the launch when the objective is total engagement or marketplace value. Once the metric boundary is clear, the next question is whether the experiment arms were truly isolated. Check for Coupling Inside Shared Resource Pools Reconciliation can show that value moved. It cannot tell you whether treatment and control affected one another. A useful risk screen asks whether both arms remain related inside pools that share supply, inventory, or budget. Do not correlate raw market means. Large markets can have high outcomes in both arms for stable reasons unrelated to the experiment. Remove each market’s pre-period baseline and compare changes: Python market_means = ( df.groupby(["market_id", "period", "variant"])["revenue"] .mean() .unstack(["period", "variant"]) .dropna() ) control_change = ( market_means[("post", "control")] - market_means[("pre", "control")] ) treatment_change = ( market_means[("post", "treatment")] - market_means[("pre", "treatment")] ) coupling = control_change.corr(treatment_change) The synthetic data returns a correlation of 0.873. Treat that as a review signal, not an “interference detected” verdict. Common shocks, seasonality, measurement changes, and omitted market characteristics can produce the same pattern. The shared-pool coupling screen has one job: challenge the randomization unit. Define resource pools before looking at results, report the number and size of those pools, and add uncertainty or randomization inference. Even with those safeguards, the screen can identify risk in the original estimate; it cannot correct that estimate. Convert the Evidence Into a Launch Decision At this point, the team has two different forms of evidence: whether value moved across the system and whether the experiment arms may have shared the same constraint. Together, they lead to different actions: The categories should not be collapsed into a single reliability score. Redistribution and interference answer different questions. A treatment can reallocate activity across surfaces without contaminating control, or it can interfere through shared supply even when the measured system total is positive. Only an isolation problem necessarily requires a new experiment design. Match the Design to the Constraint Shared supply over time and region: Use a switchback to randomize the market state rather than individual transactions. DoorDash uses this pattern for dispatch experiments (DoorDash Engineering).Fixed campaign budgets: Separate the budgets used by treatment and control. LinkedIn describes this budget-split design for its advertising marketplace (LinkedIn Engineering).Marketplace or network spillovers: Randomize clusters rather than individuals, while accounting for the loss of power that comes with fewer independent units (Holtz et al.).Competition between listings or surfaces: Keep local metrics as diagnostics, but base the decision on incremental platform value. Airbnb describes this distinction when accounting for booking cannibalization (Airbnb Engineering). These are responses to a diagnosed constraint, not a checklist to apply to every experiment. Key Takeaways Name the shared supply, inventory, budget, or attention constraint before choosing the randomization unit.Define the system boundary before reviewing local lift.Calculate every component with the randomized-unit denominator.Compare absolute outcomes before interpreting changes in surface share.Treat shared-pool coupling as a design-review signal, not proof of interference.Redesign only when the evidence shows that treatment and control were not isolated at the level where the system operates. A p-value can tell you whether the observed treatment-control difference is compatible with a null hypothesis under a statistical model. It cannot tell you whether the experiment measured the right boundary or isolated the right unit. The final question is not whether the treatment won its local comparison. It is whether launching the treatment would make the system better. Reference Implementation The deterministic example behind the reported values is available in the runnable Python script. A broader open-source implementation of related diagnostics is available in the Expguard repository and its archived release. These implementations are optional; the workflow applies independently of either codebase. References and Further Reading Kohavi, R., Tang, D., and Xu, Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing, Cambridge University Press, 2020.DoorDash Engineering, Switchback Tests and Randomized Experimentation Under Network Effects.Holtz et al., Reducing Interference Bias in Online Marketplace Pricing Experiments.Li et al., Interference, Bias, and Variance in Two-Sided Marketplace Experimentation.LinkedIn Engineering, Budget-Split Testing: A Trustworthy and Powerful Approach to Marketplace A/B Testing.Liu, Mao, and Kang, Trustworthy Online Marketplace Experimentation With Budget-Split Design.Airbnb Engineering, How Airbnb Measures Future Value To Standardize Tradeoffs.
Code review is the highest-leverage activity on most engineering teams, yet it is also the most expensive in terms of senior-developer time. What if you could offload a first pass to an LLM that understands Java idioms, common anti-patterns, SOLID principles, and security pitfalls — and get back structured, actionable feedback before a human even opens the PR? In this post, we will build exactly that: a self-contained Java application that accepts a Java source snippet, sends it to an LLM (OpenAI GPT-4o or a locally running Ollama model — your choice), and returns a structured list of code-quality findings with severity levels and suggested fixes. What you will build: A CodeReviewAssistant Java service backed by LangChain4j, which analyses Java code and returns structured improvement suggestions — runnable in under 10 minutes on your laptop. Prerequisites ToolVersionNotesJava JDK17+Records & sealed types usedMaven or GradleAny recentMaven snippets shown hereLangChain4j0.36.xLatest stable at time of writingOpenAI API key or Ollama—We show both No Spring, no frameworks — this is plain Java, so you can drop it into any stack. Step 1: Add LangChain4j to Your Project LangChain4j is the Java-native counterpart of the Python LangChain library. It gives you a clean, type-safe API over multiple LLM providers — OpenAI, Anthropic, Azure, Hugging Face, Ollama, and more — with zero vendor lock-in. Add the BOM and the provider module you want: XML <!-- pom.xml --> <dependencyManagement> <dependencies> <dependency> <groupId>dev.langchain4j</groupId> <artifactId>langchain4j-bom</artifactId> <version>0.36.2</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- Core --> <dependency> <groupId>dev.langchain4j</groupId> <artifactId>langchain4j</artifactId> </dependency> <!-- Choose ONE provider below --> <!-- Option A: OpenAI (GPT-4o, GPT-3.5-turbo, …) --> <dependency> <groupId>dev.langchain4j</groupId> <artifactId>langchain4j-open-ai</artifactId> </dependency> <!-- Option B: Ollama (runs locally, no API key needed) --> <dependency> <groupId>dev.langchain4j</groupId> <artifactId>langchain4j-ollama</artifactId> </dependency> </dependencies> Tip — local-first development: Start with Ollama + codellama or mistral so you can iterate without burning API credits. Switch to OpenAI GPT-4o for production quality by changing one line. Step 2: Model the Review Output as a Java Record LangChain4j's Structured Output feature can instruct the LLM to respond with JSON that maps directly onto a Java type. We define our domain model first: Java // Finding.java public record Finding( String severity, // "CRITICAL" | "HIGH" | "MEDIUM" | "LOW" | "INFO" String category, // e.g. "Null Safety", "Performance", "Security" String description, // human-readable explanation String suggestedFix // concrete code-level recommendation ) {} // CodeReviewResult.java import java.util.List; public record CodeReviewResult( String summary, List<Finding> findings ) {} Using Java Records keeps the model immutable and removes boilerplate. LangChain4j will automatically build the JSON schema from these types and include it in the system prompt. Step 3: Define the AI Service Interface LangChain4j's AI Services abstraction is the cleanest part of the library. You declare an interface, annotate it with prompts, and the library generates a proxy at runtime — no boilerplate, no manual HTTP calls. Java import dev.langchain4j.service.SystemMessage; import dev.langchain4j.service.UserMessage; import dev.langchain4j.service.V; public interface CodeReviewService { @SystemMessage(""" You are a senior Java engineer performing a thorough code review. Analyse the provided Java code for: - Correctness and potential bugs - Null safety issues - Performance anti-patterns - Security vulnerabilities (injection, insecure randomness, etc.) - SOLID principle violations - Readability and naming conventions Return ONLY a JSON object matching the CodeReviewResult schema. Be concise but actionable. Severity: CRITICAL, HIGH, MEDIUM, LOW, INFO. """) @UserMessage("Review this Java code:\n\n```java\n{{code}\n```") CodeReviewResult review(@V("code") String javaCode); } How it works: The @SystemMessage sets the LLM's persona and instructions. The @UserMessage is the per-call prompt. @V("code") is a template variable — LangChain4j substitutes it at call time. Zero boilerplate. Step 4: Wire It All Together Now we create the LLM model, register our output type, and build the AI Service proxy. The entire wiring fits in one short class: Java import dev.langchain4j.model.openai.OpenAiChatModel; import dev.langchain4j.model.ollama.OllamaChatModel; import dev.langchain4j.service.AiServices; public class CodeReviewAssistant { public static void main(String[] args) { // ── Choose your provider ────────────────────────────────────────── // Option A: OpenAI (set env var OPENAI_API_KEY) var model = OpenAiChatModel.builder() .apiKey(System.getenv("OPENAI_API_KEY")) // never hardcode keys! .modelName("gpt-4o") .responseFormat("json_object") // enforce JSON mode .temperature(0.2) // low temp = consistent output .build(); // Option B: Ollama running locally on port 11434 // var model = OllamaChatModel.builder() // .baseUrl("http://127.0.0.1:11434") // .modelName("codellama") // .build(); // ───────────────────────────────────────────────────────────────── CodeReviewService reviewer = AiServices.builder(CodeReviewService.class) .chatLanguageModel(model) .build(); // ── Sample code to review ───────────────────────────────────────── String javaCode = """ public class UserService { private static Map<String, String> cache = new HashMap<>(); public String getUser(String id) { if (cache.containsKey(id)) return cache.get(id); String sql = "SELECT * FROM users WHERE id = " + id; // ... execute query return null; } } """; CodeReviewResult result = reviewer.review(javaCode); // ── Print results ───────────────────────────────────────────────── System.out.println("Summary: " + result.summary()); System.out.println(); for (Finding f : result.findings()) { System.out.printf("[%s] %s — %s%n", f.severity(), f.category(), f.description()); System.out.printf(" Fix: %s%n%n", f.suggestedFix()); } } } Step 5: Sample Output Running the above against that deliberately flawed snippet produces output like: Plain Text Summary: The code has a critical SQL injection vulnerability, a thread-safety issue with the shared HashMap cache, and returns null without documentation. [CRITICAL] Security — String concatenation builds a raw SQL query, making the method vulnerable to SQL injection attacks. Fix: Use PreparedStatement with parameterised queries: "SELECT * FROM users WHERE id = ?" with stmt.setString(1, id) [HIGH] Concurrency — HashMap is not thread-safe. Concurrent reads/writes will cause data corruption in multi-threaded environments. Fix: Replace with ConcurrentHashMap<>() or add explicit synchronisation. [MEDIUM] Null Safety — getUser() returns null without documentation. Callers have no contract to guard against NPEs. Fix: Return Optional<String> and document the empty-case semantics. [LOW] Performance — cache.containsKey() + cache.get() performs two lookups. Fix: Use cache.computeIfAbsent(id, k -> fetchFromDb(k)) instead. Going Further: Production Hardening 1. Streaming Responses for Large Files For large classes, swap the return type of your AI Service method to TokenStream and use onNext() / onComplete() to stream findings incrementally rather than waiting for the full response. 2. Memory and Conversation History LangChain4j's MessageWindowChatMemory lets you maintain multi-turn conversations — useful if you want the developer to ask follow-up questions about a specific finding. Java CodeReviewService reviewer = AiServices.builder(CodeReviewService.class) .chatLanguageModel(model) .chatMemory(MessageWindowChatMemory.withMaxMessages(10)) .build(); 3. RAG: Ground Findings in Your Own Style Guide Use EmbeddingStore + ContentRetriever to inject excerpts from your team's coding standards into every review. The LLM will then apply your own rules rather than falling back on generic advice. 4. CI/CD Integration Wrap the service in a small CLI tool (using picocli), wire it into your GitHub Actions or Jenkins pipeline, and post findings as PR comments via the GitHub REST API. This enables a first-pass AI review before any human reviewer opens the PR. Key Takeaways LangChain4j AI Services let you express LLM interactions as plain Java interfaces — no HTTP plumbing, no JSON parsing.Structured Output (records + JSON schema) eliminates fragile string parsing; you get strongly typed results directly.Provider-agnostic design means you swap one builder line to move between OpenAI, Ollama, Anthropic, or Azure with zero business logic changes.Keep API keys in environment variables — never in source code.Start local (Ollama) to iterate fast, then promote to a hosted model for production quality. Further Reading LangChain4j official docsAI Services tutorialOllama — CodeLlama modelOpenAI Structured Outputs guide
TL; DR: Deciding What to Build Is the New Job, Now that Code Is No Longer a Constraint Agentic coding has removed the cost gate that used to stop product teams from chasing every idea at once, and the constraint has moved to product judgment: the ability to tell what is worth building. AI-Assisted product discovery can prepare that judgment by reading far more customer evidence than any product person could. Such a discovery agent analyzes three families of sources, checks eight patterns, and argues both against and for your current direction. The A3 Framework has a name for this work: Assist, the agent analyzes and prepares, and the humans decide. The framework also helps to define the agent limits with the A3 Handoff Canvas – what the agent does, what the human does, which data we use, etc. – and the AI Definition of Done – what a quality AI output “looks like” – before the first run. Thesis: This article on AI-assisted product discovery explains how product teams can use AI agents to compare customer feedback, usage data, and stakeholder requests with their product vision, product goal, product roadmap, and past decisions, flagging drift, bias, and sunk costs, while humans keep the decision under the A3 Framework’s Assist category. Disclaimer: I read Charniak/McDermott’s book on “Artificial Intelligence” decades ago; of course, I use AI for research, translations, proofreading, challenging story arcs and article structures, creating artifacts such as graphics, and summarization. It is a production tool, not a substitute for thinking. Both AI Product Camps Hand Off the Part That Just Became Scarce Product people seem to be splitting into two camps over agentic coding. The first camp is celebrating: If a coding agent can build a working version of an idea in an afternoon, why argue about which of five ideas to pursue when you can build all five and let the market tell you which one sticks? (Yes, assuming you have the credits to keep feeding tokens into your coding agents.) The second camp has drawn the opposite conclusion. It expects the next agent to take over the choosing as well, preferably with a dashboard and a confidence score attached to each recommendation. Both camps are wrong for the same reason: each hands off the one capability that has just become scarce. Throwing spaghetti at the wall has become affordable in tokens. Yet it remains as unaffordable as ever in focus, maintenance, and the attention of customers who have to make sense of five half-finished features. An agent that chooses for you, on the other hand, has taken over the part of product work that nobody can delegate without also delegating the accountability for the outcome, whatever the org chart says about who owns the product. Coding Used to Be the Gate That Forced Us to Choose For decades, writing software was expensive and slow, and that expense did a job nobody had assigned to it: It acted as a sanity check and a cost gate. When building a feature took a team several weeks, the product people had to decide which idea deserved those weeks, and a weak idea often died in a prioritization discussion before anyone wrote a line of code. The gate was crude, and plenty of bad ideas slipped through anyway (usually the ones with a senior sponsor with budget authority); nevertheless, it forced a choice. Agentic coding has removed much of that gate, and the theory of constraints predicts what happens next. Eliyahu Goldratt’s five focusing steps end with a warning that is easy to skip: Once you elevate a constraint, “the weak link may not remain weakest,” as the Theory of Constraints Institute puts it, and the constraint moves somewhere else in the system. In product development, it moves to judgment: product taste, the ability to read customer evidence, and the discipline to say no to an idea that a coding agent could build by Friday. Andrew Ng made the same observation on the No Priors podcast in August 2025, as Business Insider reported: “The bottleneck is deciding what do we actually want to build.” Photography went through a comparable shift. When every frame of film cost money and darkroom time, photographers composed carefully before they pressed the shutter, so the cost of a frame forced the judgment upfront. Digital cameras removed that cost and moved the work to selecting and editing, where shooting thousands of mediocre frames mostly buries the person who has to pick the few worth printing. Product teams now face that editor’s problem: A coding agent can produce a working version of almost any idea, and someone still has to decide which version deserves a customer’s attention. Not everyone is as gifted as Steve Jobs, even though plenty of people still try to be the product manager in charge. Every Roadmap Is a Snapshot of What You Knew Last Month If judgment is the new constraint, it helps to look at the system product teams use to exercise it. The sketch below comes from my Product Owner classes, where I use it to show the challenges product people face when they manage a product backlog. (This AI-assisted product discovery article covers its left half.) The product vision sets the direction, backed by a product strategy that describes how the organization intends to turn that vision into reality. At the operational level, the strategy becomes something more tangible and nearer-term: a product roadmap or, if your team borrows from Scrum, a Product Goal. (Plenty of product teams use elements of Scrum and would deny practicing it, which is completely fine; we are not paid to practice Scrum but to solve our customers’ problems within the given constraints while contributing to the organization’s sustainability.) Together, these artifacts form the narrow neck of a funnel: Every idea, request, and data point pours into its wide mouth, and only what serves the vision and the goal passes the neck and earns a place in the work. Below the neck, the sketch shows where the surviving ideas go: into a hypotheses backlog for validation through experiments or, when an idea does not serve the goal right now, into an anti-product backlog; both destinations depend on a human decision. Each of these artifacts is a snapshot. A product roadmap, a product goal, or a product backlog represents your understanding of your customers, the market, and your competitors at the moment you wrote it down. I like to put it this way: Based on what we know now, this is our best abstraction of how we can create customer value, and it may change as we learn more. Scrum makes the same point when it calls the Product Backlog “an emergent, ordered list” in the Scrum Guide: Its composition and order change as the team learns something, which also lets the team judge earlier decisions in hindsight and correct course. A snapshot is only useful if someone compares it with what has happened since, which raises two practical questions: Where does the new information come from, and who has the time to read it? What Pours Into the Funnel, and What the Agent Has to Remember Information reaches a product team through two kinds of sources, and both have grown faster than any team can read. Passive sources: Information arrives without the product team asking for it, for example: Messages from the contact form on your websiteTickets in the customer care department’s systemDaily traffic and user behavior data from your analytics platformProduct requirements from internal stakeholders, which arrive unrequested and usually with political weight attached. Active sources: The product team goes out and gets the information, for example: Notes from continuous user interviewsIdeas from the product people themselves, who work with the product every dayObservations of users in their natural habitat, solving the problems they chose your product to help withUser research such as user story mapping sessions with internal and external stakeholders. Nobody reads all of this every week, and that is the opening for an agent. Depending on the size of your organization, the agent runs daily or weekly, reads everything that comes in, and prepares what humans need for product decisions. However, two families of sources are not enough, and in my observation, this is where the typical “AI analyzes your customer feedback” pitch stops. An agent that only reads external evidence can tell you that customers dislike a feature; it cannot tell you that you have kept funding that feature for three quarters because of what you already spent on it. For that, the agent needs a third family. Organizational memory: The record of what the organization committed to and spent, for example: Current and previous product goals and product roadmap versionsNotes from past stakeholder reviews, and release notesThe anti-product backlog, including the reason for each rejected ideaPast stakeholder decisions, and the effort and money already spent on initiatives. The agent’s job, then, is to compare external evidence (what customers, users, and stakeholders say and do) with internal commitments (what the organization decided and spent). In most organizations, this memory lives in people’s heads, Slack threads, and Jira comments rather than in a tidy decision log, so start with what exists, for example, the current and previous product goals or product roadmaps and the raw notes of your last stakeholder reviews. Questions the agent cannot answer because records are missing are a finding in themselves, because they show where your organization doesn’t document knowledge or decisions about why it said no. Another boundary is the first question the A3 Framework asks of any task: Should AI touch it at all? Counting tickets, computing the revenue at risk from billing and CRM data, and drawing the dashboard are deterministic jobs that a BI tool or a spreadsheet already handles reliably. The agent reads those computed figures next to the unstructured text and connects the two, while the tools built for arithmetic stay with the arithmetic. Eight Questions for a Weekly AI-Assisted Product Discovery Check The agent works through eight questions in three groups, and each group needs different inputs. Drift, or has the world moved since we last looked: These questions need all three families, because drift only shows when you hold today’s evidence against yesterday’s commitments: Where does the data point to a change in customer perception or needs?Does our product roadmap or our product goal still align with what real customers say and do?Have we started moving in the wrong direction because we ignored earlier feedback from the market? (The agent can only answer this one if the organizational memory shows what the team saw at the time and decided to set aside.) Gaps and pain, or what customers keep telling us: These questions run on passive and active sources plus the figures your BI tool already computes: Which functional areas do customers bring up again and again that the product does not address?Which critical usability issues do customers complain about?Which customers threaten to cancel their subscriptions or purchases because the product disappoints them, and what is our risk exposure? (The exposure figure comes from billing data; the agent links it to what those customers wrote.) Self-deception, or whether we are fooling ourselves: These questions depend on organizational memory above all: Are the product strategy, the product roadmap, or the product goal biased, built to confirm a belief about the product’s future while the market moves in a different direction?Have we fallen victim to the sunk cost fallacy? In the self-deception group, an agent does better than a tired human reader. People usually struggle to spot bias in their own plans, and what they’ve already spent tends to argue louder than evidence of what customers want. Both patterns are old acquaintances; I described them, together with the persona-driven self-fulfilling prophecy and the habit of ignoring sales and customer support, in Product Discovery Anti-Patterns Leading to Failure. The exciting new part is that an agent can check for them every week, across every source, without getting tired or diplomatic. In AI-Assisted Product Discovery, the Agent Prepares the Decision, and the Product Team Makes It In terms of the A3 Framework, everything so far is Assist, which the original A3 Framework article sums up as “AI expands options. You own the outcome.” The agent reads the sources and prepares the briefs, and the product team decides. The moment the agent moves an idea into the hypotheses backlog, kills a roadmap item, or reorders the product backlog on its own, the work has crossed into Automate, which is the wrong category for a decision that depends on product judgment, which is the capability the shifted constraint now demands from humans. However, the preparation itself has a catch. Language models tend to agree with the person asking. Recent research suggests the problem has not gone away: Seo, Atanasova, and Augenstein tested 14 models on 42K questions and found that “all models are susceptible to user opinions regardless of size,” with models “most influenced by how confidently an opinion is stated, whom it is attributed to” (Claim Framing as a Driver of LLM Sycophancy, October 2026). A product goal handed to an agent is exactly that: a confidently stated position backed by the organization’s authority. So, I suggest running the analysis as two briefs. The first brief collects the evidence for the current direction, while the second brief starts from the assumption that the product goal is wrong and builds the strongest case against it from the same data, citing every source. The humans then read both side by side. (The study documents the agreeable behavior; the two briefs are my countermeasure, and they apply an old rule of mine: Never accept a model’s first answer.) The A3 Handoff Canvas is where the team writes this down before the first run: The inputs name the three families of sources, the outputs name the two briefs, and the stop rules say what the agent must never do, namely rank ideas, recommend a decision, or move anything. The AI Definition of Done then states what each brief must contain before anyone discusses it, and the difference is easiest to see with question 8, applied to a hypothetical custom reporting module that has been on the roadmap for a while. An Automate verdict, which is what you do not want: “The custom reporting module shows sunk cost characteristics. Recommendation: stop development.” What the product team reads instead, assembled from both briefs, which is what the AI Definition of Done asks for: Commitment: “The module has been on the product roadmap since the start of the year and received development time in every release cycle since.” (Source: roadmap versions)Spending: “Most of the recent iterations went into report templates and export filters.” (Source: release notes)Customer evidence: “Requests for the module come from long-standing accounts that want custom CSV formats; recent onboarding interviews do not mention it.” (Sources: support tickets, interview notes)Case for continuing (first brief): “Enterprise accounts up for renewal list custom reporting as an open requirement.” (Source: stakeholder review notes)Case for stopping (second brief): “Customers who canceled during the period cited friction in the core workflow, and observed users export raw data to spreadsheets instead of using the in-app reports.” (Sources: cancellation tickets, observation notes)Open question for the product team: “Can scheduled exports cover the enterprise renewals without funding another cycle of module development?” What happens next is a human call, and the options sit on the left side of the sketch: A finding can become a hypothesis in the hypotheses backlog and go to validation through an experiment; it can land in the anti-product backlog together with the reason why it does not serve the product vision or the product goal right now; it can trigger a change of the product goal itself; or the product team can dismiss it. Each of these destinations is a decision that the people accountable for the product make, preferably together. Five Ways AI-Assisted Product Discovery Goes Wrong A rule I apply to every AI initiative holds here as well: Do not apply AI on top of dysfunctional systems or processes. If a product team has no hypotheses backlog, runs no experiments, and keeps no anti-product backlog, the agent’s briefs land on nothing, and the following failure modes show what that looks like in practice: The loud-customer bias: Passive sources over-represent vocal customers, while customers who quietly cancel rarely fill out a contact form first. An agent reading tickets will give the most weight to whoever writes the most tickets, unless the product team tells it to also look at who stopped writing, for example, in usage data from accounts that stopped logging in.Sanitized records: When the notes of a stakeholder review say “stakeholders loved the demo” because nobody wanted to write down the objections, the organizational memory the agent reads has already been edited for comfort. The opposing brief can only argue from the records it receives, so a sanitized record produces a convincing case for the wrong conclusion. (Anyone who has watched a review turn into a performance knows how often this happens, or, to use a German proverb: Wer schreibt, der bleibt.)Report theater: The briefs look polished, people read the summary, and nobody opens the evidence. Polished AI artifacts quickly fool people into believing that the AI is doing the real job, and a discovery check that nobody questions may be worse than none, because it lends a bad decision the authority of data.The HiPPO override: The agent flags a misalignment, a stakeholder requirement with enough political weight wins anyway, and three weeks later, nobody reads the briefs anymore.The authority mismatch: When an agent holds customer evidence against commitments, drift at the operational level often points to a flawed assumption at the strategic level, in the product vision or the strategy. A product manager who can change the product goal but not the strategy then receives a finding without the authority to act on it, and the brief travels from inbox to inbox until it is out of date. So decide before the first run who receives which kind of finding and who takes a strategic finding to the people who own the product strategy; the task split of the A3 Handoff Canvas is the place to write that down. Amazon’s Fire Phone shows how expensive this gets when the highest-paid person is the CEO: Fast Company’s Austin Carr interviewed more than three dozen current and former employees, and a former engineering head said of the phone’s Dynamic Perspective feature, “We poured surreal amounts of money into it, yet we all thought it had no value for the customer,” adding, “Whenever anyone asked why we were doing this, the answer was, ‘Because Jeff wants it.'” (GeekWire’s summary of the Fast Company report, January 2015). Three months after launch, Amazon CFO Tom Szkutak disclosed a $170 million write-down, “primarily related to Fire Phone inventory valuation and supplier commitment costs” (GeekWire, October 2014). (The price did its share, too; Amazon’s devices chief, David Limp, later told Fortune, “We didn’t get the price right.”) AI-Assisted Product Discovery – Conclusion: Run One Discovery Check Before Your Next Stakeholder Review You do not need an elaborate setup to try this. Take the sources you already have, for example, last month’s support tickets and contact form messages, the notes from your last ten user interviews, and last quarter’s product roadmap, and run questions 2 and 7 as two briefs against your current product goal. Then check the evidence inside the product team first, in your next refinement session or a dedicated discovery check, before anyone outside the team sees it: Open the sources, look for what the agent misread, and decide which findings you are willing to defend. Only once the team owns the argument does it go to the next stakeholder review, as a token for discussion, never as a decision. And when your agent’s second brief makes a convincing case next month that customers have stopped caring about the feature your product roadmap is built around, who in your organization has the authority to act? Questions This Article on AI-Assisted Product Discovery Answers Why Does Product Judgment Become the Bottleneck When AI Agents Write Code? Agentic coding removed the cost gate that once forced product teams to choose between ideas. When building a feature took weeks, weak ideas often died in a prioritization discussion; now a coding agent can build a working version of an idea in an afternoon. As Goldratt’s theory of constraints predicts, the constraint moves elsewhere, to product judgment: deciding which idea deserves customers’ attention. Should an AI Agent Make Product Decisions? No. Under the A3 Framework, product discovery analysis belongs in the Assist category: the agent reads customer feedback, usage data, stakeholder requests, and the organization’s past decisions and prepares the evidence, while the product team decides. The A3 Handoff Canvas records the agent’s stop rules before the first run: no ranking of ideas, no recommendations, and no moving items in the product backlog. What Data Should a Product Discovery Agent Analyze? A product discovery agent needs three families of sources. Passive sources arrive unasked: contact form messages, support tickets, analytics data, and stakeholder requirements. Active sources come from the product team’s own work, such as user interviews, observations, and user story mapping. Organizational memory covers past product goals, roadmap versions, rejected ideas with reasons, and money already spent; without it, the agent cannot detect sunk costs. How Do You Stop an AI Agent From Confirming Your Roadmap? Run the analysis as two briefs. The first brief collects the evidence for the current product goal; the second assumes the goal is wrong and builds the strongest case against it from the same data, citing every source. Language models tend to agree with the person asking: Seo, Atanasova, and Augenstein (2026) found all 14 models they tested susceptible to user opinions, regardless of size. How Does AI-Assisted Product Discovery Fail? They fail in five recurring ways: they overweight vocal customers, read meeting notes sanitized for comfort, produce polished briefs nobody checks, lose to the highest-paid person’s opinion, and deliver strategic findings to people without strategic authority. Amazon’s Fire Phone shows the HiPPO override at the top: engineers kept building a feature they believed had “no value for the customer” because Jeff Bezos wanted it.
TL; DR: The Product Backlog Refinement Agent and the Risk When a Suggestion Becomes a Decision Preparing a refinement session is tedious, and AI is good at the tedious part: reading every Product Backlog item, every repeated comment column, and the team’s own records on the afternoon before. The risk sits elsewhere. A refinement agent asked to “help with refinement” can take the conversation away from the team without writing a single acceptance criterion: “suggesting” to the Product Owner or Product Manager which items to close, merge, split, or create is enough, and the questions the team was supposed to work out arrive in the brief already answered. The remedy is a boundary decided before the first run: the agent marks evidence and asks questions, the Product Owner checks the brief and sets the agenda, and the team refines. Writing that boundary into an A3 Handoff Canvas, together with what the agent reads and who checks its output, turns a good intention into a rule the agent follows and the Product Owner can verify. Thesis: This article explains how Product Owners and Product Managers can use AI to prepare Product Backlog refinement without pre-empting the team’s conversation: four evidence checks, a four-part test separating suggestions from decisions, written boundaries, and human verification of the agent’s brief. Disclaimer: I read Charniak/McDermott’s book on “Artificial Intelligence” decades ago; of course, I use AI for research, translations, proofreading, challenging story arcs and article structures, creating artifacts such as graphics, and summarization. It is a production tool, not a substitute for thinking. The Danger of a Preparation Turning Into a Decision The familiar worry about AI in Product Backlog refinement is that a model writes the Product Backlog items, the acceptance criteria, and the estimates, and a tired team nods them through on a Tuesday afternoon. The worry is justified; however, it describes the easy case, because a drafted acceptance criterion is visible, and a team would usually notice that someone else did its homework. The more challenging case looks like help. Consider a hypothetical brief by a refinement agent that contains no descriptions, no acceptance criteria, and no new order, yet recommends closing one item as a duplicate, splitting another, creating a third, and calling four items “ready candidates” for the next Sprint. Every line reads as friendly advice to the Product Owner, and every line settles a question before the team has discussed it. A recommendation decides nothing until someone accepts it and acts on it. Once it sits on the agenda, however, the team is likely to discuss the recommendation instead of the question behind it, and that is how preparation quietly turns into a decision. It sneaks in through the back door, feeding on the human desire to avoid unnecessary work when organizational pressure is already high. What Refinement Is For, and What Preparation Should Leave Alone The Scrum Guide describes refinement as “an ongoing activity to add details, such as a description, order, and size,” which captures the mechanics and leaves out the purpose. I see refinement as the final part of product discovery, once hypothesis validation has been established: the team asks whether an item is really the best use of its time or whether something else would create more value for customers. A Product Backlog item is a token for that discussion, an invitation to align, and a good session ends with shared understanding sufficient to make the next investment decision, including the decision not to build something. Many teams hold a regular session for this, and often those sessions turn into a hunt for problems someone could have spotted the day before: an item a stakeholder insists on moving to the top, a backlog item without acceptance criteria that everyone expected someone else to write, an item nobody has touched for 6 months. Preparation exists to spare the team that kind of administrative work, and reading a Jira export and the team’s notes on the afternoon before is exactly the kind of thorough, tedious work an AI agent does well. The question is where preparation ends. In September, I described ten anti-patterns that get worse when teams add AI to a dysfunctional Product Backlog process, “Refinement Without the Team” among them, and an assistant that hands the Product Owner ready-made resolutions is a polite version of that anti-pattern: the team still meets, yet the decisions it was supposed to reach already arrive pre-made. In my view, the most critical consequence of dysfunctional refinement is a team that loses its ability to have productive discourse. Typically, building the wrong thing follows; think of lack of return on investment and opportunity costs. So my rule for such a refinement agent is short: mark, suggest, never solve. The agent marks what the team needs to talk about and may suggest what to discuss, and solving stays the team’s job. Four Things a Product Backlog Refinement Agent Can Check, and What It Cannot Know Of the 27 Product Backlog and refinement anti-patterns I have described, many are behavioral and leave no trace in a Jira export. Four do leave traces, provided the agent reads the team’s own records next to the export: the Product Goal, the product roadmap with its change log, the anti-product backlog, the notes from previous Sprint Reviews, and the actions from the last few Retrospectives. Readiness The agent looks at items early in the current order and reports what the records contain: whether an item states a problem or an intended outcome, whether it lists open questions, and whether a Product Backlog item waits for an open spike for technical clarification. Whether that is enough for a useful conversation remains the Product Owner’s judgment. A missing acceptance criterion at the start of refinement is no defect; it is an agenda question, because the Product Owner will have ideas about how an item should meet the desired outcome, and the team negotiates the criteria together by the end of refinement. Being early in the order does not preselect an item for the next Sprint, either: the order reflects the team’s best current judgment of how to use its time, and in Sprint Planning, the team first agrees on the Sprint Goal, and then the Developers select Product Backlog items they deem necessary to accomplish the goal. Goal Fit and Prioritization by Proxy The agent compares the Product Backlog with the Product Goal, the roadmap, and the anti-product backlog, which lists the ideas and requests the team decided not to build, either not now or not in this product, with the reason for each decision. It marks items that serve no part of the Product Goal and items that revive an idea the team already rejected. It also marks prioritization by proxy, which an export reveals only indirectly, because no outsider has write access to the Product Backlog: a stakeholder can neither create an item nor change its position. What the export does show is a member of the Scrum Team, usually the Product Owner, creating or moving an item on a stakeholder’s behalf: a comment such as “per the sales director’s request,” a label such as “mgmt-request,” a creation date right after an escalation, and no discovery decision and no link to the Product Goal behind the item. An item that skipped discovery because someone with political weight asked for it was never put to the validation test. However, the agent cannot know what the conversation behind the item looked like, or whether a rejected idea deserves a second look; that takes the people involved. Outdated Items Items nobody has touched for months, or that still name a release that shipped long ago, deserve a look, because a Product Backlog that turns into a storage for ideas hides the work the Product Goal needs. Age is a signal for inspection, nothing more: an untouched item can be the very work the Product Goal depends on, and a refinement agent that simply sorts by the “Updated” column will happily declare it dead without inspection. Missing Work The Scrum Guide calls the Product Backlog “the single source of work undertaken by the Scrum Team.” The agent can hold that claim against the team’s records: open items from the Sprint Review, Retrospective actions, and even work done outside the Sprint Backlog. A discrepancy is a finding. Whether it leads to a new item is for the Product Owner and the team to decide, because the work may sit in another team’s Product Backlog, stay outside it on purpose, or already be resolved. This check is also why the agent needs more than the export, since an export cannot show what is missing from it. For any of the four checks, “no supported finding” and “insufficient evidence” are valid results. However, the teams that would gain most from this preparation often keep the fewest records: no anti-product backlog, no product roadmap change log, Sprint Review notes that say little more than “stakeholders loved what we built,” and the reasons behind past decisions stored in the heads of the Product Owner and a few senior engineers, or buried in Slack threads. Such a team will get a brief full of “insufficient evidence.” That brief is still a finding because it shows where the team has no memory of its own decisions. Also, it helps only when people read it as a statement about their records rather than a failed run. Otherwise, the team has added AI on top of a dysfunctional system. A small start is enough to make the checks useful: the Product Goal, the last Sprint Review notes, and the last Retrospective actions all cover readiness and missing work, and a short list of recent “no” decisions, one line of reason each, gives the goal-fit check something to work with. In the agent’s instruction, name only the records the team actually keeps, so the brief does not report the same missing roadmap change log on every run. Where a Suggestion Turns Into a Decision A hypothetical example shows where this red line runs; the item keys, people, and dates are invented. A Jira export taken on Monday shows EXP-187, “Export for enterprise accounts,” created last Tuesday by the Product Owner, in the second position of the order, with the Priority field set to “Highest,” a one-line description, and the Product Owner’s own comment “Per the sales director’s request, moved to the top; a big customer is waiting.” The roadmap’s change log keeps the export feature in “Next,” no discovery decision mentions the request, and EXP-112, a CSV export item from June, may cover part of the same need. A brief that does its job marks this as prioritization by proxy and cites its sources: the comment, the creation date, the position in the order, the roadmap entry, and the missing discovery decision. It adds what it cannot know (which customer, and what problem that customer has), and it may suggest that the Product Owner revisit the request with the sales director before refinement. A brief that crosses the line writes “Close EXP-187 as a duplicate of EXP-112,” or “Move EXP-187 back down the order,” or “Ready candidates for the next Sprint: EXP-187.” Each of these settles a decision that belongs to the Product Owner, however helpful it sounds. What follows is the Product Owner’s work, and most of it happens outside refinement. The sales director’s request is exactly what my discovery article describes as a passive source: “Product requirements from internal stakeholders, which arrive unrequested and usually with political weight attached.” It goes through the funnel I described in AI-Assisted Product Discovery, where only what serves the general product vision and the current product goal passes the neck and earns a place in the work: it may become a hypothesis to validate with an experiment, an entry in the anti-product backlog with its reason, or an item the Product Owner places where it belongs. Until then, EXP-187 has no claim on the second position, until the Product Owner reconsiders the order of the Product Backlog. A sales director who can push an item to the top through the Product Owner points to an impediment for the Product Owner and the Scrum Master. Also, it is not an agenda item for the Developers, as refinement time stays reserved for work that has legitimately entered the Product Backlog. Questions that belong in refinement need the same discipline. Take a story that waits for a spike that is still open: “What do we need to learn from the spike before we can negotiate the story’s acceptance criteria?” leaves the conversation to the team. “Should we split the story by permission level?” ends with a question mark, yet it carries a solution, and it leaves the team to say yes or no to an answer the agent chose. A valid refinement suggestion by an AI agent has to pass four tests: It rests on the supplied records,It makes the uncertainty visible,It leaves materially different answers open, andIt does not assume the disputed resolution. Why be this strict about a polite suggestion? A ready-made answer shapes the judgment of the person who reads it. In two preregistered experiments with 2,582 participants, Sterling Williams-Ceci, Mor Naaman, and colleagues found that people writing about societal issues with a biased AI writing assistant shifted their attitudes toward its position, most of them unaware of the bias and its influence, and warnings before or after the task did not mitigate the shift (Biased AI Writing Assistants Shift Users’ Attitudes on Societal Issues, Science Advances, 2026). The study tested autocomplete suggestions during writing, which influenced people more than similar arguments shown as a static list. An AI-assisted refinement brief is a static list, so the study is a reason for caution and does not prove that a brief anchors a Product Owner. Writing the Line Down Before the First Run Writing the red line down before a refinement agent runs for the first time turns it from an intention into a rule. The A3 Handoff Canvas is the place for it: it records what the agent reads, what its brief looks like, who checks it, what the agent must never do, and the last part goes into the agent’s instruction word for word. For an AI-assisted refinement agent, the stop rules read: Never write acceptance criteria,Never estimate,Never split, reorder, or remove an item, and never move one to the anti-product backlog,Never advise closing, merging, splitting, creating, or editing an item; ask the team a question insteadNever propose what goes into the next Sprint or what the Sprint Goal should beNever invent a source, a reason, or a figure. (If a record needed for a check was not supplied, cannot be located in the supplied material, or cannot be read, state that limitation under “What I could not check.” Do not infer that the record does not exist. Do not treat an experiment, proposal, or unverified note as a completed decision or shipped release; state the exact status recorded in the source.) Three of these rules deserve a word. Acceptance criteria stay out because the team negotiates them by the end of refinement, and an agent’s draft would preempt that negotiation; a different workflow can still help with criteria after the team has talked. Estimates stay out because their value lies in the Developers’ discussion that reveals diverging ideas of the effort before work starts, as I argued in Estimates Are Useful, Just Ditch the Numbers; the number was never the point. And the last rule addresses a quieter error: a model that reads a planned experiment as a commitment, or a hypothesis as a result, turns the team’s open question into a fact nobody decided. In terms of the A3 Framework, this preparation is Assist: “AI expands options. You own the outcome.” The refinement agent works from a read-only export, so it cannot change the Product Backlog even if a rule fails. And if you already run an agent for product discovery, it needs its own Handoff Canvas, because it reads different inputs, delivers different output, and stops at a different line; I consider that AI transparency at the operational level. The Product Owner Routes Every Finding A brief that sounds thorough invites a dangerous shortcut: forwarding it to the team unread. Polished AI artifacts quickly fool people into believing that the AI is doing the real job. So the Product Owner opens the item or record behind every finding that could change the agenda and then looks at a few things the brief did not flag, for example, the items nearest the top that it never mentions, because a brief cannot report its own omissions. Then the Product Owner decides where each finding goes, and only some of them belong in refinement: Settled by the Product Owner: Housekeeping, such as an obvious duplicate created by mistake or a release field nobody updated, and restoring the order of the Product Backlog.Sent into discovery: Requests that skipped the funnel, such as the sales director’s export, and rejected ideas whose revisit condition may have occurred.On the refinement agenda: Questions that need the team’s knowledge, such as what a Product Backlog item needs before the team can negotiate its acceptance criteria.Raised as an impediment: Systemic causes, such as stakeholder pressure that bypasses discovery or records the team does not keep, for the Product Owner and the Scrum Master, or for the next Retrospective. Sharing the agenda with the Developers and the Scrum Master before the session gives them the chance to add the questions the brief missed. If a brief proposes resolutions anyway, correct the instruction and run it again; if it keeps failing, prepare the agenda by hand, the way the Product Owner hopefully did before the agent existed. The remaining failure mode relates to the Product Owner: Treating the brief as sufficient grounds to settle a question that needs the team’s knowledge brings back the very problem the stop rules were meant to prevent, only with a human signature. The brief must not become a substitute for a discussion that has not happened. Conclusion: Try It Before Three Refinements, Then Decide Treat the first runs as a local experiment. Note how long your usual preparation takes, then run the refinement agent on a sanitized export, in an AI account your company has approved, before three or four refinements. Record the total time, including checking the findings that proved useful, the findings the records did not support, and the omissions you noticed, knowing you won’t catch all of them. If checking and correcting the brief keeps taking longer than preparing the agenda by hand, stop, because the agent then costs more than it saves. Otherwise, ask the team whether refinement gained time for the critical discussion, and compare the results with your usual preparation; a few sessions give you the basis to decide whether to continue, adjust, or stop. If you would rather practice first, the AI4Agile Online Course v4, which launches on November 27, 2026, includes an exercise in which you build this refinement preparation agent: you fill its A3 Handoff Canvas, run it on a 40-item Product Backlog export and the team records of MegaBrain.io, the course’s fictional startup, check its brief, and set the Product Owner’s agenda before comparing your decisions with my worked solution. When the next brief arrives on your desk the afternoon before refinement, which of its suggestions already contains an answer your team has not given yet? Key Questions This Article on the Product Backlog Refinement Agent Answers How Can AI Help a Product Owner Prepare Product Backlog Refinement? A refinement agent can read the Product Backlog export and the team’s records on the afternoon before refinement and mark Product Backlog anti-patterns: items not ready for a conversation, items that serve no part of the Product Goal or entered at a stakeholder’s request without a discovery decision, outdated items, and work the Product Backlog does not show. The Product Owner checks the brief and routes each finding; the team refines. What Can an AI Agent Check in a Product Backlog Before Refinement? Four checks leave traces in an export and a team’s records: readiness, goal fit, outdated items, and missing work. Prioritization by proxy shows only indirectly, because no outsider can write to the Product Backlog: an item the Product Owner created or moved up at a stakeholder’s request, visible in comments, labels, and a missing discovery decision. None of the checks can establish what the team understands or still wants; the people involved need to do that. How Do You Tell an Open Question From a Disguised Recommendation? A question passes four tests when it rests on the supplied records, makes uncertainty visible, leaves materially different answers open, and does not assume the disputed resolution. “Should we split the story by permission level?” fails despite its question mark, because it carries a solution. “What do we need to learn from the spike before we can negotiate the acceptance criteria?” leaves the answer to the team. Should a Refinement Agent Write Acceptance Criteria or Estimates Before the Team Refinement? Not in a preparation brief. The Product Owner brings ideas about how an item should meet the desired outcome, and the team negotiates the acceptance criteria together by the end of refinement; a refinement agent’s draft would preempt that negotiation. The value of an estimate lies in the Developers’ discussion of diverging ideas of the effort; the Scrum Guide assigns sizing to “the Developers who will be doing the work.”
We run an LLM pipeline that summarizes support tickets for a large network operations team: it reads long, noisy ticket logs and produces short summaries, customer status notifications, technician ticket summaries, and regional executive rollups. It works. But once it was running steadily, a quieter problem showed up. On an ordinary day, summarizing every ticket with a top-tier model and a full log was more expensive and slower than it needed to be. Four levers — incremental summarization, trimming, right-sizing, and parallel execution — are compounding to cut blended LLM cost by roughly 60%. Keeping the pipeline alive during traffic spikes is a separate story. This one is about the bill and latency on a normal Tuesday, and the four changes that, so far, are cutting our LLM cost by roughly 60% and making summaries faster while protecting quality. Where the Cost and the Milliseconds Actually Go Before optimizing anything, it helps to look at the anatomy of a single summarization call. It costs you two things — tokens and time — and both come from the same handful of places: Input tokens: The ticket log, plus the context we retrieve from our vector store, plus the prompt. For a summarizer, this is the giant. Logs are long; the summary is a few sentences.Output tokens: The summary itself is small, but output tokens are the most expensive per token, and generation time scales with how many you produce.The model: Price per token varies enormously between a flagship model and a smaller one.Round-trips: Doing calls one at a time serializes latency that doesn't need to be serial. That anatomy hands you four levers, roughly in order of leverage: stop re-reading what you already summarized (incremental summarization), trim what's left (dedupe and truncate), use a cheaper model where quality holds (right-size), and stop waiting on calls one at a time (concurrency). Lever 1: Incremental Summarization — Stop Rereading the Whole Log A ticket log is not static. A busy incident ticket accumulates thousands of log lines over its life, and every status update needs a fresh summary. The naive approach re-sends the entire log to the model on every regeneration, so the same thousands of lines are paid for again and again, and the token bill grows with the ticket. Instead, we cache each ticket's latest summary in Redis and treat it as running state. When the ticket updates, we send the model the cached prior summary plus only the new log lines since we last ran, and ask it to fold that delta into an updated summary. The model reads a short summary and a small delta rather than the full history — and because logs can run to thousands of lines, this was where the biggest token savings came from. The guardrails: we periodically force a full re-summarization so small errors don't compound across many incremental updates, and the cached summary is always refreshed against new log lines rather than served stale. This is the classic rolling summarization pattern — cheap to run, and it turns an ever-growing log into a bounded, near-constant cost per update. Incremental summarization: instead of re-sending the entire growing log on every update, we send the cached summary plus only the new lines - so cost stays flat as the ticket grows. Lever 2: Token and Context Trimming — Make Each Call Smaller Incremental summarization stops us re-sending the whole history; trimming shrinks what's left on the calls we do make. Because input tokens dominate a summarizer's cost, we squeezed the rest: Deduplicate the log: Machine-generated logs repeat the same alarm and heartbeat lines over and over. Collapsing those duplicates removed large redundant blocks before they ever hit the model.Truncate to what matters: Instead of shipping a ticket's entire history, we cap the window to the most recent and most relevant events.Cap the retrieved context: More retrieved chunks from the vector store is not automatically better - each one is pure input cost. We limited how many we pull.Cap max output tokens: Summaries are short by design, so a hard output ceiling prevents runaway generations and, because generation time tracks output length, directly trims latency. Together, these cut a large share of the remaining input on every call. Fewer tokens in and out is the rare optimization that reduces cost and latency at the same time. Lever 3: Model Right-Sizing — Pay for Quality Only Where It Matters Not every ticket deserves the flagship model. We select the model per ticket from business signals — severity, number of customers impacted, and revenue impact — so premium-model tokens go to the tickets that actually warrant them (major outages, high-value customers) while routine tickets get a smaller, cheaper, and faster model. The lowest-severity tickets skip the LLM altogether. A non-LLM extractive summary (key fields, error counts, first and last events) costs zero tokens. It's the same severity tiering we use to keep the pipeline resilient — here it doubles as the cheapest tier of all. The guardrail is a quality bar: before trusting a cheaper tier for a class of tickets, we validate its summaries against the flagship's, and when the signal is ambiguous, we route up, not down. Right-sizing is a double win: smaller models cost less and respond faster, so it reduces both spend and typical response time. Lever 4: Parallel Execution — Stop Waiting in Line Summaries are independent of one another, so processing them one at a time was leaving latency on the table. Running calls concurrently (async) collapses the wall-clock time to clear a burst of tickets and sharply improves perceived latency when several land at once. The one caveat is that unbounded concurrency will happily blow past your provider's tokens-per-minute limit. So concurrency runs under a shared token budget: as many calls in flight as the budget allows, and no more. You get the throughput without tripping the ceiling. Results No single trick did it; the levers compounded. Together they're bringing our blended LLM cost down by roughly 60% so far, while making summaries faster and steadier under load: leverwhat changed Incremental summarization Full log on every update → prior summary + new lines only Trimming Deduplicated and truncated input, capped output Right-sizing Flagship-for-everything → cheaper model by severity; lowest tier skips the LLM (extractive) Concurrency Serial calls → parallel, under the token budget Blended LLM cost ~60% lower (early results) The biggest surprise wasn't an exotic trick — it was simply not paying to re-read tokens we had already summarized. The other three levers compounded on top. What We Watch For Summary drift: Because each update builds on the previous summary rather than the raw log, a small error can propagate across updates. A periodic full re-summarization from the original log resets any accumulated drift.Quality regressions: Over-truncation can drop the one log line that mattered, and a too-cheap model can miss nuance. We keep a periodic eval/spot-check, so cost cuts don't quietly erode quality.Don't optimize noise: Measure first; a low-volume path rarely repays the complexity. Takeaways Measure where the tokens go – For a summarizer, input dominates - optimize that first.Biggest wins first – Reuse prior summaries instead of re-reading the whole log, trim what you do send, and right-size the model. Exotic tricks come later.Concurrency is a latency lever, not a cost lever – and it must respect your rate limits.Guard quality whenever you trim or downshift – pair every cost cut with an eval.
A few months into a large-scale legacy-to-cloud migration for a Fortune 50 insurance carrier, I found something that had been sitting quietly in our codebase for a while: application code that was manually re-checking JWT claims — signature, issuer, audience, expiry — that Spring Security's OAuth2 Resource Server had already validated at the framework level, before the request ever reached that code. Nobody had done this carelessly. Each addition, on its own, looked like good security hygiene. That's exactly why it survived review for as long as it did. Why This Happens So Easily A JWT is a self-contained, signed structure carrying its own claims. Validating untrusted input by hand is a deeply ingrained instinct for engineers, and for good reason — it usually is the right instinct. The problem is visibility. When a developer writes if (claims.getExpiration().before(now)), a reviewer can point at that line and confirm the check exists. What's much harder to see is the framework machinery quietly doing the exact same job, correctly, one layer up. Spring Security's OAuth2 Resource Server support validates signature, expiry, issuer, and audience (when configured) in line with RFC 7519 and RFC 8725. Its JwtAuthenticationProvider runs these checks on every incoming token, and as the identity provider rotates its signing keys, it automatically re-fetches and re-validates against the new keys — no application code involved. Almost none of this is visible unless you've actually read the framework internals, which is exactly why teams tend to reimplement it instead of trusting it. The audience claim was the clearest example in our case. It identifies which resource server a token is meant for, and the framework exposes it as a single config property. We'd been treating it as something that needed hand-written comparison logic — when really, the value had just never been wired into configuration in the first place. The fix wasn't more code. It was one line of YAML. What We Changed We removed the manual validation entirely and let Spring Security's Resource Server own both authentication and authority mapping: YAML spring: security: oauth2: resourceserver: jwt: issuer-uri: https://login.microsoftonline.com/{tenant-id}/v2.0 audiences: api://{application-id} authorities-claim-name: roles authority-prefix: GRANT_ That block replaced manual signature verification, issuer checking, expiry checking, audience checking, and — on Spring Boot 3.3+ — the hand-written role-to-authority converter too. No JwtAuthenticationConverter, no custom Bean. The framework builds the authority mapping straight from the roles claim and applies whatever prefix you configure. (GRANT_ isn't a framework requirement, by the way — pick anything, as long as it matches what your @PreAuthorize expressions expect downstream.) The Objection We Had to Take Seriously This didn't get waved through. It took a few weeks of real back-and-forth, because the pushback was a legitimate security position, not just resistance to change: don't trust any single layer — verify independently, everywhere. Concretely: if issuer-uri got misconfigured — pointed at a stale tenant, or worse, something attacker-influenced — the Resource Server would faithfully validate every token against the wrong authority, and nothing in a minimal-code setup would catch that. A hardcoded, independent check plausibly would. Nobody disputed that the risk was real. The actual question was which layer should own catching it. Our answer: a hardcoded application-layer check and a misconfigured deployment value are different failure modes, touched by different people, on different release cadences. Duplicating validation in code doesn't actually protect against a bad issuer-uri — it just adds a second place that can also drift out of sync. Instead, we added a CI/CD gate that asserts the deployed issuer-uri and audience resolve to the expected tenant, and fails the pipeline on mismatch, on every deploy. Is that still "a second check"? Sure. But it fails differently, and that difference is the whole argument: a broken pipeline gate is a loud, visible build failure someone has to explicitly override. A stale hardcoded value in application code can sit silently wrong for months, because nothing forces anyone to look at it again. What I Can Honestly Say Held Up I want to be straight about this: since the change shipped, we haven't had a key rotation or a deployment misconfiguration that actually tested either mechanism in anger. So I can't tell you the CI/CD gate has caught a real incident, because it hasn't had to yet. What I can say: the manual validation code is gone, no duplicate signature/issuer/audience/expiry logic remains anywhere in the codebase, and in the months since, nothing attributable to the change has come up in review. That's evidence the change didn't introduce a regression — not proof it's been battle-tested under a live failure. Worth being honest about the difference. The Takeaway Treat hand-rolled token validation as a prompt to investigate, not an automatic red flag. In review, ask what the framework's resource-server config already checks before accepting new validation code as necessary.If a function exists purely to re-derive something the framework already validates, the fix is usually a config line, not a code change.Defense-in-depth concerns about misconfiguration are legitimate — answer them directly. Often the better answer is verifying config at deploy time (CI/CD gating), not re-validating tokens at runtime.The two approaches fail differently, and that's the actual argument for preferring the config-time check: a broken gate is loud, a stale hardcoded check is silent. This example is Spring Security and Entra ID, but the underlying review question — what does the framework already check before I add code that checks it again — travels well to any OAuth2/OIDC resource-server setup.
AI has made producing code dramatically cheaper. Understanding that code has not become cheaper. A developer can generate a service wrapper, test suite, or 500-line pull request in minutes. A reviewer still has to understand what every important line does, what assumptions it makes, and how it behaves when the system changes. That gap creates a new form of technical liability: comprehension debt. It accumulates when teams can produce code faster than they can explain, operate, and safely change it. Comprehension debt shows up when a team accepts code before it has really taken ownership of the reasoning behind it. The code is not always messy. Sometimes it is clean. Sometimes it passes every test. That is what makes the risk easy to miss. The team ships the change, but it does not understand why the implementation works, where it is fragile, or what might happen when the surrounding system changes. That is why this moment matters. Traditional technical debt often accumulated because software was difficult and expensive to produce, so teams cut corners to keep delivery moving. AI changes that economic model. Code production can now outrun the team’s ability to inspect, explain, and safely evolve what was produced. The limiting factor is no longer only implementation capacity; it is human comprehension. If engineering organizations want to benefit from AI without weakening their codebases over time, they need to update their definition of done. A pull request that passes CI/CD is no longer enough. Production-ready AI-assisted code also needs traceability, risk classification, reviewer accountability, and evidence that the team understands the logic it is accepting. When AI-Generated Code Gets the Details Wrong Sometimes, we have specific assumptions or constraints in mind that we may not explicitly encode in the prompt because, as humans, we naturally consider them while writing the code. An AI, however, would not necessarily make the same assumptions. For instance, assume we are building a new API that needs to perform request validation, request authorization, and then execute business logic. If you tell an AI agent to build this, it might implement the API with request validation first, followed by request authorization, and then the rest of the business logic in the service. It might also write many unit and integration tests to ensure the request validation, request authorization, and business logic work correctly. However, from a security standpoint, you might want the request authorization to happen before the rest of the request validation, followed by the business logic. If this instruction is not explicitly given to the AI, it may implement the code in the wrong order, potentially performing request validation first and exposing information to a caller who is not authorized to view it. With the volume of code AI generates, it can be hard to find this kind of bug. However, when you implement code line by line without AI and dig into the implementation details, it may be easier to think through these scenarios. This is one problem with AI-generated code: it may be functionally correct and well tested, yet still miss assumptions a human developer would naturally consider during implementation. Product requirement documents generally describe high-level business requirements and may not specify every minor corner case. As a developer implements the logic, their understanding of the requirements evolves, and writing the code forces them to think through corner cases and decide how the system should behave. With AI-generated code, this iterative process can be missed if the requirements are simply handed to an AI agent as a prompt. The Hidden Cost of Synthetic Velocity Generative AI can produce a lot of plausible code almost instantly. The output often has clean formatting, sensible names, and just enough polish to feel safe. But polish is not understanding. A generated function can look obvious on the page while carrying assumptions no one on the team has checked. The bottleneck then moves from creation to comprehension. A developer can submit a 500-line AI-assisted pull request in minutes, but the reviewer still has to understand the full behavior, trace the edge cases, and decide whether the implementation fits the architecture. Reviewing is harder than generating because it requires reconstructing intent after the fact. When this happens repeatedly, reviewers adapt. With the massive amount of code being generated, they skim more. They lean harder on green tests. They assume the author has already done the deeper reasoning. The team may still be moving quickly, but the review process has quietly shifted from “Do we understand this?” to “Does anything obviously look broken?” Months later, the same code could cause problems in production, but no one can explain why the original implementation was structured that way. What looked like a fast delivery win becomes a forensic debugging exercise because the team accepted code faster than it absorbed the reasoning behind it. That is the real cost of synthetic velocity. The time saved during generation often comes back later in outages, migrations, and security reviews. Sprint metrics can make the codebase look healthy while the people responsible for operating it are quietly losing their map. Introducing the TTT Framework I have started thinking about this less as a tooling problem and more as an ownership problem. Banning AI coding tools is not the answer; developers will keep using tools that help them move faster. The harder question is whether the team still owns the reasoning behind what it ships. The Trace, Tag, and Time-box framework is a simple way to make that ownership visible. Trace what part of the code was AI-generated. Tag the change with the semantic risk. Time-box the work required to understand, test, and refactor it before it turns into institutional mystery. Reverse Walkthroughs are the mechanism for Yellow and Red changes, not a fourth pillar. The framework is intentionally boring. That is the point: it depends less on a specific tool than on habits a team can actually repeat. 1. The Trace Mandate The first rule is simple: teams should be able to identify AI-assisted code later. If a function, migration, test suite, or configuration block was generated or heavily shaped by an AI tool, that fact should not disappear once the pull request is merged. A lightweight trace can live in the pull request description, a commit message, or an internal annotation standard. This trace is not about blaming a tool or treating generated code as automatically suspicious. It is about preserving context. When a strange regular expression, unusual data transformation, or non-obvious retry strategy causes trouble months later, the team should be able to see where the logic came from and what the original intent was. That context can dramatically shorten future debugging and refactoring work. 2. Semantic Risk Tagging Not all AI-generated code carries the same level of risk. A generated CSS utility class and a generated authentication flow should not go through the same review process. Teams need a simple risk language that helps reviewers decide where to spend their attention. A useful tagging model divides AI-assisted changes into three categories: Green, Yellow, and Red. The point is not to create bureaucracy. The point is to make risk visible before reviewers are forced to infer it from the code alone. Green (Commodity): Low-risk generated code such as boilerplate, basic configuration, repetitive type definitions, simple test scaffolding, documentation drafts, or straightforward UI styling. These changes still need review, but they usually do not require deep architectural debate.Yellow (Algorithmic): Medium-risk generated code that changes business logic, data transformations, validation rules, error handling, concurrency behavior, or mathematical operations. These changes require a human reviewer to trace the logic carefully and confirm that the implementation matches the intended behavior.Red (Architectural): High-risk generated code that affects service boundaries, state management, database schemas, security-sensitive logic, permission models, API contracts, or large-scale system behavior. These changes should require senior review and, in some cases, architectural approval before generation is even used. 3. Time-Boxed Comprehension Work The third rule is to give comprehension real space on the engineering calendar. AI-assisted development creates an awkward asymmetry: the author may have produced the code quickly, but the team still has to understand it well enough to operate it later. If that work is not scheduled, it usually gets squeezed into a rushed review or postponed until an incident forces the issue. For Green changes, the time commitment might be minimal: a normal review, a quick note in the pull request, and standard tests. For Yellow and Red changes, teams should allocate defined review and refactoring time before the merge. That time can be used to simplify confusing logic, add integration tests, clarify naming, write a short design note, or pair through the generated implementation with another engineer. One practical way to spend that time is a “Reverse Walkthrough.” Instead of saying, “The tests pass,” the author must explain how the generated code works, why the chosen structure is appropriate, what edge cases were considered, and what failure modes remain. If the author cannot explain the implementation in plain language, the team should not merge it. This rule keeps ownership attached to the human operator, not the model that produced the first draft. A useful Reverse Walkthrough asks the author to answer practical questions before Yellow or Red code merges: What problem does this code solve? What assumptions does it make? What happens when those assumptions fail? Why was this implementation chosen? What alternatives were rejected? What happens under concurrency, load, or failure? Which parts were generated, and which parts were manually modified? Using AI to Make Code Reviews More Effective AI can also be a powerful tool for helping developers review AI-generated code. Instead of relying on the AI to simply perform an automated code review, reviewers can have a conversation with the AI about the changes in a pull request. They can ask it to explain how the code handles specific corner cases, identify scenarios that may not be covered, or verify whether the implementation actually satisfies the requirements of the change. An AI agent can also provide a high-level overview of the pull request, explain how the different files and classes fit together, and describe the responsibilities of the major components. This can significantly reduce the time a reviewer spends trying to understand a large code change. Managing the Velocity Shift The biggest mistake leaders can make is treating AI-assisted development as a pure throughput problem. If success is measured only by tickets closed, lines generated, or pull requests merged, teams will optimize for short-term output while quietly weakening long-term maintainability. A healthier metric combines delivery speed with operational confidence. Can the team explain the code it ships? Can new engineers understand the generated modules without relying on one person? Can the system be debugged under pressure? Can reviewers identify which parts of a pull request need deeper inspection? These questions matter as much as raw velocity. Comprehension Debt Indicators I would not treat these as established industry metrics. They are better understood as proposed operational signals: lightweight measures that help a team notice when AI-assisted development is increasing output faster than shared understanding. Reverse Walkthrough failure rate: The percentage of Yellow or Red AI-assisted pull requests where the author cannot adequately explain the implementation, assumptions, or failure modes.AI-code review time: The median reviewer time for AI-assisted pull requests compared with conventional pull requests of similar size and risk.Comprehension recovery time: The time spent after merge simplifying, documenting, testing, or restructuring AI-generated code so the team can maintain it confidently. None of these metrics should be used to shame individual developers. Used well, they give engineering leaders an early warning system. If the AI-assisted PR ratio rises while walkthrough failures, review time, and recovery time also rise, the team is not just moving faster. It is accumulating knowledge gaps that will show up later in incidents, migrations, or onboarding. Start small. Pick one active repository and apply the TTT framework to the next AI-assisted pull request. Ask the author to trace the generated code, tag each generated section by risk, and reserve a defined comprehension window for anything Yellow or Red. Require a Reverse Walkthrough before merge, or soon after merge if the work is intentionally staged behind a feature flag. The exercise will show quickly where the team’s review process is solid and where comprehension debt is already starting to collect. AI can absolutely make engineering teams faster. But speed that destroys shared understanding is borrowed time. The code is not necessarily bad. The problem is that six weeks later, the person who approved it may have no idea why it works. Comprehension debt is manageable, but only if teams name it, measure it with practical operational signals, and build habits that keep humans in control of the systems they are responsible for maintaining.
TL;DR: The Hidden Cost of Switching AI Models A new AI model arrives that is cheaper per token, scores better on benchmarks, and seems to require nothing more than a setting change. However, the token bill shows only part of the cost of switching AI models. There is also the effort to check whether your workflows, for example, the one to create status reports for stakeholders, still produce outputs in line with your AI Definition of Done. More often than not, this task remains unaligned with the decision to switch AI models. In the worst case, switching AI models behind a business workflow can raise operating costs despite cheaper tokens, because business cases can miss the revalidation effort. Thesis: This article explains the recurring operational cost of switching AI models behind a business workflow: why the revalidation effort may disappear from upgrade decisions, how to screen a switch, and how Agile teams use an AI Definition of Done, test evidence, and an accountable owner to stay in control. Why a Cheaper Model Can Cost You More Your vendor has announced a new model. It costs less per million tokens than the one behind your team's workflows, it beats its predecessor on every benchmark the release notes care to mention, and switching seems to require nothing more than a changed setting in a configuration file. The business case writes itself, which is exactly the problem, because it writes itself from the price list. A lower price per token is a fact about the model, whereas lower operating costs are a claim about your workflow. That claim depends on work no price list contains: somebody has to check whether the workflow still produces acceptable results after the switch, adapt whatever no longer does, and keep checking afterward. That effort recurs with every model change, and it vanishes from the decision whenever existing staff absorb it, because nobody "invoices" for their afternoons to create the desired transparency. The Upgrade That Looks Like a Configuration Change Take a hypothetical but ordinary case. A Product Manager runs a workflow that drafts the weekly stakeholder status report: its agent takes the export from the team's project tracker, the product roadmap, and customer input from a variety of sources. It builds on a skill that describes the report structure, including tone instructions, and the model produces a two-page draft that the Product Owner reviews, corrects, and sends out every Friday. (Yes, a written status report in an Agile organization; stakeholders who skip, for example, the Sprint Review still want to know what happened, and a page they read beats a meeting they avoid.) Over a few months, the review has settled into a quick pass that mostly fixes phrasing. Then the vendor releases a cheaper model, and the switch looks like a one-line change. When the Report Still Reads Well and Is Wrong After the switch, the reports still arrive on time, in the right structure, and in fluent prose. In the third week, however, the draft describes a blocked item as "on track," because the new model dropped the one sentence in the tracker comment explaining that the item waits for a decision from the legal department. The report reads smoothly; nevertheless, it would have told the stakeholders the opposite of the truth, and the Product Manager caught it only because they happened to know that particular item. If the team had written an AI Definition of Done for its status reports, with a verification level that requires checking every status claim against the project tracker, the report would have failed on the spot; without one, catching the error depended on the Product Owner's memory. (Download the complete A3 Delegation System template including the AI Definition of Done above.) This is the failure that can make switching AI models expensive: the workflow remains technically operational while it no longer produces acceptable output. A loud failure, say, a rejected parameter or a broken output format, stops the workflow with an error message, and somebody fixes it before lunch. The quiet failure passes every technical check and lands in front of the reviewer, who now reads every report with more suspicion than before, which is where the correction effort starts to climb. The same mechanism explains why a quick trial before the switch proves so little: model output can vary from one run to the next, so one successful run provides limited evidence, and the new model may well have produced a correct report on the day somebody tried it. Hence, every switch of the model behind a production workflow raises a revalidation question. By revalidation, I mean checking, before you approve the changed workflow for production use, that it still meets its agreed standard, and then inspecting its actual results after deployment. For teams that work with an AI Definition of Done, the trigger is already on paper: the standard names the model tier that suffices for each task class and carries a sign-off with a review date, so a model switch leaves that sign-off without a basis until somebody renews it. The depth of that check should depend on what a failure costs, as a brainstorming assistant and an agent that changes customer records do not deserve the same scrutiny. Where the Switching Cost Hides The explicit charges are easy to find: the new model's token price, perhaps a few more tokens per report if the new model writes longer drafts, and, in larger setups, the invoices for tooling or outside help with the migration. Additional costs include operational effort: the hours spent comparing old and new reports before the switch, the extra minutes of correction every Friday since, the test cases somebody has to maintain, the rework when a wrong report has already gone out, and whatever the Product Owner did not do in the meantime. (Have I mentioned the cost of losing stakeholder trust because of a faulty report?) Salaries are on the books, of course; however, existing staff budgets absorb this effort, and unless somebody attributes it to the migration, it stays out of the business case. Two days a team member spends validating a migration create no new cash expense, yet those two days are gone. That is what I mean by hidden: the cost is on the books, just not on the page where the decision gets made. Consuming more tokens per task can also outweigh a lower token price, more retries, higher latency, or more human correction. So the unit of comparison is the complete workflow at an acceptable quality level, not the token price list. A Screening Question Before You Switch For a switch motivated by cost savings, one division gives you a screening question: divide the one-off migration and revalidation cost by the net monthly savings to get the number of months it takes to recover the investment. "Net" is the word to watch, as it means the savings compared with the existing workflow after changes in review time, corrections, retries, and ongoing maintenance. Meeting the minimum standard, as such, is a precondition rather than a term in the formula: a cheaper workflow that sends wrong reports to stakeholders does not qualify, whatever the arithmetic says. Then ask whether the expected savings justify the investment, allowing for further migration and revalidation costs. A later change does not erase the savings you have already made. However, it brings its own revalidation cost, and vendors retire models on their own schedule: Anthropic, for example, retired Claude Sonnet 4 and Claude Opus 4 on June 15, 2026, and Claude Opus 4.1 on August 5, 2026. Treat the payback figure as a screen, not a forecast; it works when net savings are positive and reasonably stable, and it tells you whether the switch deserves a closer look. Beware, though: Upgrades motivated by quality or new capabilities need a different judgment: weigh that benefit against the additional cost directly, without squeezing every improvement into a monetary payback calculation (the attempt invites invented precision as a misleading metric). When the Vendor Decides for You Not every switch is voluntary. Anthropic commits to at least 60 days of notice before retiring a publicly released model, and on September 30, 2026, it notified developers that Claude Sonnet 4.5 is scheduled to retire on November 30, 2026. OpenAI gives generally available models at least 6 months of notice, specialized variants at least 3 months, and preview models much less, such as 2 weeks; all of these minimums yield when safety or compliance concerns call for a faster retirement, in which case OpenAI promises "as much notice as reasonably possible." A forced migration changes the question from whether switching is worthwhile to which viable alternative to choose: Moving to the successor modelChanging the providerReducing the workflow's scopeReverting temporarily to manual workRetiring the workflow altogether Teams that run an AI Delegation Audit will recognize the list, as the audit's decisions overlap with it (change the model tier, change the A3 category, update the AI Definition of Done, or retire the delegation). The audit counts retiring an automation that no longer justifies its audit cost as a successful outcome. Continuing the automation is itself a decision, and it deserves the same revalidation as a voluntary switch, with less time to do it. If the Product Manager first has to work out what an acceptable status report looks like, much of the notice period is gone before the first test runs, so the evidence has to exist before the notice arrives. Evidence That Survives the Switch The evidence consists of four things, kept together: examples of acceptable and unacceptable work, the criteria you used to judge them, the relevant workflow configuration (prompt, skills, instructions, data, and context), and the results the current workflow produces on those examples. For the status report, that might be a dozen past project tracker exports, the reports you consider correct, and a note on why the blocked-item report was wrong. If the workflow already has an A3 Handoff Canvas, its Records field has settled in advance what to keep (prompts, skills, inputs, outputs, edits, and approvals), which means the evidence accumulates while the workflow runs instead of being reconstructed under a deadline. Keep that evidence somewhere your organization controls, because testing tools are dependencies, too. OpenAI announced on June 3, 2026, that it is shutting down its Evals platform: existing evals become read-only on October 31, 2026, and the dashboard and API shut down on November 30, 2026. A team that kept its test cases only in that platform must migrate its testing setup, and if its model needs replacing at the same time, the two migrations compound the work. Passing the same cases supports the decision to deploy; however, a new model can pass every existing case and still fail in ways those cases never covered. So, retain the existing cases, add a case for every newly discovered failure (the blocked item is now case number 13), and inspect the actual results for a while after deployment. Who Approves Continued Use? Evidence that nobody acts on is an archive, so somebody has to be accountable for the check happening before a switch, for recording the decision to keep using the workflow, and for noticing when production results drift. Call that person the "workflow owner." They do not have to run every test personally, but they own the answer to "does this still work?" In the A3 Delegation System, the AI Delegation Audit inspects whether this practice works, much as a Retrospective inspects how the team works. One of its four checks, model fit, asks whether the assigned model still suits the task and its risk level. The audit does not gate individual switches, which a recurring inspection cannot do; the model change remains the trigger. One limit applies to all of this: you can only revalidate the workflows you know about, and an AI Workflow Inventory, even one that deliberately lists the shortcuts nobody approved, covers only what your discovery turns up. A workflow a team member runs privately through a personal account can change without the team knowing about it, let alone applying its agreed checks. Shadow IT always comes at a price. Conclusion: One Workflow Before Switching AI Models Pick one consequential recurring workflow, one where a wrong output would reach a stakeholder, a customer, or a decision before anybody noticed. Then do four things: Name the owner: The person who approves continued use after the next model change.Write down the standard: What counts as acceptable work for this workflow, ideally as an AI Definition of Done with the model tier it was signed off for and a review date. (If you work with Scrum, the parallel to the Definition of Done is deliberate.) If no such standard exists, writing it is your first task, and the hardest one, because without a standard there is nothing to revalidate against.Collect five starter cases: Real past inputs with outputs you consider acceptable and, if you have one, an output you consider wrong, together with the results the current workflow produces today.Record what runs it: The model and provider as your tool shows them, and where the evidence lives. (If you keep an AI Workflow Inventory, put this into a separate check record under the workflow's inventory number rather than into the inventory itself.) Five cases start the exercise; they do not validate anything on their own, and they are not supposed to. Then apply one test: if your vendor announced the retirement of that model tomorrow, could the owner demonstrate within the notice period that the workflow still meets its standard on the new one? If the honest answer is no, you have uncovered operational work that the model's price list leaves out. Key Questions This Article on Switching AI Models Answers Does a Cheaper AI Model Lower the Cost of a Business Workflow? A cheaper AI model does not necessarily lower a workflow's cost, because the token price is only one part of what the workflow costs to run. A cheaper model may need more tokens, more retries, or more human correction, and the effort to revalidate the workflow adds staff time that a business case built from token price lists may not capture. The unit of comparison is the complete workflow at an acceptable quality level. What Are the Hidden Costs of Switching AI Models? The hidden costs of switching AI models are the internal efforts that no vendor bill shows: comparing old and new outputs before the switch, extra review and correction afterward, maintaining test cases, and reworking wrong output that already went out. Existing staff budgets absorb this effort, so a business case built from token prices can miss it: two days of validation work creates no new invoice yet still consumes capacity, so it vanishes in the budget noise. How Do You Check Whether a Workflow Still Works After an AI Model Change? Revalidate the workflow: before approving it for production use, check it against an agreed standard, such as an AI Definition of Done, and a set of saved cases, then inspect its real results after deployment. Keep acceptable and unacceptable examples, judging criteria, workflow configuration, and previous results in a place your organization controls. Because model output varies between runs, one successful trial is weak evidence, and every newly found failure becomes a new case. What Should a Team Do When an AI Vendor Retires Its Model? Treat a vendor's model retirement as a choice between viable alternatives: moving to the successor model, changing the provider, reducing the workflow's scope, reverting temporarily to manual work, or retiring the workflow. Notice periods vary: Anthropic commits to at least 60 days for publicly released models, while OpenAI gives generally available models at least 6 months but may retire faster for safety or compliance reasons. Teams with prepared test evidence can revalidate within that window. Who Should Approve the AI Model Behind a Recurring Workflow? A named workflow owner should be accountable for checking the workflow before each model change and for approving its continued use, even if other people run the tests. In the A3 Delegation System, the AI Definition of Done supplies the standard the workflow is checked against, and the AI Delegation Audit inspects whether this practice works over time; the audit does not gate individual model switches.
If you are responsible for keeping a production system alive, you have probably been pitched an "AI SRE" in the last few months. Maybe more than one. Maybe more than one this week. When we sat down at Bronto to map that space, we ended up with 64 tools across seven camps: pure-play investigation agents, observability platforms with AI built in, incident management tools with AI on top, AIOps and alert correlation, hyperscaler agents like AWS DevOps Agent and Azure SRE Agent, Kubernetes copilots and open source projects, and a long tail of adjacent tools. All of them use the same two words on their landing page, and they solve very different problems. So the first question most teams ask is the classic one: do we buy, or do we build? In our landscape article, we argue that the choice isn't binary. You can go full DIY, build on open source foundations like HolmesGPT or K8sGPT, buy a product and extend it, or buy it as-is. Most teams land somewhere in the middle. In this article, I want to make a different argument for building one, at least once: build to understand what you buy. Even if you never run your own DIY agent in production, putting one together by hand shows you where its answers come from, what it can't see, and why it goes wrong when it does. After building one, you know which questions to ask a vendor, and you know how to get better results from whatever you end up running. That's the profit you should take away from this post. The fun is the building and seeing your agent try to investigate an incident: it might get it wrong, it might get it right, but you'll see how it interacts with your tools and your data. This post is based on a hands-on lab we ran at an AWS and Bronto evening, and everything is available through bronto-community/ai-sre-lab. By the end, you will have a small agent with the following capabilities: reads logs, traces, and metrics through an MCP server,reads the application's source code and commit history through GitHub's MCP server,writes its hypothesis, evidence, and confidence into a GitHub issue. Note that in the lab we use Bronto as the observability backend. I work there, so I am biased to think it is your best option, but you can of course use any other solution. What an AI SRE Is AI SRE is mostly a marketing term. In short, it's an agentic loop pointed at the production system that can answer questions about it and help you troubleshoot. Like any agentic loop, it has inputs on one side (an alert, a question from a human), a model in the middle, tools underneath (mostly MCP servers these days, for telemetry, code, cloud APIs, runbooks), and outputs on the other side (a Slack message, a ticket, a pull request). So, it's an agent like any other. It's what you connect to it that makes it an agent for SRE. The Patient: A Small Online Shop Our AI SRE needs something to investigate. The lab comes with a tiny storefront: four Python services instrumented with OpenTelemetry, plus a payment processor mock standing in for a third party. You can, of course, point the agent directly at your own data. It's read-only, so it is not able to harm your system. What You Need To run this lab, you need the following: A container engine, like Docker DesktopAn AWS account with access to a model on Amazon Bedrock.A Bronto API key (there is a free trial), or another observability backend with an MCP server.A GitHub account and a fine-grained personal access token. It needs to read the contents of your copy of the storefront repo and write issues to it.Optional, for nicer output: jq and glow. You can watch this video to follow along as we walk through each step: Start the Shop Clone the lab and generate the storefront repository. The script builds a small Git history with a handful of commits and tags two releases, v3.1.0 (healthy) and v3.2.0: Shell git clone https://github.com/bronto-community/ai-sre-lab cd ai-sre-lab ./build-storefront.sh Your agent will later read this code through GitHub, so push it to a repository of your own, tags included: Shell cd storefront gh repo create storefront --public --source . --push git push --tags cd .. Then point the Collector at your telemetry backend and bring everything up: Shell cd demo echo "BRONTO_API_KEY=<your key>" > .env make up Note, that demo/collector.yaml ships to Bronto's EU ingestion endpoint. If your account lives in another region, or you want a different backend, that file is the only thing you need to change. Next, run make up, which deploys v3.1.0 and starts the traffic. It prints a message that you should leave it about ten minutes before you do anything else. An investigator with no baseline has nothing to compare against. So, take your time going through the first few next steps so it can build up! Step 1: The Loop All agents start with a basic file that receives prompts, sends them to the model, and returns the results. It's a simple first agent, so here is more or less the code in full: Python import os from bedrock_agentcore import BedrockAgentCoreApp from strands import Agent from strands.models import BedrockModel model = BedrockModel( model_id=os.environ.get("BEDROCK_MODEL_ID", "us.anthropic.claude-haiku-4-5-20251001-v1:0"), region_name=os.environ.get("AWS_REGION") or os.environ.get("AWS_DEFAULT_REGION", "us-west-2"), ) app = BedrockAgentCoreApp() @app.entrypoint def invoke(payload: dict) -> dict: agent = Agent(model=model) return {"result": str(agent(payload.get("prompt", "Hello!")))} if __name__ == "__main__": app.run() # POST /invocations, GET /ping on :8080 Two libraries do the work. Strands Agents runs the agent loop: send the prompt to the model, run any tool the model asks for, feed the result back, repeat until the model has an answer. The Bedrock AgentCore SDK wraps that in an HTTP server with the /invocations and /ping contract AgentCore Runtime expects. Today that runs on your laptop. Later, the same container can run on AgentCore Runtime without changes. Every step of the lab is a prebuilt image, so you don't need to build anything. Create a .env next to where you run the commands: Shell AWS_DEFAULT_REGION=us-west-2 AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... AWS_SESSION_TOKEN=... BEDROCK_MODEL_ID=us.anthropic.claude-haiku-4-5-20251001-v1:0 With this setup, you can start the agent for the first time: Shell docker run --rm -p 8080:8080 --env-file .env ghcr.io/bronto-community/ai-sre-agent:step-1 Open a second terminal and ask it something: Shell curl -s localhost:8080/invocations -d '{"prompt": "Who are you?"}' | jq -r .result It will say, "Claude, an AI assistant made by Anthropic." Correct, and completely useless for incident response. Right now this is a model behind an endpoint, with no identity and no tools. Step 2: Identity The second step changes only one line of code. Every Markdown file in prompts/ becomes part of the system prompt: Python SYSTEM_PROMPT = "\n\n".join(p.read_text() for p in sorted(Path("prompts").glob("*.md"))) @app.entrypoint def invoke(payload: dict) -> dict: agent = Agent(model=model, system_prompt=SYSTEM_PROMPT) ... The image ships with two files. role.md: Markdown You are the on-call SRE for Storefront, an online shop. You investigate production incidents: what broke, where, and why. And rules.md: Markdown - Only state what you can back with evidence from your tools. - If you have no tool that can answer, say so and name what you would need. - Be brief. You also get to add your own. Create a my.md: Markdown - Answer in at most three bullet points. - End every answer with your confidence: low, medium or high. - Sign off as "your friendly on-call dino". Start step 2 as follows. The command contains your custom instructions as an additional volume: Shell docker run --rm -p 8080:8080 --env-file .env \ -v "$PWD/my.md:/app/prompts/my.md" ghcr.io/bronto-community/ai-sre-agent:step-2 Shell curl -s localhost:8080/invocations -d '{"prompt": "Checkout is slow. What is wrong?"}' | jq -r .result You should get a short answer that says it has no access to telemetry, rates its own confidence as low, and signs off as a dino. That's a good result. The rule "say so and name what you would need" did its job: an agent that admits it can't see anything is far more useful than one that guesses. Step 3: Eyes Now the agent gets something to look at. Step 3 adds one tool source, Bronto's MCP server: Python bronto = MCPClient(lambda: streamable_http_client( os.environ.get("BRONTO_MCP_URL", "https://mcp.eu.bronto.io/mcp"), http_client=httpx2.AsyncClient( headers={"X-BRONTO-API-KEY": os.environ["BRONTO_API_KEY"]}, timeout=60, ), )) @app.entrypoint def invoke(payload: dict) -> dict: agent = Agent(model=model, system_prompt=SYSTEM_PROMPT, tools=[bronto]) ... That's the whole change. The MCP server's tools (search logs, list datasets, and so on) become tools the agent can call, and Strands handles the plumbing. This is also the point where MCP pays off: if your telemetry lives somewhere else, you swap this client for that vendor's MCP server and keep everything else. Add BRONTO_API_KEY to your .env (and BRONTO_MCP_URL if your account isn't in the EU region), then: Shell docker run --rm -p 8080:8080 --env-file .env \ -v "$PWD/my.md:/app/prompts/my.md" ghcr.io/bronto-community/ai-sre-agent:step-3 Start with a question that tells you what it can see: Shell curl -s localhost:8080/invocations -d '{"prompt": "What services do you know about?"}' | jq -r .result It should list the storefront services. Go ahead and ask it some more questions about the state of those services: what HTTP endpoints are available? What is the average error rate right now? With this, you have a first working version. Next we want to investigate an incident. To do so, ship the next release of the storefront: Shell make release According to the Makefile, symptoms take about 60 seconds to show up in p95. So wait a minute or two and then ask it: Shell curl -s localhost:8080/invocations -d '{"prompt": "Anything wrong with checkout?"}' | jq -r .result It will come back with a hypothesis about what is wrong and what you might be able to do about it. Take a look at the telemetry yourself and check: is the analysis correct, or did the agent pick up some false information? Step 4: Mouth An answer in your terminal is nice for a demo, but in production you would want to have it sent to a Slack channel, a pager app, or an issue tracker. In our example, we send the answer as a GitHub issue. This would let you tag your coding agent to review the issue and open a pull request that fixes it. You now have two options for how this gets filed. Either you give your agent another tool, and it can decide for itself where to send the hypothesis, or you make the code file the issue, so every analysis gets pushed into a dedicated issue: Shell def file_issue(question: str, hypothesis: str) -> str: r = httpx2.post( f"https://api.github.com/repos/{os.environ.get('GITHUB_REPO', 'ai-sre-lab/storefront')}/issues", headers={"Authorization": f"Bearer {os.environ['GITHUB_TOKEN']}"}, json={"title": f"[investigation] {question}"[:120], "body": hypothesis}, timeout=30, ) r.raise_for_status() return r.json()["html_url"] @app.entrypoint def invoke(payload: dict) -> dict: question = payload.get("prompt", "Hello!") agent = Agent(model=model, system_prompt=SYSTEM_PROMPT, tools=[bronto]) hypothesis = agent(question) return {"result": file_issue(question, hypothesis)} To make sure that what the agent provides fits the output, an additional new prompt file tells the agent how to write it: Markdown Your answer is filed as a GitHub issue for the on-call team. Write it as one: a one-line hypothesis, the evidence for it, your confidence, and what you could not check. Before running the next version of your agent, add your GitHub token and your repository to .env: Shell GITHUB_TOKEN=github_pat_... GITHUB_REPO=<your-user>/storefront Run step 4: Shell docker run --rm -p 8080:8080 --env-file .env \ -v "$PWD/my.md:/app/prompts/my.md" ghcr.io/bronto-community/ai-sre-agent:step-4 Ask it again to investigate the issue: Shell curl -s localhost:8080/invocations -d '{"prompt": "Anything wrong with checkout?"}' | jq -r .result The response is now a link. Open it and read the hypothesis. Is it right? How confident is it? There's a good chance it's confidently wrong. While testing the lab, one run concluded that checkout was down because a query returned nothing: an empty result is not proof of an outage, but nothing told the agent that. Step 5: Better Instructions What you do next doesn't involve code. You do what you'd do with a new human on the rotation: you tell them how you investigate. Add these lines to your my.md: Markdown - Slow is broken too: compare latency (p50, p95) before and after, not only errors. - Compare against a quiet window earlier the same day. - Look for `deploy` spans near the onset: they name the commit that went live. Each line encodes a habit experienced SREs have, and models don't bring by default. Checkout can be very broken without throwing a single error. A number means little without a baseline. And the first question in most incidents is "what changed?" The prompt files are read when the container starts, so restart step 4 with the same command and ask a more realistic question: Shell curl -s localhost:8080/invocations \ -d '{"prompt": "Customers say checkout got slow in the last 30 minutes. What is going on?"}' | jq -r .result Compare the new issue with the old one. Is it better? Worse? Did it fail outright? Step 6: Better Model As you might now, a different model can create a different output, so if you are not satisfied with the results yet, change one line in .env: Shell BEDROCK_MODEL_ID=us.amazon.nova-lite-v1:0 Restart your agent, ask the question again, and compare the outputs again: better or worse? Step 7: Code So far the agent can see that something changed and maybe even when. If your instructions worked, it found the deploy. What it can't do is look at what was deployed. Step 7 adds the second MCP server, GitHub's, restricted to read-only repository tools: Python github = MCPClient(lambda: streamable_http_client( os.environ.get("GITHUB_MCP_URL", "https://api.githubcopilot.com/mcp/x/repos/readonly"), http_client=httpx2.AsyncClient( headers={"Authorization": f"Bearer {os.environ['GITHUB_TOKEN']}"}, timeout=60, ), )) @app.entrypoint def invoke(payload: dict) -> dict: question = payload.get("prompt", "Hello!") agent = Agent(model=model, system_prompt=SYSTEM_PROMPT, tools=[bronto, github]) ... To make it useful to the agent, add one more prompt file, code.md. It connects the telemetry to the code: Markdown The shop's source code is in the GitHub repository `ai-sre-lab/storefront`. Every service reports the commit it runs as `deployment.commit`. Replace the repository path with your own, then mount it as an additional volume: Shell docker run --rm -p 8080:8080 --env-file .env \ -v "$PWD/my.md:/app/prompts/my.md" \ -v "$PWD/code.md:/app/prompts/code.md" \ ghcr.io/bronto-community/ai-sre-agent:step-7 Ask the same question again: Shell curl -s localhost:8080/invocations \ -d '{"prompt": "Customers say checkout got slow in the last 30 minutes. What is going on?"}' | jq -r .result Does it find the deploy? Does it open the release and pick the right commit? In our testing, it found the deploy marker and the commit, and then stopped. The release contains several commits, and the last hop, reading every one of them and figuring out which change explains the symptom, didn't happen on its own. If you experience the same, try to fix it yourself by refining your system prompts or by trying yet another model. When you're done, make rollback puts the healthy version back, and make down cleans everything up. If you want to give your agent a harder case, make psp-slow degrades the third-party payment processor. So, Buy or Build? Now you know what an AI SRE is and how it works, from the inside. That's a much better position from which to answer the question this post started with. If you buy, a lot of what hurt along the way becomes someone else's problem: confidently wrong answers that need endless prompt tuning, context windows overflowing with search results, wiring up every integration yourself. AWS DevOps Agent, for example, starts investigating when an alert fires and connects to the tools you likely already run, and you can still extend it with custom skills and your own tools. Take the four questions from the landscape article with you into every demo: Where does it get its data? Does it act, or only advise? Can you see its reasoning? What happens when it's wrong? After this lab, you'll know what good and bad answers to those look like. If you build, what you have now is a skeleton, and you can build more features towards a complete picture on top of it: Let alerts trigger it instead of curl.Run it on AgentCore Runtime instead of your laptop (agentcore deploy).Give it more tools: your cluster, your cloud APIs, your past incidents and postmortems.Observe the agent itself. Its own traces tell you which tools it called, how many tokens it burned, and where it went wrong, and that's the input you need to improve it. Either way, the data underneath matters more than the agent on top. Every improvement in this lab depended on the telemetry being there: a baseline from ten quiet minutes, latency and not just errors, a deployment.commit attribute that connects a span to a line of code. An agent can only reason about what your system tells it. That was true for humans long before agents showed up. So: what would your agent get wrong? The full lab, including the slides, the agent images for every step, and the storefront harness, is at github.com/bronto-community/ai-sre-lab. Content is CC BY 4.0; code is MIT. If you build something on top of it, I'd love to hear about it. I've shown how easy it is to build a simple AI SRE agent for fun. If you want to see what a production-ready one looks like, read our post on the Bronto blog, Introducing Bronto's Open-Source Alert Investigation Agent. It's an open-source agent that replicates the Alert Investigation feature in Bronto, and it's essentially our production version of this lab: a Bronto monitor triggers it instead of curl, it sticks to a constrained set of tools and reasoning paths instead of improvising, and it hands you a report with likely root causes and suggested next steps. The code is at bronto-community/bronto-alert-investigation-agent.
Agile Coach,
Berlin Product People GmbH
DevOps Engineer,
Procoreplus