{"slug": "four-mistakes-building-honest-agents-with-kiro-and-how-each-one-ended-up-as-code", "title": "Four mistakes building honest agents with Kiro, and how each one ended up as code", "summary": "A bookkeeper and developer, working with Kiro during the Kiroween 2026 hackathon, built AgentBu, a skeleton for small-business AI agents that never invent facts or leak data, along with two apps on top of it: ContentBu, which links every claim to a source, and SupportBu, which never quotes a price. The developer turned four failures into code-level guards, including a no_offer check, a number guard and a repeat guard, and in a ReviewBu test the code stopped all 3 of 10 drafts that broke a rule before the owner saw them. Property-based tests with Hypothesis and fast-check also caught a cleaner that let an account number through and two flaky tests that matched a short secret inside the word \"true\".", "body_md": "*I wrote this post as part of the Kiroween 2026 hackathon.*\n\nDuring Kiroween 2026 I built **AgentBu** with Kiro: a skeleton for AI agents that know each small business inside out, never invent, and never mix or leak its data. On it, Kiro built two apps: **ContentBu**, which writes posts with every claim linked to its source, and **SupportBu**, which talks to a customer without ever giving a price.\n\nI work as a bookkeeper for small businesses, and the rule I care about most is simple: what cannot go wrong is not decided by the model, it is decided by code. Here are four times something went wrong, and what we did so it does not happen again. When I say \"we\", I mean Kiro and me. Claude was a support tool: it helped me write the briefs Kiro started from and review Kiro's results.\n\nThe first task of the capture spec was a spike: could ChatGPT or Claude save research into ContentBu through MCP? They could. But in the first test, the model saved an idea titled with an invented year (\"2025\") from its memory.\n\nWith vibe coding we would have kept building. With a spec, **the spec changed before any more code was written**:\n\nThe `new-app` hook is the heart of the skeleton: when Kiro creates `apps/<name>/APP.md`, the hook builds the app's skeleton and verifies it in **29.2 s** (measured on a throwaway test app). For two days, it did not fire.\n\nIt had two causes:\n\nWe found it with a temporary hook **with no matcher**, which only wrote the real event to a file. With the event in front of us, we fixed the matcher. And since the same `.kiro/` folder has to work on any computer, the test hooks no longer call Windows paths: they go through one Node helper that runs on Windows, Linux and macOS.\n\nOnce it went the other way: Kiro reported that a test hook had not fired, and it had. The permission prompt waited about six and a half minutes for me to approve it, and by the time Kiro looked for the process, the run had already finished. Kiro's session log showed the hook ran 11 seconds after the save.\n\nLesson: from an agent, ask for evidence, not a report.\n\nA ContentBu draft post offered a **\"FREE estimate\"** the business never offered. And SupportBu, in production, repeated an earlier answer.\n\nThe temptation is to improve the prompt. We did not: **each case became code with its own test.** The `no_offer` check stops offers like that one, the number guard requires every number in an idea to come from its captures, and the repeat guard keeps SupportBu from repeating an answer. They run before anything goes out: before a customer reads an answer, or before the owner sees a draft.\n\nIn ReviewBu, a third app I asked Kiro for to measure the skeleton, we tried the base's checks with the real model: of **10 tricky reviews, 3 drafts broke a rule** (a price, a discount, a stray number), and **the code stopped all 3** before the owner saw them.\n\nWe use property-based tests (Hypothesis in Python, fast-check in TypeScript) for the rules that cannot fail. fast-check generated this input:\n\n`acct 55555acct 55555`\n\nOne pass of the cleaner returned `[removed] acct 55555`: **an account number got through**, because the pattern needed a word boundary that two touching items do not have. Now the cleaner repeats until nothing changes, and the property holds.\n\nProperty tests also found bugs **in our own tests**. Two of them looked for a generated secret as a substring, so a short secret like `tru` was \"found\" inside `true`. They passed most of the time and failed now and then. Now they compare exactly. A flaky test is a bug too.\n\n`new-app`, `new-industry`, the one that checks every string exists in English and Spanish, and the ones that run the tests when a file changes.`honesty-reviewer`, read-only, that checks a change against the honesty rules before commit.\nAgentBu is not just ours: it is made so that anyone can add a rib.\n\n`apps/<your-app>/APP.md`, with what your app does, who talks to it and which of the base's tools it uses.\nA new industry? The `new-industry` hook does the same from one `INDUSTRY.md`, with no code change.\n\n`APP.md` to working in about 55 minutes of Kiro's time. (The plan had estimated about 17 hours of work; the build log notes the two are not the same kind of measure.)\nThe repo, the demos and the full story of how I used Kiro:\n\n*I wrote this post as part of the Kiroween 2026 hackathon (Skeleton Crew category).*", "url": "https://wpnews.pro/news/four-mistakes-building-honest-agents-with-kiro-and-how-each-one-ended-up-as-code", "canonical_source": "https://dev.to/jose_alejandrohernandez_/four-mistakes-building-honest-agents-with-kiro-and-how-each-one-ended-up-as-code-412", "published_at": "2026-12-04 04:06:06+00:00", "updated_at": "2026-12-04 04:15:29.958776+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-safety", "developer-tools"], "entities": ["Kiro", "AgentBu", "ContentBu", "SupportBu", "ReviewBu", "Claude", "Hypothesis", "fast-check"], "also_reported_by": [], "takeaway": "Enforce honesty rules in code with their own tests rather than in prompts: in ReviewBu, code guards stopped all 3 of 10 drafts that broke a rule, and property-based tests caught a cleaner that leaked an account number and two tests that matched a short secret inside \"true\".", "recommendation": {"advice": "Put non-negotiable rules like no offers, no invented numbers and no repeats in code checks that run before output ships, and back them with property-based tests that compare exactly rather than by substring.", "playbook": "output-verification", "playbook_url": "https://wpnews.pro/playbooks/output-verification"}, "alternates": {"html": "https://wpnews.pro/news/four-mistakes-building-honest-agents-with-kiro-and-how-each-one-ended-up-as-code", "markdown": "https://wpnews.pro/news/four-mistakes-building-honest-agents-with-kiro-and-how-each-one-ended-up-as-code.md", "text": "https://wpnews.pro/news/four-mistakes-building-honest-agents-with-kiro-and-how-each-one-ended-up-as-code.txt", "jsonld": "https://wpnews.pro/news/four-mistakes-building-honest-agents-with-kiro-and-how-each-one-ended-up-as-code.jsonld"}}