{"id":70,"date":"2026-02-11T08:56:31","date_gmt":"2026-02-11T08:56:31","guid":{"rendered":"https:\/\/prageeth.online\/?p=70"},"modified":"2026-02-16T01:59:42","modified_gmt":"2026-02-16T01:59:42","slug":"stop-blaming-the-agent-why-your-ai-coding-projects-fail-without-guardrails","status":"publish","type":"post","link":"https:\/\/prageeth.online\/?p=70","title":{"rendered":"Stop Blaming the Agent: Why Your AI Coding Projects Fail Without Guardrails"},"content":{"rendered":"\n<p>I had to throw away a few of my code projects recently. And I&#8217;m not talking about little throwaway experiments \u2014 these were real projects I&#8217;d invested time in. They got to a point where they were really unmanageable. There was a lot of duplicated code, a lot of duplicated processes, and honestly, it just became a nightmare to work with.<\/p>\n\n\n\n<p>And here&#8217;s the thing \u2014 it wasn&#8217;t the AI agent&#8217;s fault.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>We&#8217;re Giving Agents Too Much Room to Guess<\/strong><\/h3>\n\n\n\n<p>The main problem we&#8217;re having at the moment when we&#8217;re instructing a coding agent to code is that we give them broader tasks in an open-ended manner. What that basically means is we leave the window open for the AI agent to interpret things on their own.<\/p>\n\n\n\n<p>Think about it. You tell an agent &#8220;build me a user management system&#8221; and now it has to figure out where to put things, what patterns to follow, whether to create new services or use existing ones. It doesn&#8217;t have the context you have in your head. So it makes decisions. And those decisions stack up.<\/p>\n\n\n\n<p>Before you know it, the agent has reinvented services that already exist in your codebase. It&#8217;s completely ignored your Domain-Driven Design boundaries because nobody told it about them. It&#8217;s duplicated logic everywhere because each task it worked on was in isolation \u2014 it had no idea about the bigger picture.<\/p>\n\n\n\n<p>This is what I keep seeing, and I think a lot of people working with AI coding agents are hitting the same wall.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The Runtime Interpretation Problem<\/strong><\/h3>\n\n\n\n<p>The way I see it, the core issue is that we&#8217;re letting agents do interpretation at runtime. You give it a vague task, and now the agent is making dozens of architectural decisions on the fly. Where should this logic live? Should I create something new or extend what&#8217;s already there? What conventions should I follow? <\/p>\n\n\n\n<p>Every single one of those decisions is a point where the agent might go in a completely different direction than what you had in mind. And when you multiply that across an entire feature \u2014 yeah, you end up with something that technically works but doesn&#8217;t really belong in your application. <\/p>\n\n\n\n<p>The solution isn&#8217;t to stop using AI coding agents. The solution is to stop asking them to think about architecture and start giving them clear blueprints to work from.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The Spec-Driven Approach<\/strong><\/h3>\n\n\n\n<p>This is where I&#8217;ve landed with a framework called <a href=\"https:\/\/github.com\/github\/spec-kit\">spec-kit<\/a>. The whole idea is pretty simple \u2014 instead of you allowing a coding agent to do the interpretation of what you want at runtime, you do this deliberately upfront.<\/p>\n\n\n\n<p>The workflow goes like this: <strong>Constitution \u2192 Specification \u2192 Clarification \u2192 Planning \u2192 Tasking \u2192 Implementation<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Start With a Constitution<\/strong><\/h4>\n\n\n\n<p>Every project needs a Constitution. It&#8217;s basically a living document that defines the core principles, vision, and mission of your application. Think of it as the ground truth for your codebase.<\/p>\n\n\n\n<p>It captures things like your architectural patterns, your domain boundaries, what services exist and what they&#8217;re responsible for, and the conventions that the agent absolutely has to follow. It&#8217;s not something you write once and forget about \u2014 it evolves as your application evolves. But it&#8217;s always there as the thing that keeps the agent grounded and stops it from drifting off into its own interpretation of what your app should look like.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Breaking Work Down Properly<\/strong><\/h4>\n\n\n\n<p>With the Constitution in place, you then write a specification for what needs to be built. That spec is grounded in everything the Constitution defines. From the spec, you create a plan. From the plan, you define tasks. <\/p>\n\n\n\n<p>And here&#8217;s the really important bit \u2014 once you define your tasks through this process, they are really nicely isolated chunks of work that a coding agent can fully concentrate on. The agent isn&#8217;t guessing about architecture anymore. It&#8217;s not wondering about domain boundaries. It&#8217;s not deciding whether to build something new or reuse what&#8217;s already there. All of that thinking has been done by you, the human, before the agent touches any code.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Why This Actually Works<\/strong><\/h3>\n\n\n\n<p>It works because it matches what AI coding agents are genuinely good at. They&#8217;re brilliant at implementing well-defined, bounded tasks. They&#8217;re great at following patterns that are already established. They&#8217;re really capable when they know exactly what &#8220;done&#8221; looks like. <\/p>\n\n\n\n<p>What they&#8217;re not good at \u2014 and what we really shouldn&#8217;t be expecting them to be good at \u2014 is holding the full context of a complex application while making architectural trade-offs. That&#8217;s your job. <\/p>\n\n\n\n<p>That&#8217;s always been your job. By shifting the interpretation work from runtime to upfront, you get the best of both. You do the thinking, the structuring, the guardrailing. The agent does the execution \u2014 fast, consistent, and tireless. Nobody&#8217;s doing the other&#8217;s job.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Think About It This Way<\/strong><\/h3>\n\n\n\n<p>If you tell a senior engineer to build a system and you give them open-ended requirements with no architecture docs, no domain boundaries, no conventions \u2014 they&#8217;ll build you something. It&#8217;ll probably work. But it won&#8217;t be what you had in your head. Now take that same senior engineer and give them clear principles, well-defined domain boundaries, established patterns, and a solid understanding of the existing codebase \u2014 and the outcome is completely different. Night and day. <\/p>\n\n\n\n<p>It&#8217;s the same with AI agents. We need to start thinking about them the same way we think about developers on our team. The more context we can give them, the more principles and practices we can put in place, the better the outcome. It&#8217;s really that simple. An agent with a Constitution, clear specs, and isolated tasks will outperform the same agent running on vibes and vague instructions every single time.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What I&#8217;d Suggest<\/strong><\/h3>\n\n\n\n<p>If you&#8217;re dealing with AI-generated codebases that have gone off the rails, don&#8217;t blame the agent. Look at the instructions you gave it. <\/p>\n\n\n\n<p>Start building a Constitution for your application. Break your work into specs before you ever open a coding agent session. Plan before you task. Task before you implement. And make every task isolated enough that the agent can succeed without needing to understand the entire universe your application lives in. <\/p>\n\n\n\n<p>The agents are ready. The question is whether we&#8217;re ready to use them properly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had to throw away a few of my code projects recently. And I&#8217;m not talking about little throwaway experiments \u2014 these were real projects I&#8217;d invested time in. They got to a point where they were really unmanageable. There was a lot of duplicated code, a lot of duplicated processes, and honestly, it just [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[20,19,18,17],"class_list":["post-70","post","type-post","status-publish","format-standard","hentry","category-blog","tag-ai-coding","tag-ai-coding-agents","tag-spec-driven-development","tag-spec-kit"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Stop Blaming the Agent: Why Your AI Coding Projects Fail Without Guardrails - Prageeth&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prageeth.online\/?p=70\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Stop Blaming the Agent: Why Your AI Coding Projects Fail Without Guardrails - Prageeth&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"I had to throw away a few of my code projects recently. And I&#8217;m not talking about little throwaway experiments \u2014 these were real projects I&#8217;d invested time in. They got to a point where they were really unmanageable. There was a lot of duplicated code, a lot of duplicated processes, and honestly, it just [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prageeth.online\/?p=70\" \/>\n<meta property=\"og:site_name\" content=\"Prageeth&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-11T08:56:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-16T01:59:42+00:00\" \/>\n<meta name=\"author\" content=\"Prageeth Sudusinghe\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prageeth Sudusinghe\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/prageeth.online\\\/?p=70#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/prageeth.online\\\/?p=70\"},\"author\":{\"name\":\"Prageeth Sudusinghe\",\"@id\":\"https:\\\/\\\/prageeth.online\\\/#\\\/schema\\\/person\\\/09643dd33af2fedc7621364fcc9875c1\"},\"headline\":\"Stop Blaming the Agent: Why Your AI Coding Projects Fail Without Guardrails\",\"datePublished\":\"2026-02-11T08:56:31+00:00\",\"dateModified\":\"2026-02-16T01:59:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/prageeth.online\\\/?p=70\"},\"wordCount\":1082,\"commentCount\":0,\"keywords\":[\"ai coding\",\"ai coding agents\",\"spec driven development\",\"spec-kit\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/prageeth.online\\\/?p=70#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/prageeth.online\\\/?p=70\",\"url\":\"https:\\\/\\\/prageeth.online\\\/?p=70\",\"name\":\"Stop Blaming the Agent: Why Your AI Coding Projects Fail Without Guardrails - Prageeth&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/prageeth.online\\\/#website\"},\"datePublished\":\"2026-02-11T08:56:31+00:00\",\"dateModified\":\"2026-02-16T01:59:42+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/prageeth.online\\\/#\\\/schema\\\/person\\\/09643dd33af2fedc7621364fcc9875c1\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/prageeth.online\\\/?p=70#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/prageeth.online\\\/?p=70\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/prageeth.online\\\/?p=70#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/prageeth.online\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Stop Blaming the Agent: Why Your AI Coding Projects Fail Without Guardrails\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/prageeth.online\\\/#website\",\"url\":\"https:\\\/\\\/prageeth.online\\\/\",\"name\":\"Prageeth's Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/prageeth.online\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/prageeth.online\\\/#\\\/schema\\\/person\\\/09643dd33af2fedc7621364fcc9875c1\",\"name\":\"Prageeth Sudusinghe\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ae7bb7d0b6022dfc0b9c25981bb75f0424b82c2b8aaec687155f47cd66cda3ca?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ae7bb7d0b6022dfc0b9c25981bb75f0424b82c2b8aaec687155f47cd66cda3ca?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ae7bb7d0b6022dfc0b9c25981bb75f0424b82c2b8aaec687155f47cd66cda3ca?s=96&d=mm&r=g\",\"caption\":\"Prageeth Sudusinghe\"},\"sameAs\":[\"http:\\\/\\\/prageeth.online\"],\"url\":\"https:\\\/\\\/prageeth.online\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Stop Blaming the Agent: Why Your AI Coding Projects Fail Without Guardrails - Prageeth&#039;s Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/prageeth.online\/?p=70","og_locale":"en_US","og_type":"article","og_title":"Stop Blaming the Agent: Why Your AI Coding Projects Fail Without Guardrails - Prageeth&#039;s Blog","og_description":"I had to throw away a few of my code projects recently. And I&#8217;m not talking about little throwaway experiments \u2014 these were real projects I&#8217;d invested time in. They got to a point where they were really unmanageable. There was a lot of duplicated code, a lot of duplicated processes, and honestly, it just [&hellip;]","og_url":"https:\/\/prageeth.online\/?p=70","og_site_name":"Prageeth&#039;s Blog","article_published_time":"2026-02-11T08:56:31+00:00","article_modified_time":"2026-02-16T01:59:42+00:00","author":"Prageeth Sudusinghe","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Prageeth Sudusinghe","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/prageeth.online\/?p=70#article","isPartOf":{"@id":"https:\/\/prageeth.online\/?p=70"},"author":{"name":"Prageeth Sudusinghe","@id":"https:\/\/prageeth.online\/#\/schema\/person\/09643dd33af2fedc7621364fcc9875c1"},"headline":"Stop Blaming the Agent: Why Your AI Coding Projects Fail Without Guardrails","datePublished":"2026-02-11T08:56:31+00:00","dateModified":"2026-02-16T01:59:42+00:00","mainEntityOfPage":{"@id":"https:\/\/prageeth.online\/?p=70"},"wordCount":1082,"commentCount":0,"keywords":["ai coding","ai coding agents","spec driven development","spec-kit"],"articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/prageeth.online\/?p=70#respond"]}]},{"@type":"WebPage","@id":"https:\/\/prageeth.online\/?p=70","url":"https:\/\/prageeth.online\/?p=70","name":"Stop Blaming the Agent: Why Your AI Coding Projects Fail Without Guardrails - Prageeth&#039;s Blog","isPartOf":{"@id":"https:\/\/prageeth.online\/#website"},"datePublished":"2026-02-11T08:56:31+00:00","dateModified":"2026-02-16T01:59:42+00:00","author":{"@id":"https:\/\/prageeth.online\/#\/schema\/person\/09643dd33af2fedc7621364fcc9875c1"},"breadcrumb":{"@id":"https:\/\/prageeth.online\/?p=70#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prageeth.online\/?p=70"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/prageeth.online\/?p=70#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prageeth.online\/"},{"@type":"ListItem","position":2,"name":"Stop Blaming the Agent: Why Your AI Coding Projects Fail Without Guardrails"}]},{"@type":"WebSite","@id":"https:\/\/prageeth.online\/#website","url":"https:\/\/prageeth.online\/","name":"Prageeth's Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prageeth.online\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/prageeth.online\/#\/schema\/person\/09643dd33af2fedc7621364fcc9875c1","name":"Prageeth Sudusinghe","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ae7bb7d0b6022dfc0b9c25981bb75f0424b82c2b8aaec687155f47cd66cda3ca?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ae7bb7d0b6022dfc0b9c25981bb75f0424b82c2b8aaec687155f47cd66cda3ca?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ae7bb7d0b6022dfc0b9c25981bb75f0424b82c2b8aaec687155f47cd66cda3ca?s=96&d=mm&r=g","caption":"Prageeth Sudusinghe"},"sameAs":["http:\/\/prageeth.online"],"url":"https:\/\/prageeth.online\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/prageeth.online\/index.php?rest_route=\/wp\/v2\/posts\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prageeth.online\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prageeth.online\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prageeth.online\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prageeth.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70"}],"version-history":[{"count":1,"href":"https:\/\/prageeth.online\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions"}],"predecessor-version":[{"id":71,"href":"https:\/\/prageeth.online\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions\/71"}],"wp:attachment":[{"href":"https:\/\/prageeth.online\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prageeth.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prageeth.online\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}