Home/ Part XIII — Expert Mode: Systems, Agents, and Automation/38. Building a Code-Change Agent Safely

38. Building a Code-Change Agent Safely

Overview and links for this section of the guide.

High Stakes

An agent that can write code is an agent that can delete your database or introduce a backdoor. You cannot treat a coding agent like a chatbot.

The Safe Architecture

We introduce the Proposal Pattern:

  1. Analyst Agent: Reads the issue and the code. Writes a textual PLAN.
  2. Human: Approves the PLAN.
  3. Coder Agent: Generates the diff based on the PLAN.
  4. Reviewer Agent: Critiques the diff (security, style).
  5. Test Runner: Runs the tests on the diff.
  6. Human: Merges the PR.

Notice the two Human checkpoints. This is non-negotiable for production code.

Where to go next