Skip to main content
Building with AI (Vibe Coding)

⏱ About 20 min20 XP

The Human-in-the-Loop Discipline

'Human-in-the-loop' is a term from control systems and AI safety that describes architectures where a human makes or approves decisions at critical points, rather than allowing an automated system to act without oversight. In vibe coding, maintaining human-in-the-loop discipline is the practice — and it is a practice, not a passive state — of staying genuinely in control of what gets built, reviewed, and deployed. It is easy to slide into a mode where the AI generates and you deploy, with reviewing reduced to a formality. That slide is where mistakes accumulate.

What Losing Control Looks Like

Losing control in a vibe coding workflow does not usually happen all at once. It happens in small slides, each individually defensible, that compound into a situation where the builder no longer understands what is running in production. Slide 1: Speed pressure. The AI generates code quickly. Reviewing it carefully takes time. Under pressure to ship, review is shortened to 'does it run?' instead of 'does it do the right thing?' Slide 2: Context accumulation. A project grows over multiple sessions. Each session adds new generated code. After enough sessions, no single person has a complete mental model of what the whole system does. New code is generated and added to a system the builder no longer fully understands. Slide 3: Deference to apparent fluency. The AI's output reads well and sounds confident. The builder, uncertain of their own ability to judge technical correctness, defers to the AI's apparent confidence rather than their own systematic review. Slide 4: Test drift. Early in the project, the builder tested carefully. As features accumulated, testing became selective, then nominal. The system now has deployed code that was never meaningfully tested against realistic inputs. None of these slides is catastrophic in isolation. Combined, they describe a project that is running on trust rather than understanding — which is a fragile foundation for any software that affects real users.

The Discipline Defined

Human-in-the-loop discipline in vibe coding means: you do not deploy code you have not read; you do not ship features you have not tested; you do not accept AI decisions about security, data handling, or architecture without deliberate evaluation. It is not about doing everything yourself — the AI does the generation. It is about maintaining genuine understanding and conscious decision-making at every consequential step.

What does maintaining human-in-the-loop discipline look like in practice? Several concrete habits structure it. The review gate. Before any generated code is committed or deployed, the builder reads it — at minimum to the level of structure and data flow (layers 1 and 2 from the previous lesson). Code that the builder cannot read at all — perhaps because it is in an unfamiliar language or framework — is code the builder cannot take responsibility for. If that is the case, the right move is to ask the AI to regenerate in a language you can read, or to study the relevant patterns first. Explicit decision logging. When the AI suggests an approach — a data structure, an API design, a technology choice — and the builder accepts it, that acceptance should be a conscious decision, not passive agreement. Builders who practice human-in-the-loop discipline ask: do I understand why this approach was suggested? Are there alternatives? Does this approach have trade-offs I am accepting? Incremental deployment. Rather than building a large system in AI-generated pieces and deploying the whole at once, disciplined vibe coders deploy incrementally — one component at a time, verifying each in isolation before integrating. Incremental deployment means failures are small and localized, not systemic and mysterious. Version control without exception. Every meaningful state of the code is committed to version control before making changes. This is especially important in vibe coding because the AI can generate changes that look correct but break existing behavior. Version control makes recovery trivial; skipping it makes recovery expensive or impossible.

Prompt Challenge

Write a prompt asking an AI to review code it previously generated and identify any places where it made decisions that a human builder should consciously evaluate rather than accept by default.

Your prompt should…

  • asks the AI to list every architectural or design decision embedded in the generated code
  • requests that the AI explain the trade-offs of each decision it made
  • asks the AI to flag any security-relevant choices that require explicit human approval

When to Pause and When to Proceed

Human-in-the-loop discipline is not about slowing down uniformly. It is about calibrating your scrutiny to the stakes of each decision. High-stakes decisions that always require deliberate human evaluation: any code that handles authentication or authorization; any code that stores or transmits personal data; any code that makes financial transactions; any architectural decision that would be expensive to reverse; any code deployed to real users who did not consent to being beta testers. Medium-stakes decisions that warrant careful review: any new component being integrated with existing components (integration points are where hidden assumptions collide); any code that handles user input without explicit validation; any change to an existing function that is called from multiple places. Lower-stakes decisions where AI suggestions can be accepted with lighter review: internal scaffolding code not yet connected to real data; isolated utility functions for non-critical tasks; presentation and styling code with no data-handling logic. This calibration is itself a judgment call that develops with experience. New vibe coders should err toward heavier scrutiny until they have a reliable sense of where their AI tool's failure modes lie and what their own blind spots are.

The Automation Bias Trap

Automation bias is the documented human tendency to over-trust automated system outputs, especially when those outputs appear confident and fluent. It is not a character flaw — it is a consistent cognitive pattern observed across high-stakes domains from aviation to medicine. In vibe coding, automation bias manifests as accepting AI-generated code without genuine scrutiny because 'the AI probably got it right.' Knowing about automation bias does not make you immune to it; it just gives you a name for what to watch for in your own behavior.

What does 'human-in-the-loop discipline' mean in the context of vibe coding?

A vibe coder says: 'I test my code every time, so I do not need to read it carefully.' What is missing from this approach?

The Control Audit

  1. Step 1: Imagine you have been building a school club sign-up web application for three weeks using vibe coding. The app has a sign-up form, stores member data, and sends confirmation emails.
  2. Step 2: Walk through the following checklist and honestly assess whether a human genuinely reviewed each item:
  3. - The code that stores sign-up data in the database
  4. - Input validation on the sign-up form
  5. - The email-sending logic and what happens if sending fails
  6. - Authentication (if any) for administrative functions
  7. - What happens if someone submits the form twice
  8. - What data is logged and where those logs are stored
  9. - The code that was changed most recently before deployment
  10. Step 3: For any item you marked as 'not genuinely reviewed,' write what specific review you would now perform and what you would look for.
  11. Step 4: Discuss as a class: which of these items would most developers skip under time pressure? Which skips would have the worst consequences?