# Your Spec Has Bugs. Catch Them Before Your Agent Codes.

Rajath Mahendrappa Kotyal, AWS | AI Engineer | 07:50

Source: https://www.youtube.com/watch?v=0EnLxIbAvYk
Channel: AI Engineer (https://www.youtube.com/@aiDotEngineer). Summarised by AIE Talks.
Page: https://aietalks.com/talks/your-spec-has-bugs-catch-them-before-your-agent-codes
Published: 2026-11-11
Tags: agents, coding-agents

## TL;DR
- Kiro checks specifications for contradictions, gaps, and ambiguous wording before a coding agent generates code.
- The system translates requirements into SMT formulas and uses a satisfiability solver to test whether interpretations can hold together.
- LLMs generate possible interpretations, but the user resolves unclear requirements because domain knowledge cannot be guaranteed by the tool.

## Summary
Rajath Mahendrappa Kotyal presents Kiro, a specification analyzer for checking requirements before they reach a coding agent. He shows how individually reasonable rules can conflict when read together, such as placing an unavailable item on back order while also forbidding every back order. Kiro first asks an LLM to refine the wording. When that is insufficient, it translates the English into SMT formulas and sends them to a satisfiability solver. The system samples several translations, groups them by logical equivalence, and uses the different interpretations as evidence of ambiguity. It can also identify gaps where no rule covers a case. The tool offers the user possible resolutions, asks them to decide, or abstains from implementing the unclear rule. Kotyal is clear that the user remains responsible for correctness because implicit domain knowledge cannot be supplied reliably by an LLM or solver.

## Key ideas
### Specifications can contain rules that are individually sensible but jointly impossible
[00:21](https://www.youtube.com/watch?v=0EnLxIbAvYk&t=21s)
Kotyal uses an e-commerce example. One rule says that when an order is submitted while inventory is unavailable, the order should become a back order. Another says that no order should ever be placed as a back order. Each sentence appears reasonable on its own, but both cannot hold at the same time. A coding agent given the full specification may faithfully implement the contradiction. The analyzer aims to expose this conflict before design or code generation begins.

### The analyzer checks wording, relationships between sentences, and missing cases
[02:10](https://www.youtube.com/watch?v=0EnLxIbAvYk&t=130s)
Kotyal says specification bugs appear at different levels. A sentence may use the wrong wording or level of detail, while separate sentences may conflict or leave a gap. His example of a gap is an idle order for which no rule describes what should happen. The goal is to review these files before code is written, in the same way that teams inspect design documents, diagrams, and flowcharts before implementation.

### An LLM refines the text before formal reasoning is used
[02:34](https://www.youtube.com/watch?v=0EnLxIbAvYk&t=154s)
Kiro uses a three-step process. First, an LLM tries to clean up the specification's wording by itself. If that does not resolve the issue, the system formalizes the English into SMT formulas. A satisfiability solver then returns whether the resulting expression is valid. When it detects ambiguity within a sentence or a conflict between sentences, the system sends the sentence back to the LLM for another pass.

### Multiple translations reveal when an LLM is interpreting a requirement in different ways
[03:47](https://www.youtube.com/watch?v=0EnLxIbAvYk&t=227s)
After detecting a possible problem, Kiro asks the LLM to translate the requirement repeatedly, using seven or ten translations in Kotyal's example. It compares the interpretations through logical equivalence and clusters the translations that share the same assumptions. Different clusters indicate that the wording permits different meanings. The system can then ask the user to resolve the ambiguity or abstain from implementing the affected rule.

### Ambiguous actions need an explicit decision from the user
[05:09](https://www.youtube.com/watch?v=0EnLxIbAvYk&t=309s)
Kotyal gives the phrase "remove the record" as an example of wording that is too vague. It could mean deleting the record permanently, or keeping it while hiding it from users. Kiro presents these possible interpretations and asks which one the user wants. The tool does not silently choose an implementation for a requirement with multiple plausible meanings.

### The user remains the authority on specification correctness
[06:01](https://www.youtube.com/watch?v=0EnLxIbAvYk&t=361s)
Kotyal says there is no correctness oracle for a specification other than the user. A solver can find logical problems, and an LLM can suggest rewrites, but neither has the project's implicit domain knowledge. The user must still check every part of the rule set before passing it to an agent. He also says there is limited evidence so far about how formalization should be used in agents.

### The workflow is translate, check, then decide
[06:56](https://www.youtube.com/watch?v=0EnLxIbAvYk&t=416s)
Kotyal summarizes the division of work as: the LLM translates, the solver checks, and the human decides. Logical-equivalence clustering helps show where the model has produced genuinely different interpretations. If the user cannot resolve an issue, the system can use an LLM judge or abstain from implementing that part of the specification.

## Notable quotes
- "The LLM translates, the solver checks and the human decides." (06:56)
- "User needs to make sure to check every part of the snippet part of the rule book before sending it to the LLM." (06:01)
- "Remove the record is a very vague statement." (05:09)
- "We want to detect these bugs before they reach the codebase." (02:10)

## Tools & references mentioned
- Kiro
- AWS
- SMT-LIB
- SAT solver
- LLM judges
- formal methods
- automated reasoning

## Who should watch
- You give coding agents long requirements documents and want to catch contradictions before they become design or implementation work.
- Your specifications contain business rules with missing edge cases or phrases that can be interpreted in more than one way.
- You are evaluating formal methods alongside LLM-based checks and want to understand where a solver helps and where a human still has to decide.

## Related talks

- [Your Code Has Bugs. Lean4 Has Proofs: Formal Verification for Engineers](https://aietalks.com/talks/your-code-has-bugs-lean4-has-proofs-formal-verification-for-engineers) (Varun Pant, AWS, 10:07)
- [Spec-Driven Development: Agentic Coding at FAANG Scale and Quality](https://aietalks.com/talks/spec-driven-development-agentic-coding-at-faang-scale-and-quality) (Al Harris, Amazon Kiro, 1:03:50)
- [LLM codegen fails and how to stop 'em](https://aietalks.com/talks/llm-codegen-fails-and-how-to-stop-em) (Danilo Campos, PostHog, 19:18)
- [Agents reported thousands of bugs, how many were real?](https://aietalks.com/talks/agents-reported-thousands-of-bugs-how-many-were-real) (Ian Butler & Nick Gregory, Bismuth, 18:39)
- [Your Agent Hates Your CLI](https://aietalks.com/talks/your-agent-hates-your-cli) (Ayush Bhardwaj, Allos AI, 12:20)
