liveBook · Manning

AI agent

As explained in Vibe Engineering

An AI agent is a software system that uses artificial intelligence to autonomously or semi-autonomously perform tasks on behalf of a user or application.

An agent can pass a local test, fail in CI, and then introduce a workaround for an environmental mismatch rather than the underlying problem. An AI agent is a software system that performs tasks with some autonomy; a coding agent can explore a project, edit files, and run commands. Those capabilities make it more useful than a suggestion confined to the current file, but also increase the need for supervision. section 5.2 section 10.3.1

A coding agent may retrieve files by search or by reading the live codebase, reorder relevant context, and compress conversation history. This reduces manual context assembly, not the need to curate the project’s knowledge. Outdated or contradictory source material can poison retrieval; lossy compression can also discard an important early instruction. Pin critical files or repeat essential constraints when needed. section 3.5.4

A supervised migration

For a payment-validation migration, an agent first plans to read the service, find the new validation library, and check existing usage before proposing changes. File-access approvals give the developer a chance to intervene, but frequent approvals can become rubber stamps. More access requires meaningful controls, not merely more dialogs. section 5.2.1 section 5.8

Headless agents run outside an interactive IDE, including in scripts, hooks, and CI pipelines. They are a better fit for tasks with clear inputs, bounded actions, and cheap output validation, such as regenerating documentation or explaining failed CI runs. Removing approval prompts also removes immediate human course correction: a successful exit can conceal plausible but wrong output. section 5.3 section 5.3.3

Use controls that match the agent’s authority:

  • Validate outputs, log actions, detect anomalies, and stop pipelines when quality degrades. Sample outputs for human review to catch systematic drift. section 5.3.4
  • Let deterministic checks block where appropriate; use probabilistic model review as advice. Parse structured verdicts rather than searching free text for a word such as PASS. section 5.3.2
  • Isolate the execution environment and check it against CI. Investigate flaky tests: an agent can mistake a noisy failure for a real defect and make an unnecessary change. section 10.3.1 section 10.4
  • When a run misbehaves, isolate prompt, context, and model; reduce the case to a small reproduction; check accumulated context and assumptions about external dependencies. section 5.3.3
Listing 5.4 Pre-commit hook example
#!/bin/bash
# .git/hooks/pre-commit
set -euo pipefail
 
DIFF=$(git diff --cached)
[ -z "$DIFF" ] && exit 0
 
# Deterministic checks block. This is the real gate.
gitleaks protect --staged --redact || exit 1
 
# The model advises. It cannot block on its own.
VERDICT=$(printf '%s' "$DIFF" | claude -p "Review this diff against our
conventions: error handling, test coverage for new public functions,
naming. Reply with exactly one line of JSON and nothing else:
{\"verdict\":\"clean\"} or {\"verdict\":\"concerns\",\"notes\":\"...\"}")
 
if [ "$(printf '%s' "$VERDICT" | jq -r '.verdict')" = "concerns" ]; then
    echo "AI reviewer raised concerns (advisory, not blocking):"
    printf '%s' "$VERDICT" | jq -r '.notes'
fi
exit 0

This pre-commit hook illustrates the split: gitleaks can block a commit, while a structured AI review reports concerns without blocking. section 5.3.2

As agents spread across a team, inconsistent configurations become a coordination problem. Shared standards can improve consistency but add maintenance overhead; sandboxing adds friction while limiting the damage from mistakes. Increase autonomy only alongside the controls needed to observe and contain failure. section 5.4 section 5.8

How Vibe Engineering covers it

How deep it goes
Explains interactive and headless workflows with approval, review, observability, and debugging practices, including their operational tradeoffs.
Examples
Uses a payment-validation migration, an advisory pre-commit reviewer, and an overnight job producing silently incorrect output.
What you can do after
Diagnose/debug agent failures by isolating prompts, context, models, and environmental assumptions.
How it connects
Connects agents to context engineering, retrieval-augmented generation, continuous integration, sandboxing, and flaky tests.

Also explained in

Compare how 46 books explain AI agent →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.