Category: AI Built Right

  • AI Built Right: Testing

    AI Built Right — Issue No. 5

    AI Built Right: Testing

    Why Every Layer of Testing Still Matters When AI Is Writing Your Code

    AI-generated code ships faster than ever. Management has noticed. In more than a few organizations, that speed is being used to justify eliminating the one thing that keeps fast code from becoming expensive code: testing.

    Published: March 2026  |  Series: AI Built Right  |  Reading time: ~12 min  |  Platform: AWS Bedrock

    I’ve been watching a troubling thread repeat itself on Reddit over the past several months. Developers posting from anonymous accounts, venting about the same situation: management has seen the productivity pitch for AI coding tools, they’ve decided it means testing is now optional, and the QA team either got reassigned or let go. The code ships. Production breaks. And somehow, nobody connects the dots back to the decision to skip testing.

    I’ve been building production AI solutions on AWS Bedrock for a year now. AI coding assistance is genuinely transformative — I wouldn’t trade it. But “transformative” and “self-verifying” are not the same thing, and conflating them is how you end up explaining an outage to your board.

    This article walks through each level of the testing stack: what it catches, why AI-generated code makes it more necessary rather than less, and why low-code platforms leave a dangerous gap right where you need coverage most.


    The Low-Code Problem: No Testing, No Environment

    Let’s start with the platforms. If you’re building AI workflows in Replit, Make, or Zapier, you’re working in environments that were not designed around software development discipline. That’s not an insult — they were designed for speed and accessibility, and they deliver on that. But speed and accessibility come with structural trade-offs that matter the moment your solution is handling real data, real users, or real money.

    Zapier has no native staging environment at the standard tier levels. Their own community forums have threads dating back years from developers asking how to manage separate development and production environments — the answer is typically “duplicate your Zaps manually and point them at different credentials.” That’s not a testing strategy. That’s a workaround.

    Make is more capable and its visual canvas gives you better visibility into workflow logic. But as even Zapier’s own comparison content acknowledges, Make lacks built-in sandbox testing and real-time alerting. Their error handling tools — routers, iterators — are genuinely useful for building, but they don’t substitute for the ability to run your automation against a fully isolated test environment before it touches production data.

    Replit is worth examining separately because their Agent 3 product actually does incorporate some automated testing during the build process. Their engineering team wrote openly about the challenge: traditional unit and API testing covers narrow functional slices but misses the client-server boundary where, as they put it, “the mess of problems lurk.” To their credit, Replit has invested in browser automation to address this. But that automated self-testing happens within Replit’s own build loop — it is not a substitute for your organization running acceptance testing against defined requirements, edge cases, and real user workflows. The agent is testing whether it built something that runs. You still need to test whether it built the right thing.

    ⚠ The Structural Gap

    None of these platforms give you code scanning, pre-commit hooks, version-controlled test suites, or a formal staging environment that mirrors production. They give you a place to build and a button to deploy. Everything in between is your responsibility — and most teams using low-code tools don’t realize that responsibility exists until something fails in production.


    What AI-Generated Code Actually Does

    Before I walk through the testing layers, I want to be specific about the failure modes I’ve encountered building production AI solutions. Not theoretical risks — things I’ve hit repeatedly, across different projects, with different models.

    The Hard-Coded Fallback Problem

    AI coding assistants have a strong habit of inserting default fallback values when an interface call fails. This is well-intentioned behavior — the AI is trying to make the code resilient. The problem is that it does this quietly, without flagging it, and often with values that look plausible. An API call to a pricing service fails; the AI has already provided a fallback price. A configuration fetch returns null; the AI has substituted a default timeout. The application keeps running. Everything appears to work. Your monitoring shows no errors. Your unit tests pass because the happy path is fine.

    You only discover the problem when a customer reports that they were charged the wrong amount, or when you notice a pattern in your logs that doesn’t make sense. By then, the fallback has been silently firing in production for days or weeks. This behavior is so frequent that before I push code, I ask the AI show me where it has hard-coded fallback values.

    Interface and Handoff Failures in Step Functions

    AWS Step Functions are one of the most effective patterns for orchestrating AI workflows. They’re also one of the most common places I see AI-generated code fail quietly. When I ask an AI to build a multi-step function, it will write each Lambda correctly in isolation. But the interface between steps — the exact shape of the input and output, the handling of partial responses, the error state propagation — is where things go wrong.

    Combine this with the fallback problem above and you have a genuinely dangerous situation: Step B receives malformed output from Step A, substitutes a default value, and continues executing. The workflow completes successfully. The result is wrong. Nothing in your logs tells you why.

    External APIs are even worse. If you don’t pull the API’s documentation and include it in your coding prompt, the AI coding tool will simply make up variables and supported values. Again, it will usually provide bogus default fallback values when the API call fails.

    Error Handling Is Always Incomplete on the First Pass

    I’ve made it a practice at the end of every build to ask the AI directly: “Are we handling all expected errors gracefully?” Without exception, the answer involves changes. Sometimes it’s a missing catch block on an external service call. Sometimes it’s an unhandled edge case in parsing. Sometimes it’s a retry that doesn’t account for idempotency. The AI knows what good error handling looks like — it just doesn’t always apply it unprompted.

    Pre-Commit Hooks Always Find Something

    I run pre-commit hooks on every project: linting, secret scanning, dependency auditing, basic static analysis. I have never — not once — pushed AI-generated code through a pre-commit hook and gotten a clean pass on the first try. Usually it’s minor: formatting violations, an unused import, a dependency with a known vulnerability. Occasionally it’s more significant. The point is that these tools catch real issues, consistently, in code that an AI produced and that I reviewed. Without them, some of those issues ship.

    ⚠ Industry Case Study

    Air Canada and the Liability of Untested AI Output

    In February 2024, British Columbia’s Civil Resolution Tribunal ruled against Air Canada after a customer was given incorrect information by the airline’s AI chatbot regarding bereavement fares. Air Canada’s defense was remarkable: they argued the chatbot was “a separate legal entity” responsible for its own actions. The tribunal rejected this outright. The airline was held liable for negligent misrepresentation by its own AI system.

    The chatbot’s response directly contradicted Air Canada’s own published policy — a discrepancy that functional acceptance testing would have caught. Proper UAT against defined business rules, with test cases covering bereavement fare scenarios, would have flagged the hallucination before it ever reached a grieving customer. The lesson isn’t that AI chatbots are dangerous. It’s that deploying AI-generated responses without testing them against your actual policies and business logic is a liability you own entirely.


    The Testing Stack, Layer by Layer

    Good testing isn’t a single activity that happens at the end of a build. It’s a layered discipline where each level catches a different category of problem. With AI-generated code, the case for all five layers is stronger than it’s ever been.

    Layer 1: Static Code Analysis and Security Scanning

    Static analysis runs before anything executes. Tools like Bandit (Python), ESLint, Semgrep, and Checkov analyze your code for known vulnerability patterns, security misconfigurations, and policy violations without running the code itself. Pre-commit hooks — using a framework like pre-commit.ci or running checks directly in your CI pipeline — enforce that these scans run on every commit before it reaches your repository.

    For AI-generated code specifically, security scanning deserves extra attention. AI models sometimes invent non-existent packages or reference internal functions that don’t exist — a problem called hallucinated dependencies. If a developer installs a package suggested by an AI without auditing it first, they may be installing something that doesn’t exist yet, which creates an opening for a typosquatting attack when someone registers that package name with malicious code. A dependency audit on every AI-suggested package, run as part of your pre-commit and CI process, is not optional.

    OWASP maintains a regularly updated list of the top security vulnerabilities in web applications. A 2024 Stanford study found that AI-assisted developers were more likely to introduce security vulnerabilities than those coding manually, with common issues including SQL injections and weak input validation. These are exactly the categories that static analysis tools are designed to catch. Run them.

    Standard tooling for this layer includes:

    • Bandit — Python security linting
    • Semgrep — customizable static analysis for multiple languages
    • Checkov — infrastructure-as-code security scanning (critical for Terraform and CDK on AWS)
    • Trivy or Grype — container and dependency vulnerability scanning
    • detect-secrets — catches credentials and API keys before they reach your repository
    # .pre-commit-config.yaml — minimal example for a Python/AWS project
    repos:
      - repo: https://github.com/pre-commit/pre-commit-hooks
        rev: v4.5.0
        hooks:
          - id: trailing-whitespace
          - id: end-of-file-fixer
          - id: check-yaml
          - id: check-added-large-files
    
      - repo: https://github.com/PyCQA/bandit
        rev: 1.7.7
        hooks:
          - id: bandit
            args: ["-c", "pyproject.toml"]
    
      - repo: https://github.com/Yelp/detect-secrets
        rev: v1.4.0
        hooks:
          - id: detect-secrets
    
      - repo: https://github.com/bridgecrewio/checkov
        rev: 3.2.0
        hooks:
          - id: checkov
            args: ["--directory", "infrastructure/"]

    Layer 2: Unit Testing

    Unit tests verify that individual functions and methods return the expected output for a given input. They are fast, isolated, and they run in your CI pipeline on every push. For AI-generated code, they serve a specific and critical function: catching the fallback problem described earlier.

    When a function is supposed to call an external service and return that service’s response, your unit test should mock the service call and verify that the function handles both the success case and the failure case correctly — not just that it returns something. If the function silently substitutes a default value when the service call fails, a properly designed unit test will catch it.

    “The AI was often testing its own assumptions, not my intent. The generated tests were beautiful boilerplate, but they rarely included the complex edge cases, domain-specific constraints, or legacy system interactions that actually matter.” — Senior engineer on AI-generated test suites, 2025

    I admit I rely on the AI to write most of my unit tests, as I find this work extremely boring. This is a poor practice, though I do make sure it covers the specified acceptance criteria. Of course, asking the AI to write your unit tests creates a circular problem. The AI writes the code, then writes tests that verify what the code does — not necessarily what the code should do. Your tests need to be grounded in your requirements, your data contracts, and your business rules. AI can help write the boilerplate. A human needs to define the assertions.

    Layer 3: Integration and System Testing

    Integration tests verify that components work together correctly. System tests verify that end-to-end workflows produce the expected outcomes. These are the tests that catch the Step Function interface failures I described earlier — the cases where every Lambda is correct in isolation but the handoffs between them are broken.

    On AWS, this means running integration tests against a dedicated testing account or environment, using real (but sandboxed) versions of your services. Not mocks — the mocks can’t catch infrastructure misconfigurations, IAM permission gaps, or the subtle behavioral differences between a mocked DynamoDB and the real one at scale.

    Analysis of nearly 500 open-source GitHub pull requests found that AI-generated code creates 1.7 times more issues than human-written code. System tests are where many of those issues surface for the first time. The code runs. The logic is wrong. Only a test that exercises the full workflow against realistic data will find it.

    Layer 4: Internal Acceptance Testing

    Internal acceptance testing (IAT) — sometimes called alpha testing, developer acceptance testing or pre-UAT — is the phase where the person who wrote the requirements (product owner, business analyst) validates the solution against your documented requirements before it goes to end users. This is different from system testing: system tests verify technical correctness; IAT verifies that the system does what you actually asked it to do.

    This distinction matters enormously for AI projects, because AI solutions are often built iteratively — requirements evolve during the build. By the end of a multi-week project, there are frequently requirements that were added mid-stream and documented in a ticket somewhere but never explicitly verified end-to-end. IAT is where those gaps show up.

    My IAT process for every production AI project includes two things: detailed and evidenced testing of the acceptance criteria on every user story, a structured walkthrough of each major workflow with someone who wasn’t involved in the build to identify required tests based on the architecture. Both of these steps find defects or improvements 90% of the time.

    Layer 5: User Acceptance Testing

    User acceptance testing is where the real world shows up. Your users know things about your domain, your edge cases, and your data that didn’t make it into the requirements document. They will find scenarios that nobody on the build team thought to test. They will use the interface in ways that don’t match your assumptions. And when they do, you want to discover those scenarios in a controlled testing environment, not in production.

    For AI-specific solutions, UAT has an additional dimension: users need to validate not just that the system works, but that the AI’s outputs are accurate, appropriate and consistent. If you’ve built a document summarization tool, your users are the ones who can tell you whether the summaries are correct and useful. If you’ve built an AI workflow that makes decisions, your users are the ones who can identify the cases where the decision logic is wrong. No automated test can substitute for domain expertise evaluating AI outputs.

    The Air Canada case is an instructive example of what UAT would have caught. A basic UAT script for a customer-facing chatbot covering the bereavement fare scenario — “does the chatbot give correct information about bereavement fare eligibility and process?” — would have exposed the hallucination before it ever reached a real customer. Instead, a grieving customer got wrong information, and Air Canada spent time in a tribunal arguing that their own chatbot was a separate legal entity. The ruling serves as a reminder of the legal and ethical obligations businesses have towards consumers, requiring rigorous testing and oversight of AI systems to prevent misinformation.


    What the Industry Data Says

    If you’re making the case internally for maintaining your testing practices in the face of “the AI will handle it” pressure, here’s what the data looks like right now.

    “AI coding tools dramatically increase output, but they also introduce predictable, measurable weaknesses that organizations must actively mitigate,” according to CodeRabbit’s director of AI, reflecting on their 2025 analysis. That analysis found AI-generated code creates significantly more issues than human-written code — not in spite of higher output volume, but correlated with it. More code, faster, with less review depth per line.

    Developer trust in AI accuracy dropped from 69% in 2024 to 54% in 2025. Only 16% of QA teams have actually adopted AI for testing, despite 75% calling it a strategic priority. The people who use AI tools every day are becoming more skeptical, not less. That skepticism is earned. The more production experience developers have with AI-generated code, the more clearly they understand what testing is still catching.

    RAND Corporation research found that more than 80% of AI projects fail to reach meaningful production deployment — exactly twice the failure rate of IT projects without AI components. There are multiple causes for this, but insufficient testing infrastructure is consistently cited among them. The complexity of AI systems — the non-determinism, the dependency on external models, the difficulty of reproducing failures — makes testing harder, not easier. Treating it as optional is how you end up in that 80%.


    Building the Testing Culture Back In

    If you’re the person trying to push back on “AI writes the code so we don’t need testing” in your organization, the framing matters. The argument isn’t “AI is bad” — it’s “AI changes the risk profile in ways that make testing more important, not less.”

    AI-generated code is faster to produce and harder to audit. It has consistent failure modes — the hard-coded fallbacks, the interface gaps, the incomplete error handling — that are predictable and therefore catchable. A well-designed test suite catches those failure modes reliably. The cost of that test suite is fixed. The cost of a production failure is not.

    For teams moving from low-code tools to production AI development, the testing infrastructure is part of what you’re building. Pre-commit hooks, a CI/CD pipeline with automated test runs, a staging environment, a formal UAT process — these aren’t overhead. They’re the engineering foundation that makes it safe to move fast. Without them, “moving fast” just means “failing faster.”

    ⚠ A Note on AI-Generated Tests

    AI can absolutely help you write tests — I use it for scaffolding test files, generating mock data, and writing boilerplate assertion code. But the AI cannot define your test cases. Test cases come from your requirements, your business logic, and your knowledge of edge cases in your domain. If you let the AI define both the code and the tests, you get a system that is internally consistent but not necessarily correct. Treat AI test generation the same way you treat AI code generation: useful starting point, requires human review and augmentation.


    The Quick Reference: Testing Responsibilities by Layer

    Layer What It Catches Low-Code Support Critical for AI Code?
    Static Analysis / Code Scanning Vulnerabilities, secrets, dependency risks, formatting No Yes
    Unit Testing Fallback values, incorrect output, edge case handling No Yes
    Integration / System Testing Interface failures, step function handoffs, data contract violations No Yes
    Internal Acceptance Testing Missing requirements, error path gaps, requirement drift Partial Yes
    User Acceptance Testing Domain accuracy, AI output quality, real-world edge cases Partial Yes

    Note on “Partial” for IAT/UAT in low-code tools: these testing phases can technically be performed against any deployed system, including low-code tools. The “Partial” rating reflects that low-code platforms lack the infrastructure to formalize, automate, or version-control these processes. Manual walkthroughs are possible; a repeatable, traceable testing process is not.


    Bottom Line

    AI coding assistance is one of the most useful things to happen to software development in a long time. I use it on every project. I will continue to use it. I am also deeply skeptical of it in the specific, targeted ways that nearly two years of production experience have taught me to be — and I test accordingly.

    The argument that AI-generated code doesn’t need testing isn’t a bold bet on new technology. It’s a familiar story with a predictable ending: a defect that testing would have caught reaches production, costs ten times what testing would have cost to fix, and leaves an organization explaining to someone why their AI did something it shouldn’t have done.

    The testing stack isn’t slowing you down. It’s what makes it safe to go fast.

    About This Series

    AI Built Right is a series for technical founders, product leaders, and CTOs navigating the decision between low-code AI tools and production-grade AI development.

    The author works as an AI Program Manager and Fractional CTO for AI startups, specializing in production-grade AI on AWS.

  • AI Built Right: Environments

    Low-code tools like Replit, Make, and Zapier collapse development, testing, and production into a single fragile layer. Here’s what that costs you — and how to do it right.

    Published: March 2026  |  Series: AI Built Right  |  Reading time: ~10 min

    There is a moment every organization running AI on a low-code platform eventually experiences. A developer — or worse, the AI agent itself — tweaks something to test a new idea. The change goes live immediately. There is no test environment to absorb the blast. There is no staging gate to catch it. The “fix” becomes the incident.

    This is not a hypothetical. In July 2025, it happened in broad daylight, on social media, to a real company using Replit. An AI agent deleted an entire production database. Months of work, gone. And in the aftermath, Replit’s own CEO had to announce that the platform would be adding the most fundamental safeguards of software engineering — things that proper development environments provide by default.

    Welcome to AI Built Right — a series for founders, CTOs, and product leaders who want to build AI solutions that hold up under real-world conditions. Today we’re talking about: environments.


    The Three-Environment Model

    Before we examine where low-code tools fall short, let’s establish the baseline. Every mature software system — and every well-engineered AI solution — operates across three distinct, isolated environments:

    Each environment has its own compute resources, databases, API keys, secrets, authentication, permissions and configuration. Code moves forward through the pipeline — never backward, never sideways, and critically: never directly from a developer’s mind into a live system.

    This model is not bureaucratic overhead. It is a risk management system. It is the mechanism that lets teams ship fast without shipping broken things to customers. This has been the standard IT development best practice for decades. It still applies to AI solutions that are being used to support real business solutions. And isn’t that where AI adds real value? AI isn’t adding value as a prototype or experiment built on a low-code tool.


    The Incident That Proved the Point

    ⚠ Case Study — July 2025

    The Replit Production Database Wipeout

    A user asked Replit’s AI agent to help build a software application. During the session, the agent — operating with direct write access to a live production database — made a “catastrophic error in judgment,” deleted the entire database, and then informed the user that recovery was impossible and all versions had been destroyed.

    Luckily, a standard database rollback, when attempted by humans, worked perfectly. The AI’s self-assessment of the situation was also wrong. Thank goodness the company had developers on staff that knew how to perform a rollback.

    Replit’s CEO responded publicly, calling the incident “unacceptable and should never be possible,” and announced the platform would be implementing: automatic separation of development and production databases, the creation of staging environments, a planning/chat-only mode to enforce code freezes, and improved backup features.

    In other words: the CEO of a major AI development platform announced, in 2025, that his platform would be adding safeguards that the software industry standardized decades ago.

    The root cause was not the AI’s judgment. The root cause was architectural: there was no wall between an experimental AI-assisted session and a live production system. The environment was flat. Everything was production. And the AI had write and delete access to all of it.

    This is what happens when you skip environments. Not if. When.


    What the Low-Code Tools Actually Offer

    I reviewed the official documentation and community forums for all three major platforms to confirm where each stands today. The results are clear — and instructive.

    Replit

    Replit markets itself as a platform for building “production-ready apps” and positions its AI Agent as capable of autonomous deployment. What it does not provide is a native, first-class separation between development, staging, and production environments. As the July 2025 incident demonstrated, its default architecture places an AI agent with broad permissions in direct contact with live infrastructure.

    Following the database incident, Replit committed to adding environment separation — which confirms it was not there by default. Community threads and third-party analyses note that enterprise developers requiring environment parity, compliance, or advanced DevOps integration find Replit’s ecosystem limiting for exactly this reason.

    ⚠ Documentation Gap — Replit

    As of this moment, Replit hasn’t implemented separate environments 10 months after this incident. Strange, since Replit is a tool to be able to build code quickly. Replit has no native dev/staging/production environment framework. Environment separation, where attempted, is achieved by creating entirely separate projects or accounts — a workaround, not a solution. There is no native promotion pipeline, no built-in environment variable scoping by environment tier, and no infrastructure-as-code layer to ensure parity between environments.

    Make (formerly Integromat)

    Make’s community forums tell the story plainly. Since at least 2023, users have been asking how to separate development and production — and the platform’s own community has no canonical answer. The suggested workaround is to maintain two entirely separate connections with hardcoded base URLs for each environment. A 2024 thread on the same topic revisited the problem with no new resolution.

    Make has no native concept of environment tiers. There is no mechanism to promote a scenario (their term for a workflow) from development to staging to production. There are no environment-scoped variables. A developer testing a change is working on the same platform, with the same potential to trigger live integrations, as the production system.

    ⚠ Documentation Gap — Make

    Make provides no native environment management. Workarounds involve duplicating entire scenarios and manually maintaining separate connections — error-prone, inconsistent, and completely lacking any promotion or audit trail. One community member described the approach as “a little cumbersome” and noted there are no published best practices for it.

    Zapier

    Zapier’s community forums contain years of users requesting environment management, with responses from Zapier staff saying “we don’t have that sort of functionality available at present.” The documentation’s closest approximation — using version numbers and environment variables as flags within a single integration — is explicitly acknowledged as a workaround, not a solution.

    One Zapier community post from a user planning a production cutover captures the problem with painful clarity: “Manual changes are error prone and high risk — not what you want when going to production.” Zapier’s own official documentation even warns users against creating separate integrations for staging purposes, instead recommending a single integration with conditional logic to switch environments. This is, architecturally, the opposite of isolation.

    ⚠ Documentation Gap — Zapier

    Zapier has no native dev/staging/production environment separation. Its official documentation recommends against using separate integrations for this purpose. Changing connections between environments deletes field mappings, making safe promotion effectively impossible without manual rework at every step.

    The Comparison at a Glance

    Environment Purpose Data Risk
    Development Write code, unit test, iterate freely. Errors are expected. Synthetic / dummy data Contained — no real users
    Staging / Testing Integration and QA testing. Production mirror. Catches issues before they matter. Anonymized / realistic test data Low — restricted access
    Production Live system. Real users, real data, real consequences. Live customer data High — changes arrive only after passing prior two gates
    Capability Replit Make Zapier AWS Bedrock
    Native Dev / Staging / Prod environments No No No Yes
    Environment-scoped secrets & config Workaround No Version-based Yes (SSM / Secrets Mgr)
    Automated promotion pipeline (CI/CD) No No No Yes (CodePipeline)
    Human approval gate before production No No No Yes (IAM + Manual Gate)
    Infrastructure as Code (env parity) No No No Yes (CDK / Terraform)
    Isolated AI model endpoints per env No No No Yes (Bedrock per-env)
    Rollback capability Limited No Version history Yes (CodeDeploy)

    How to Do It Right: Environments on AWS Bedrock

    A production-grade AI solution treats environments as first-class infrastructure. I’m familiar with AI development on AWS so I’m going to refer to AWS capabilities, but you can build the same environment structure on Google Cloud or Azure. Here is what that looks like in practice.

    1. Separate AWS Accounts per Environment

    The gold standard — and AWS’s own recommended approach — is to provision separate AWS accounts for development, staging, and production. This provides the hardest possible boundary: an IAM policy error in development cannot affect a production resource because the two exist in entirely different account spaces. Use AWS Organizations to manage them as a family, with consolidated billing and security profiles. The dev and staging environments can be combined on a single account for management simplicity and some cost savings.

    Development to Staging to Production environment flow diagram

    2. Environment-Scoped Secrets and Configuration

    AWS Secrets Manager allow you to namespace secrets by environment. Your Lambda functions, ECS containers, and Bedrock agent configurations pull their credentials and configuration from paths like /prod/openai-key or /dev/db-connection-string. The same code runs in all three environments; only the resolved values differ. This eliminates the hardcoded credentials and configuration drift that plague low-code setups.

    3. A Human Approval Gate Before Production

    AWS CodePipeline and CI/CD setups on GitHub support manual approval actions — a required human review step that blocks any deployment to production until a named approver signs off. This is the gate that prevents an AI agent, an eager developer, or an automated process from touching live infrastructure without review.

    4. Isolated AI Model Endpoints

    AWS Bedrock’s provisioned throughput model allows you to configure separate model invocation settings per environment. Your development environment might use on-demand throughput with aggressive rate limits to control costs. Your staging environment mirrors production’s throughput to catch performance issues before they go live. Production runs at full specification. Critically, each environment has its own Bedrock Guardrails configuration — you can apply looser guardrails in development for faster iteration while maintaining strict content filtering in production.

    5. Environment Parity Through Infrastructure as Code

    With AWS CDK or Terraform, the infrastructure for all three environments is defined in the same codebase, parameterized by environment. This eliminates “works in staging, breaks in production” failures caused by configuration drift. If staging passes, production will behave identically — because they were built from the same template.

    ✓ What Proper Environments Deliver

    When you implement this pattern correctly, you get: safe experimentation in development without fear of data loss, a staging environment that catches integration failures before users see them, a production environment with a documented, auditable deployment history, immediate rollback capability if something goes wrong, and an AI agent that cannot, by architectural design, access production without human approval.


    The Real Cost of Skipping This

    The appeal of Replit, Make, and Zapier is real. They are fast, low-friction, and genuinely excellent for prototyping and simple automations. For many use cases — particularly internal, low-stakes workflows — they may be entirely appropriate.

    But when the stakes go up — when your AI agent is touching customer data, executing financial transactions, communicating on behalf of your company, or making decisions with real-world consequences — the absence of proper environments is a material risk. Not a theoretical one.

    The cost shows up in several ways:

    Incident cost. When a bug reaches production that should have been caught in staging, the cost is not just the fix. It is the customer impact, the reputational damage, and the emergency engineering time. The Replit incident wiped out months of work in seconds. A proper staging environment would have surfaced the behavior long before it reached a live system.

    Compliance cost. Any organization operating under SOC 2, HIPAA, PCI-DSS, or similar frameworks requires documented environment separation as a control. A “single environment” AI platform is a compliance finding waiting to be written.

    Iteration cost. Counterintuitively, proper environments make you faster. When developers can experiment freely in development without fear of consequences, they iterate more boldly. When staging catches problems, teams build confidence that production deployments will succeed. The friction is front-loaded, not catastrophic.

    Vendor lock-in cost. Low-code platforms own your workflow definitions. If Make changes its pricing, or Zapier deprecates a feature, or Replit’s Agent does something unexpected, your automation logic is trapped in a proprietary format with no migration path. Proper code on AWS is portable, version-controlled, and owned entirely by you.


    The Bottom Line

    The conversation around AI tools has become dominated by speed-to-demo. How fast can you go from idea to something running? That is a useful question for prototypes. It is the wrong question for production systems.

    The right question is: how fast can you go from idea to something running reliably, safely, and sustainably in production? That question demands environments. It demands gates. It demands the kind of architecture that proper software development has refined over decades — now applied to the AI layer.

    Replit, Make, and Zapier are tools. They are not architectures. When you need an architecture — and any AI solution handling real data for real users needs one — you need to build it properly.

    That is what AI Built Right is about.


    About This Series

    AI Built Right is a series for technical founders, product leaders, and CTOs navigating the decision between low-code AI tools and production-grade AI development. Each article covers one dimension of what it means to build AI solutions that hold up — on AWS Bedrock and other architectures, with proper engineering discipline, without vendor lock-in.

    The author works as an independent AI Program Manager and Fractional CTO for AI startups, specializing in production-grade AI on AWS.

  • AI Built Right: Logs

    Not this type of log.

    Your AI Solution Has Logs, Right?

    Low-code AI tools tell you whether your workflow ran. They don’t tell you what your AI actually did. No record of what the model was asked, what it returned, how long it took, or how much it cost. When something goes wrong — and something always goes wrong — you’re in the dark.

    Here’s the logging capabilities production-grade AI solutions provide that low-code tools don’t.

    AI is random. Logs show you the randomness.

    I built an automated image generator. An LLM creates the image prompt based on a changing weekly topic, then passes it to an image generation model. The output quality was inconsistent. Without a log capturing the intermediate prompt, I had no idea why — the randomness was invisible. Once I could see what prompt was actually being generated, I could tune it. You can’t improve what you can’t see.

    Logs surface failures that look like nothing.

    That same tool started silently failing. No crash, no error message to the user — just no image. Without a log capturing the LLM’s raw API response, I’d have never found it. The image generator was blocking requests because the prompt mentioned alcohol. A log showed me the exact rejection reason. I changed the prompt to describe the liquid rather than citing alcohol: “beer” to “golden bubbly liquid” and it worked. That fix took five minutes. Finding it without a log would have taken days — or never happened at all.

    Logs tell you what things cost.

    LLM APIs return token consumption with every response. Log it. I had an analytics solution costing hundreds of dollars per run because it was feeding thousands of unnecessary records into a reasoning model. That only became visible in the logs. Once I saw it, the fix was straightforward. Without logs it would have kept burning money indefinitely.

    Errors happen. Logs tell you about them.

    A properly built AI solution won’t crash when an LLM times out or fails to return a response. It’ll handle it gracefully. But graceful handling without logging is just silent failure with better manners. You need a record of every failure and ideally a notification when failure rates spike. Otherwise you start losing customers for no obvious reason.

    Custom Logs Give You Full Visibility

    Low code AI tools only tell you something failed. They don’t give you the ability to figure out why it failed. A production-grade AI solution will allow the creation of custom logs to help trace defects. The number of times I’ve added custom logging messages to trace an error are too numerous to cite. I’ve even made it a standard practice to build a feature flag for full logging versus minimal logging. I can turn the full logging on during development and turn it off in production so the logs are cleaner.

    A note on low-code tools.

    Zapier, Make, and similar platforms have their place. Quick prototypes, simple automations. But they don’t give you a complete logging infrastructure. When your business is depending on the solution — when it’s running in production, touching customers, spending your money — you need to know what it’s doing.

    That’s not optional. That’s just how production-grade software is supposed to work.