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
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.
- 1. Module introduction: fitness functions as governance
- 2. The fitness function over the diff
- 3. The rule is the same for every author
- 4. Machine-checkable architecture rules
- 5. The governance gate in CI
- 6. Why the gate scales and review doesn't
- 7. Governing the bounded context
- 8. Project: a governance gate for Mercado
- 1. Module introduction: the permission model for code agents
- 2. Least privilege for code agents
- 3. Capabilities, not a single role
- 4. The blast radius of an autonomous agent
- 5. Read, write, and deploy as distinct levels
- 6. The sandbox: isolating where the agent runs
- 7. Why broad permissions are an enormous risk (and why the permission model is architecture)
- 8. Project: design the permission model of Mercado's patch agent
- 1. Module introduction: provenance and accountability
- 2. Tracking what AI generated
- 3. The audit trail
- 4. CODEOWNERS and accountability
- 5. Review coverage as a metric
- 6. Hallucinated dependencies and slopsquatting
- 7. License and security review of the generated code
- 8. Project: provenance and audit of the agent contributions to Mercado
- 1. Module introduction: architecture as the agent's guardrail
- 2. The architecture constitution
- 3. ADRs as agent-readable constraints
- 4. Giving the agent the right architecture context
- 5. Policy-as-code: the rule the agent can't skip
- 6. Keeping the context and the guardrail in sync
- 7. Mercado's constitution
- 8. Project: codify Mercado's architecture as a guardrail
- 1. Module introduction: the complete governance layer
- 2. Assembling the permission model
- 3. Assembling the fitness gate
- 4. Assembling the human gate
- 5. Assembling provenance and the supply chain
- 6. Assembling the policy-as-code
- 7. Assembling the autonomous system limits
- 8. Project: govern the AI code contributions to Mercado
Common questions
What people usually ask
No limit. It's a free guide: come in whenever you like, as often as you like.
No. Modules run from easier to harder, but you can jump to the one you need. Progress is saved per lesson.
Whatever is needed is listed under “What you need to bring”, above. If nothing is listed there, you can start from zero.
In the Club's WhatsApp group, and every two weeks there's a live with an instructor where questions get worked through.
Yes. It's issued automatically once you finish every lesson, with a verifiable code you can share on LinkedIn.
Start whenever you like
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!