Skip to content
← Back to YouBlog

Published article

Kiro Spec Analyzer: Catch Spec Bugs Before Agents Code

Drafted with AI from the video "Your Spec Has Bugs. Catch Them Before Your Agent Codes. - Rajath Mahendrappa Kotyal, AWS", then reviewed and published by Gustavo Miranda.

The Kiro spec analyzer is AWS's requirements-checking step that translates written rules into SMT formulas and asks a solver whether they can hold together. It surfaces conflicts and gaps in a specification before a coding agent implements it, and it leaves the final call to a human.

What the Kiro spec analyzer does before code generation

The Kiro spec analyzer is a requirements-checking pipeline that reads a specification file, refines its wording, formalizes the rules into SMT formulas, and asks a solver whether those rules can hold together. It runs before design or code generation, so a coding agent never receives rules that contradict each other.

Rajath Mahendrappa Kotyal, a software engineer in AWS's automated reasoning group, presented the work at the AI Engineer CODE conference, where the session description describes the pipeline as running on requirements before code generation. His speaker page states that he helped build requirements analysis for Kiro, AWS's agentic IDE.

The distinction matters for anyone reading the original talk. Kiro is the product; the specification analyzer is the component inside it. The talk's evidence is first-hand engineering experience from that team, not a published controlled study.

The core promise is narrow. The tool does not prove a specification matches what the business meant. It proves whether a particular formal reading of the specification is internally consistent, and it flags the places where the model produced more than one reading.

How the LLM translate, solver check loop works

The pipeline moves through three stages in order. First the LLM rewrites the requirement to remove vague wording. Then it translates the refined sentence into SMT-LIB, and a satisfiability checker returns a Boolean verdict on whether the constraints can be satisfied together.

When the solver reports that the formalized rules are satisfiable, the pipeline moves on. When it reports a conflict, the system broadens its check rather than trusting a single translation.

The architecture splits responsibilities deliberately. The language model handles the messy work of interpreting English, which no solver can do reliably. The solver handles the arithmetic of logic, which no language model does reliably. Neither half is asked to do the other's job.

Satisfiability is the property being tested, and it is narrower than correctness. A set of rules that can all hold at once is consistent; it may still be wrong about the business. This is why the pipeline ends with a person rather than a verdict.

Why sampling translations seven to ten times finds ambiguity

A single translation hides ambiguity because the model silently picks one meaning and discards another. The pipeline asks the model to translate the same requirement several times, the talk cites seven to ten runs, then clusters the outputs by logical equivalence.

Two translations that look different on the surface but reduce to the same formal constraint belong in one cluster. A requirement that produces several distinct clusters is one the model cannot read the same way twice, which is a useful signal in itself.

The talk describes this as separating genuine capability limits from noise. If the model is consistently interpreting a sentence one way, the nondeterminism is not the problem. If it lands on different logical meanings across runs, the sentence carries ambiguity the author never noticed.

Kotyal summarised the division of labor in one line: the LLM translates, the solver checks, and the human decides. Clustering sits in the middle because it converts a solver verdict into something a person can act on.

Conflict, gap and ambiguity: the three defect classes

The pipeline distinguishes three problems, and each one needs a different response. An ambiguity lives inside a single sentence that supports more than one reading. A conflict spans two rules that cannot both hold. A gap is a case no rule addresses at all.

The backorder example from the talk illustrates the conflict class. One rule says an order submitted with unavailable inventory becomes a backorder. Another rule in the same file says no order may be placed as a backorder. Read individually, each rule is sensible; together they cannot be satisfied.

The "remove the record" example illustrates ambiguity. The phrase does not say whether the record is destroyed or hidden from users while retained, so the pipeline presents both readings and asks which one the author meant.

A gap is quieter. An idle order that no rule mentions will not produce a contradiction, and a coding agent will simply implement nothing for that state. The pipeline reports that the requirement set has no entry where one is needed.

ClassWhere it livesExampleWho resolves it
AmbiguityOne sentence, two meanings"Remove the record" could delete or hide itUser picks a reading
ConflictTwo rules togetherBackorder required and backorder prohibitedUser reconciles the intent
GapMissing coverageAn idle order no rule addressesUser supplies the missing rule

Where an SMT solver beats an LLM judge, and where it does not

A solver wins on consistency checks across rules because satisfiability is decidable and reproducible. The same formula returns the same verdict every time, and a contradiction between two constraints is proven rather than judged.

An LLM judge still has a role. The talk places it in the fallback position: when the solver's formalized output cannot settle a question or the user gives no answer, an LLM judge can weigh in, and if that also fails, the pipeline abstains from implementing that piece.

The boundary is translation quality. The solver only checks what the translator produced, so a consistently wrong reading of an ambiguous sentence passes cleanly. The talk makes this limitation explicit rather than burying it.

That limitation is why sampling and clustering carry weight. Running the translation once and checking it formally gives a precise answer to a question that may be the wrong question. Running it several times and comparing logical meaning tests the translation itself.

