
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Welcome to Agentic Engineering. Three actors now create value in software: engineers plan and review, agents execute with judgment, and deterministic code verifies everything. This course is about placing each one correctly — and every section ends with something you build and something that proves it works.
You'll be able to: explain the three-actor model and what you'll ship by the end of the course.
Three actors now create value in software: engineers plan and review, agents execute with judgment, and deterministic code verifies everything. This lecture introduces each one, shows why code is the unsung hero, and gives you the three-question diagnostic for placing the right actor on any task.
The engineer's job concentrates into two points: planning at the start and reviewing at the end. When implementation is cheap, an ambiguity in your spec doesn't slow the work down; it gets implemented. This lecture shows why both skills matter more than ever, and what it looks like to specify the way a machine could check.
Before building anything you need three things: a model API key kept in an environment variable, a runtime you're comfortable in (Python or TypeScript), and a hard spending limit set at the provider console. Runaway loops are the most common failure in the field, so the cap goes on first.
You'll be able to: set up a safe, cost-capped environment and read per-run usage.
In agentic development an ambiguity doesn't slow you down — it gets implemented. The parts of a large system that had written contracts were built fast and correctly; the improvised parts cost weeks of rework. Taste and specification are the skills that appreciate when building is cheap.
You'll be able to: explain why specifying first is the cheapest quality lever you have.
An AI-generated PRD launders skipped thinking into official-looking prose. An AI-facilitated one interviews you and records decisions you actually made. This lecture introduces BMAD, the four-beat flow (brief, PRD, architecture, story files), and adversarial personas to find where a design is thinnest.
You'll be able to: tell a facilitated design document from a generated one.
BMAD is a team of agent personas living as markdown in your repo. This lecture covers the install (including the spacebar trap when picking your IDE), how agents are activated, the team by role, the planning and development phases, and why every document gets a fresh chat.
You'll be able to: install BMAD and know which agent to call at each step.
The most powerful BMAD agent is the one most people skip: the analyst, Mary. She asks the questions and you produce the ideas. Brainstorming techniques and advanced elicitation push the model off the average answer, ending in a brainstorming document and then a project brief.
You'll be able to: run a facilitated brainstorm and turn it into a project brief.
The product manager agent turns the brief into a PRD: requirements and epics, a hard MVP line, and stories written for a very literal developer agent. You'll choose greenfield or brownfield, write checkable acceptance criteria, and review story order so no story depends on one that comes later.
You'll be able to: produce a PRD whose stories an agent can build in order.
The architect agent turns the PRD into an architecture. The key moves: pick the architecture type that matches, pin the tech stack to exact versions so agents can't drift, get data models, coding standards and source tree right, record a rejected alternative, and run the checklist before building.
You'll be able to: produce and review an architecture that keeps dev agents on the rails.
Big planning documents hurt a developer agent, because everything in context is re-read every turn. Sharding splits the PRD and architecture into small files, stale planning docs move out of reach, and a core config loads coding standards, tech stack and source tree into every dev session.
You'll be able to: set up context so each dev session starts with the rules and only the relevant epic.
Development runs as a loop: the scrum master drafts a self-contained story, you approve it, the developer agent builds it, QA reviews it, and you decide it's done. Fresh chat per agent per story, and course-correct when reality diverges from the plan — engineer at both ends, checks in between.
You'll be able to: run the draft-approve-build-review loop one story at a time.
Your first design pack is a draft, because you write it before you know what the rest of the course's tools can do. Draft now, revise at a scheduled checkpoint, and test whether the pack is real: it must contain at least one decision that hurt.
You'll be able to: schedule and run a design revision instead of treating the pack as final.
Three words people use interchangeably, and the confusion costs money. An LLM call is a function; a tool-use loop lets the model request work your code executes; an agent decides what happens next. Every agentic system has five parts — and only one of them, the model, is rented.
You'll be able to: name the five parts of any agentic system and which ones you engineer.
A complete working agent is about fifty lines of Python. We walk through the loop and its four load-bearing details: the turn cap is yours, the assistant turn goes into history before tool results, all results go back in one message, and failure has a type. That program is a harness.
You'll be able to: write a minimal, correct agent loop from a blank file.
Four production failures — infinite tool calls, flaky networks, prose instead of data, no record of what happened — are each prevented by something small, never by a better model. Break your loop three ways deliberately, then add a retry with a reason and a trace of every turn.
You'll be able to: harden a loop with bounded retries and a replayable trace.
The API is stateless, so every turn resends the system prompt, tool schemas, history and every tool result. A bloated tool result costs you on every remaining turn — and bloated context makes the model reason worse. What goes into the context is an engineering decision.
You'll be able to: reason about context size as a recurring cost, not a one-off.
Before MCP, every AI application integrated every tool its own way. MCP collapses N×M integrations to N+M, the same move REST and LSP made. Models are only as good as the context we give them, and a protocol lets your work compound with strangers' work.
You'll be able to: explain what MCP standardises and why that matters.
MCP's three primitives are distinguished by who controls them: tools by the model, resources by the application, prompts by the user. Asking "who should control this?" routes each capability to the right primitive. Also previewed: composability and sampling.
You'll be able to: assign each server capability to the right MCP primitive.
A tool's description is what the model reads to decide whether and how to call it. Write descriptions like product copy for a literal reader, keep the tool count focused, design tools on paper first, and use the prediction test: every misprediction is a description bug.
You'll be able to: design and test tool descriptions a model uses correctly.
The TypeScript SDK makes a server almost declarative: a server, tools with name, description and Zod schema, a handler, an upstream helper, a transport. Get four things right on purpose — descriptions, config and secrets, errors for strangers, logic server-side — and debug with the MCP Inspector.
You'll be able to: build an MCP server with the TypeScript SDK and test it in the Inspector.
Shipping taught me that the error message is the UX — often read by a model relaying it to a confused human. Write three distinct errors (missing key, rejected key, rate limit), read them as the model sees them, and never ship silent auth failure.
You'll be able to: write errors a stranger and a model can act on.
Built is not shipped. Package it, document it for humans and models, publish with semantic versioning, then run the real exam: a stranger installs and configures it from the README alone while you stay silent. Plus two failure modes: mega-results and accidental breaking changes.
You'll be able to: publish an MCP server that passes a cold-install test.
The best automation targets often have no API. Instead of giving up or scripting the UI, automate the save format — the most stable interface an app has. A 2D game engine's "save as folder" revealed a directory of JSON: the editor was a JSON editor with a very good UI.
You'll be able to: evaluate an app's save format as an automation surface.
Spend an hour on recon before writing code. Many files are ZIP archives, many are SQLite databases, some are directories, and a few are truly binary. Three first commands tell you which, and the answer decides your whole approach.
You'll be able to: identify a file format's container type in minutes.
Change one thing in the app, save, diff. Repeat twenty times and you have a field-by-field map verified by experiment, plus a set of test fixtures. Agents make excellent research partners here — they draft the schema, your experiments verify it, never the reverse.
You'll be able to: map an unknown format using controlled single-change diffs.
Three layers with hard boundaries: a format layer that only promises serialize(parse(file)) == file, a builder that speaks domain verbs and enforces invariants, and a thin MCP server with no format knowledge. When the format changes, you fix one layer.
You'll be able to: structure format automation so it stays maintainable.
The acceptance test for the format layer: parse, serialize, and assert the bytes are identical, on every file in your corpus. Reaching it teaches the format's real pedantry — key order, float formatting, newlines, escaping, ZIP ordering. Plus the safety rules for writing files.
You'll be able to: prove a parser is complete with a byte-identical round-trip test.
Workflows follow predefined code paths; agents direct themselves. The five workflow patterns form a ladder — prompt chaining, routing, parallelisation, orchestrator-workers, evaluator-optimiser — and each rung adds autonomy only where the last one failed. Most "agents" should be workflows.
You'll be able to: choose the least autonomous pattern that solves the problem.
Treat an agent definition as data: typed inputs validated before the call, typed outputs validated after. A type checker turns "the model is bad at this" into compile errors with line numbers — model-quality problems become ordinary software problems we know how to fix.
You'll be able to: define agents with typed, validated inputs and outputs.
A typed agent has exactly a tool's shape, so you can put one agent on another's tool belt. That's orchestrator-workers with types on, and the type contract is what lets the inner agent change freely without breaking the outer one.
You'll be able to: compose agents safely through typed contracts.
Frameworks help you start but hide the prompts and responses you'll need to debug. Own your prompts and your control flow, and prefer scaffold-then-own tools that generate code you possess. Building the runner yourself is how you learn what any framework must do.
You'll be able to: judge when a framework's abstraction is costing you.
A real story: pretty-printed JSON tool results with forty fields per record made the bill absurd and the agent forget earlier turns. Returning only needed fields in a compact format cut the bill by more than half. Tokens are the unit everything is denominated in.
You'll be able to: spot tool results that inflate both cost and error rate.
Input tokens grow quadratically with conversation length. We work the formula with real numbers — a ten-turn run reaching 140,000 input tokens — and draw two conclusions: input dominates the bill, and growth compounds. Then how to measure it yourself.
You'll be able to: estimate a loop's token cost before you run it.
Cached prefixes are re-served at a fraction of the price, but caching is an exact prefix match. Put stable content first, keep timestamps out of the system prompt, serialize deterministically, and verify with the cache meter, not intuition.
You'll be able to: structure prompts so caching actually works.
Context rot: recall degrades as the window fills. The window is a budget, not storage, so cost and quality both say curate. Four techniques — just-in-time retrieval, compaction, a notes file, and sub-agents that return summaries — plus pitching prompts at the right altitude.
You'll be able to: keep long-running agents within their attention budget.
Token-oriented formats like TOON cut repetition in tabular data, and the published benchmarks cut both ways. Encode at the boundary, measure per-turn usage, and do the break-even arithmetic — sometimes the right answer is not to optimise at all.
You'll be able to: decide with numbers whether a format change is worth it.
Production agent systems converge on one pattern: the model emits validated structure, and deterministic code decides whether it becomes an email, a payment or a deletion. In the invoice pipeline, the model never touched the money — and that's why it made money.
You'll be able to: draw the line between model output and side effects in your system.
"Production agent" means three different systems: agent-as-feature, agent-as-pipeline, and agent-as-fleet. Misjudging which one you're building is the first source of overengineering — and most successful products turn out to be mostly software with agents at key points.
You'll be able to: size your system correctly before you design it.
Schemas guarantee shape, not sense. Harden structured output with semantic validation, bounded retries that feed back the specific error, and logging the raw output before you parse it. Schema-valid but semantically wrong is the classic production incident.
You'll be able to: make structured output safe to act on.
Draw the boundary by reversibility. Hard-to-reverse actions get code only, idempotency keys derived from the business event, and often human approval. Credentials stay usable but not accessible to the agent, so prompt injection can only request, never act.
You'll be able to: design a trust boundary with idempotency and credential isolation.
Make "done", "needs clarification" and "needs human" first-class structured outputs, and design the escalation path before launch. Then handle the rest: model outages with a deterministic fallback, timeouts, cost ceilings, and errors summarised before they re-enter the loop.
You'll be able to: give every failure in your pipeline a handled path.
An agent can only be trusted with data that's catalogued, classified and contracted. A governance platform that never copies row data reads metadata only — which started as risk management and turned into an architectural advantage.
You'll be able to: design a catalogue that governs metadata without hoarding data.
Because sensitivity labels feed access control, classification must be reproducible and auditable. Deterministic rules run first; models only propose, and their proposals go through a review lifecycle with the reviewer recorded.
You'll be able to: combine rule-based classification with model proposals safely.
A data contract is the producer's machine-readable promise: fundamentals, schema, executable quality checks, owners and SLA. It's everything a consumer needs without a meeting — and an agent can't attend the meeting, so the contract is its only interface.
You'll be able to: write a data contract an agent can consume.
Once agents act on your data, every access must pass through policy that is code: versioned, tested, evaluated by an engine, failing closed and audited. Agents are principals too — including your own. The architecture: enforcement point, decision point, information and administration points.
You'll be able to: design policy enforcement that treats agents as principals.
Write access policy in Rego with Open Policy Agent, starting with default deny. Because policy is code, it has unit tests — and a test like "the intern agent cannot read PII" becomes a regulation that runs in CI. Then prove fail-closed by killing the policy engine in staging.
You'll be able to: write and test a default-deny policy in Rego.
Generated output is a liability until something proves it correct, and that something can't be you reading everything. Before generating, write one page: the invariant, the check, and the failure behaviour. Your first harness is often a single assert.
You'll be able to: write an invariant page before any generation runs.
Checks come in grades: structural, deterministic-semantic, judged by another model, and human. Most of your verification budget belongs on the deterministic rung, with model judges held to concrete rubrics and human review reserved for what nothing else can check.
You'll be able to: stack checks by cost and strength in a real harness.
A generate-and-verify loop needs an objective exit condition, a turn cap of three to five, and a circuit breaker that stops thrashing and hands the state to a human. Compact the feedback between attempts, and log every attempt.
You'll be able to: build a verification loop that can run unattended safely.
An eval is a captured case run as a suite. Every failure that escapes becomes an eval before it's closed, so it can never escape silently again. Evals gate prompt changes and model swaps — and the content comes from your own failures.
You'll be able to: turn incidents into a regression suite that ratchets quality.
The method for removing humans from review: start with review everywhere, measure where automation catches everything humans catch, drop review only there, and feed every incident back into the evals. Trust moves only where measurement went first.
You'll be able to: reduce human review without lowering the bar.
Small-product outcomes follow a power law, so many cheap honest bets beat one expensive one. Agents make the marginal product nearly free — but only with the plumbing factored into a kit and a harness that lets output ship unread. Factories without harnesses are piles of unreviewed output.
You'll be able to: explain when a portfolio strategy beats a single product.
The kit holds everything customers require but never choose you for — payments, onboarding, settings, releases. Each product is one feature plus its metadata, behind a real contract API. If a product build reaches through the boundary, the kit is wrong.
You'll be able to: decide what belongs in a shared kit versus a product.
The kit is a context artifact, feature specs are story files, metadata is agent-draftable, and the harness is the quality gate: artifact thirty-seven ships unread only because it passed every check. The engineer stays at the two posts: planning and review.
You'll be able to: place agents on an assembly line with verification gates.
Do the arithmetic honestly: marginal cost including lifetime kit maintenance, break-even per product, and the portfolio P&L as the unit of judgment. Then the discipline nobody enjoys — explicit kill criteria, because volume of junk is still junk.
You'll be able to: set break-even targets and kill criteria for a portfolio.
This course contains the use of artificial intelligence.
Most AI courses teach you to talk to a model.
This one teaches you to build the engineering around it: the part that decides whether your system still works at 3 a.m. on someone else's machine.
11 sections · 10 build assignments · 7 auto-graded coding exercises · a capstone you ship
Here's the build order:
The three actors. Engineers plan and review, agents execute with judgment, and deterministic code verifies. This is the placement diagnostic you'll run on every task from now on.
Design before code, with BMAD. Write a spec a machine can check, because an agent doesn't slow down at an ambiguity. It implements it.
The loop. Write a working agent in about fifty lines, then break it on purpose four ways. Each failure is a production lesson, and no better model fixes any of them.
MCP. Design your tools on paper, build the server and publish it. Then run the cold-install test: a stranger installs it from your README while you stay silent.
No API? Automate the file format. The save format is the API. You prove it with a byte-identical round trip.
Agents as typed programs, and token economics. Inputs are validated before you spend a token, outputs are enforced by a schema, and agents are composed as each other's tools. You also work through why a ten-turn run costs so much and learn the three levers that fix it.
Production agents. The model produces data and your code produces the side effects. You'll cover idempotency and trust boundaries, and drill every failure path.
Data and AI. Zero-copy catalogues, data contracts that enforce, and a default-deny policy engine that fails closed, with tests you run in CI.
Harnesses and verification. This is the keystone: invariants, objective exits, circuit breakers and evals. It's how you trust output you didn't read.
The factory pattern. Two products on one kit, with honest economics.
Capstone. Build something that works without you, and prove it with a cold run someone else drives.
What you'll walk out with: a working agent loop, a published MCP server, a format-automation stack, a typed agent runner, a production pipeline, a data catalogue and policy engine, a verification harness, a two-product mini-factory, and a capstone. Every one of them runs.
How you learn: short, dense lectures with diagrams. Each section ends with an assignment that has model answers and a self-check rubric. Seven coding exercises are graded instantly in the browser. Lab code and book chapters are downloadable.
The field moves. Models, protocols and prices shift every month. Invariants, contracts and trust boundaries don't. This course teaches the parts that survive model releases.