GuideAdvanced

Ai Code Governance And Agent Architecture

Learn to govern the code AI writes and to architect the systems where agents modify software autonomously. When AI generates a huge fraction of the code and some agents can change code and infrastructure without direct supervision, speed without governance produces architectural drift and an enormous blast radius. This guide teaches you to build fitness functions that block any change — human or agent — that violates architecture rules in CI, to design a least-privilege permission model that limits what each agent can touch, and to route changes by risk tier with human-in-the-loop gates: trivial changes go through automatically, while changes touching payments, auth, or migrations require human approval. It covers tracking the provenance of AI-generated code for accountability and auditing, and encoding architecture as policy-as-code that an agent can't bypass, even if it tries to ignore it. Everything is simulated and executed in Python — the agent and its diffs are stubs; you never run a real agent or call an API. You work on Mercado's team, which already uses code agents to open half of its PRs, and close by designing the full governance layer for its AI contributions.

64
lessons
8
modules
English · Spanish
available in
Yes
certificate
Free
access
NIEVA

Outcomes

What you'll be able to do

  • Understand why AI speed without governance produces architectural drift and an enormous blast radius, and why governance is architecture, not bureaucracy
  • Use fitness functions as governance: machine-checkable architecture rules that block any diff — human or AI — that violates them in CI
  • Design a least-privilege permission model for code agents: scoped capabilities, calculated blast radius, and the difference between read, write, and deploy
  • Build human-in-the-loop gates routed by risk tier: auto-merge for trivial changes, human approval for changes touching payments, auth, or migrations
  • Track provenance and accountability for AI-generated code: audit trail, review ownership, and the supply-chain risk of hallucinated packages
  • Encode architecture as policy-as-code that lives in CI and that an agent cannot bypass, even if it "ignores" it in the prompt
  • Govern a system with multiple agents or one continuous autonomous agent: prevent runaway behavior, define hard limits (kill switch, quotas), and the rollback process
  • Run a capstone project: design the full governance layer for AI code contributions to Mercado (permissions, fitness gates, risk gates, provenance, and policy-as-code)

Before you start

What you need to bring

It's for you if...

  • Tech leads and architects whose teams already use code agents (Claude Code, Cursor, and similar tools) to open pull requests
  • Teams that need a clear permission model for autonomous agents touching code or infrastructure
  • Devs concerned about architectural drift as the volume of AI-generated code grows
  • Organizations that need to audit and account for AI-generated code in production

Requirements and materials

  • Experience leading or participating in backend teams with CI/CD in production
  • Recommended (not required): a grounding in fitness functions, covered in the Architecture Decisions and Trade-offs Guide (module 6)
  • Python to run the guide's simulations (the agent and its diffs are simulated with stubs; you never run a real agent)
  • No prior experience building code agents required — that belongs to the Agentic Engineering ecosystem

Content

The syllabus, module by module

Open any of them to see its lessons.

Common questions

What people usually ask

Start whenever you like

Reviews

What students say

These reviews are from enrolled students who completed at least 50% of the course. We moderate reviews only on content grounds (spam, offensive language, personal data), never for being critical or negative.

No approved reviews yet.

Be the first to share your experience!