What the team assumes about specifications and agent accuracy

Kotyal cited public research on prompt clarity and code accuracy, reporting a 20 to 40 percent drop in generated code accuracy when prompts are unclear, and that 60 to 90 percent of valid code is still wrong after it is written. He added that the team observed twice as many regressions after deploying such code.

The talk did not name the underlying studies, and the numbers were presented at the level of cited public research rather than a controlled experiment run by the team. Treat them as the motivation the team worked from, not as a measured result of the analyzer.

The reasoning that follows is straightforward. If unclear requirements degrade downstream output, then catching the unclear requirement is cheaper than catching the resulting code defect. That is an argument about where to spend review effort, and the talk frames it that way.

Kotyal was direct about the state of the evidence for formalization inside agent workflows. He described the field as emerging and the evidence as thin, which tempers any claim that this approach is established practice.

Where specification review belongs in a spec-driven workflow

Specification review belongs before the design step, in the same position as a design review that catches problems before implementation. Kotyal compared it to writing design documents and flowcharts so the flow is settled before code exists.

The practical change is that the specification file stops being a draft handed directly to an agent. It becomes an artifact with its own review gate, and the gate can run without a person reading the file first.

The tool handles mechanical consistency. The person handles domain knowledge that never made it into the text, which is the reason Kotyal insisted there is no oracle for specification correctness other than the user.

A workable sequence looks like this.

  1. Draft the requirements and rules as you normally would.
  2. Run the analyzer before any design or code generation begins.
  3. Resolve every reported ambiguity with the person who owns the domain.
  4. Supply rules for the gaps the pipeline identified.
  5. Re-run the check on the revised specification.
  6. Hand the settled specification to the coding agent.

FAQ

  • What is the Kiro spec analyzer? It is a requirements-analysis component in AWS's Kiro agentic IDE. It refines specification wording, formalizes rules into SMT formulas, checks them with a satisfiability solver, and reports ambiguities, conflicts and gaps before any code is generated.
  • Does the solver prove my specification is correct? No. The solver proves that the formalized rules are internally consistent. Correctness against business intent still depends on a person, and the talk states that no oracle exists for specification correctness other than the user.
  • Why translate the same requirement seven to ten times? Repeated translation produces several formal versions of one sentence. Clustering them by logical equivalence shows whether the model reads the requirement consistently, or whether the sentence genuinely supports more than one meaning.
  • Can the pipeline fix a conflicting rule on its own? It can detect the conflict and present options. The talk's example offers keeping the record as deleted or retaining it hidden from users, and the user chooses. If no answer arrives, an LLM judge or an abstention follows.
  • Does this make formal methods a settled part of agent workflows? The speaker described the evidence as thin and the technology as emerging, so the honest answer is no. The pipeline is a working engineering attempt, presented with its limits stated.
  • What does a gap mean in a specification? A gap is a state or scenario that no rule covers, such as an idle order. Nothing contradicts, so a coding agent would implement nothing for that case unless someone adds the missing rule.
  • Who is behind this work? Rajath Mahendrappa Kotyal works in AWS's automated reasoning group and helped build Kiro's requirements analysis. He presented the pipeline at the AI Engineer CODE conference and credited his team as the main contributors.
  • Where does an LLM judge fit if the solver cannot settle a question? It sits after the user, as a fallback when no human decision arrives. The pipeline can then abstain from implementing that portion rather than guessing.
  • What should I check before sending a spec to a coding agent? Look for rules that contradict each other, sentences that support two readings, and states no rule mentions. The talk's closing advice is to check the specification every time before it goes to the agent.

Turning a spoken conference talk into a reviewed article

A talk like this one packs its value into eight minutes of speech: the backorder pair, the clustering trick, the honest admission that evidence is thin. Transcribed and left as raw text, that value is hard to search, hard to quote and easy to lose. YouBlog turns a YouTube video into a written article so the reasoning survives past the conference page.

If you have recorded explanations, interviews or technical walkthroughs of your own, you can paste the video URL into YouBlog, let it transcribe the audio, and generate a structured article from the transcript. The teaching you already did becomes a page people can read. The same channel also publishes material on the Crazystack TypeScript program, the Bootcamp do Dev Doido training and guides from Gustavo Dev Doido.

Source video

YouTube thumbnail: Your Spec Has Bugs. Catch Them Before Your Agent Codes. - Rajath Mahendrappa Kotyal, AWS

Source video

Your Spec Has Bugs. Catch Them Before Your Agent Codes. - Rajath Mahendrappa Kotyal, AWS

Create from this video

This article was created automatically from a new video.

Automate my channel

Turn your YouTube videos into articles

Built for creators with a backlog and no editor on staff. This page started as a video. YouBlog drafts from the transcript, you review every word, then publish on a first-party /p/{slug} page. Nothing goes live until you publish it.

Turn your videos into articles

Published with YouBlog