SkillHack

How to become an Agent Engineer

Step by step and free: 12 phases, 90 topics and 331 graded practice questions.

Practise this roadmap free

What is an Agent Engineer?

An Agent Engineer builds software in which a language model plans a task, calls tools and acts across many steps until the job is done. They design the tools and the loop around the model, decide what the agent may do without asking, manage its context and memory over long runs, and test whole trajectories rather than single replies. They work with product, platform and security teams.

Who this roadmap is for

Software engineers who already ship APIs and backend services in Python or TypeScript and want to build agents that do real work. You should be comfortable with HTTP, JSON and debugging someone else's code. If you have never written a program, start with a general software engineering roadmap first.

What you will be able to do

You will be able to design an agent loop with budgets and stopping rules, write tools and MCP connections a model can use well, keep context and memory under control on long runs, evaluate trajectories, add durable execution and human approval, and lock the agent down with sandboxing and least-privilege credentials.

The Agent Engineer roadmap

Agent Engineer

  1. Phase 1 Foundations and the engineering toolkit

  2. Phase 2 Models for agent builders

  3. Phase 3 The agent loop and planning

  4. Phase 4 Tool design

  5. Phase 5 MCP and agent-to-agent protocols

  6. Phase 6 Context and memory for long runs

  7. Phase 7 Multi-agent systems and handoffs

  8. Phase 8 Agent evals and failure analysis

  9. Phase 9 Durable execution and human approval

  10. Phase 10 Running agents in production

  11. Phase 11 Agent security and sandboxing

  12. Phase 12 Computer use, browser and coding agents

All topics, in order

Mark each topic Learning, Done or Skip, and sign in to save your place to your account. Done is your own word, not passing: a topic is passed when you score 50 or more on its questions. This order is the study plan.

  1. Phase 1 · Foundations and the engineering toolkit

    1. AI basics: what it is and how to ask it

      An AI assistant predicts likely words; it does not look facts up or know when it is wrong. That makes it strong at working with material you give it and weak as a source of facts. Learn to ask clearly, hand it the right material, check what comes back, and own what you send.

      Test yourself on this topic

      5 graded questions · scored out of 100 with feedback · free

      Start the 5 questions
    2. AI basics: using it safely at work

      Using AI well at work is mostly judgment: which tool is safe for which material, which actions need your OK first, how to test a helper before trusting it, and how to split a big job into checkable steps. These habits matter more than any one tool.

      Test yourself on this topic

      5 graded questions · scored out of 100 with feedback · free

      Start the 5 questions
    3. What an agent engineer does

      An agent engineer owns the harness around a model that chooses its own next step: the loop and when it stops, the tools and their contracts, the context it carries, the permissions that bound it and the evals that prove a run did what it claims. An AI engineer adds model calls to a product; a workflow builder wires fixed steps. You are judged on runs that finish correctly and safely with nobody watching, not on a good demo.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    4. Python for agent code

      Agent code spends most of its life waiting on model and tool calls, so it is async code first. Run independent calls together with asyncio.gather or a TaskGroup, put a timeout on every await, and never call a blocking library inside the event loop, because one slow call then freezes every run on that worker. Type tool inputs and outputs with Pydantic or dataclasses so a bad argument fails at the boundary, not three steps later.

      Reading

      Test yourself on this topic

      5 graded questions · scored out of 100 with feedback · free

      Start the 5 questions
    5. Development environment and containers

      An agent run you cannot reproduce is a bug you cannot fix. Pin every dependency in a lockfile, run the agent and the code it executes in a container so your laptop and the server behave alike, and load secrets from the environment or a secret manager, never from the repository or the prompt. When agents edit code, give each run its own checkout, such as a git worktree, so parallel runs never overwrite each other.

      Reading

      Test yourself on this topic

      5 graded questions · scored out of 100 with feedback · free

      Start the 5 questions
    6. APIs and HTTP for tool calls

      Most tools an agent calls are HTTP APIs, and their failures become the agent's next decision. Retry only what can succeed on retry: a 429 or 503 after the Retry-After delay with jittered backoff, never a 400 or 403, which need a different call. Follow pagination cursors instead of trusting the first page, set a timeout on every request, and turn each failure into a short message the model can act on.

      Reading

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions

    Chapter 1 lab

    Brief a coding agent to add a carrier rates client to a Python service

    A prompt lab that closes the chapter: you write the instruction, and it is graded on a rubric.

    Start the lab
  2. Phase 2 · Models for agent builders

    1. How LLMs work

      A model reads tokens, not characters, and predicts the next one from everything in its context window, so many agent bugs are model limits in disguise. Counting letters fails because of tokenisation, a long run degrades because recall weakens as the window fills, and the same input can produce different steps because sampling is random. Measure tokens per step and keep the window lean: a bigger window is not better attention.

      Test yourself on this topic

      7 graded questions · scored out of 100 with feedback · free

      Start the 7 questions
    2. Prompting for agents

      A prompt for an agent describes a job, not one reply: the goal, what done looks like, which tool to prefer for what, what needs permission and what to do when stuck. Say what to do rather than only what to avoid, and give the reason behind each rule so the agent can apply it to cases you did not list. Test a prompt change on whole runs, because one new rule can shift behaviour many steps later.

      Reading

      Test yourself on this topic

      7 graded questions · scored out of 100 with feedback · free

      Start the 7 questions
    3. Model APIs: messages, tool calls and tokens

      A tool-using turn is a round trip: you send messages plus tool definitions, the model replies with a stop reason and tool call blocks, and you run the calls and send the results back keyed by each call's id. Every request resends the conversation and the tool definitions, so input tokens grow with each step and usually dominate an agent's bill. Read the stop reason and usage on every response: they say why the turn ended and what it cost.

      Reading

      Test yourself on this topic

      6 graded questions · scored out of 100 with feedback · free

      Start the 6 questions
    4. Structured output and constrained decoding

      Asking for JSON gets JSON most of the time; constrained decoding limits the model to tokens that fit your schema, so the output parses unless it is cut off or refused. Parsing is not correctness: a valid object can hold a wrong value, and providers support only part of JSON Schema, so check business rules in code too. A strict format can cost accuracy on hard tasks, so let the model reason first and put the answer in its own field.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    5. Reasoning models in an agent loop

      A reasoning model can think between tool calls as well as before the first one, so it can weigh a surprising result before choosing its next action. Most APIs expect you to send that thinking back unchanged with the tool results; drop it and the model loses its own train of thought mid-run. Treat effort as a dial per task: raise it where a wrong step is costly to undo, lower it for routine lookups, and judge it by finished tasks, not tokens.

      Reading

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    6. Choosing a model for agent work

      For an agent the measure that counts is cost per finished task: a cheaper model that needs twice the steps, or fails one run in three, often costs more than a pricier one that finishes. Public benchmarks such as SWE-bench Verified, Terminal-Bench, tau2-bench and BrowseComp test tool use over many steps, so read the one closest to your work, then rerun your own tasks several times and compare success, steps and spend together.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions

    Chapter 2 lab

    Write the system prompt for an invoice field extractor

    A prompt lab that closes the chapter: you write the instruction, and it is graded on a rubric.

    Start the lab
  3. Phase 3 · The agent loop and planning

    1. Workflow patterns before agents

      A handful of patterns cover most model features without an agent: a chain of calls with a check between steps, a router that sends each input down a specialised path, parallel calls whose answers you combine or vote on, an orchestrator that splits work at run time, and an evaluator loop that critiques and revises against clear criteria. Use the simplest that passes your tests, and add an agent only where the steps cannot be known until the work starts.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    2. The agent loop

      The loop itself is a few lines: call the model, run any tool calls it asks for, append the results, and call again until it answers without a tool call. ReAct interleaves a thought with each action; plan-then-execute writes the steps up front, saving model calls but adapting slowly when a step surprises it. Everything that makes an agent reliable is added around this loop, so know where in it each check, limit and log runs.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    3. The agent harness

      The harness is everything around the model: the system prompt, the tools and how they answer, what enters the context each step, which actions need permission, and hooks that run your code before or after a tool call. The same model can go from failing a task to passing it on harness changes alone, so treat the harness as the product: version it, test it and read its transcripts after every change.

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
    4. Stopping conditions and budgets

      A loop ends in one of two ways: the model says it is done, or a limit on steps, tokens, time, spend or repeated calls trips. Make the result say which, with a stop reason, the work finished so far and the state needed to continue, so the caller can resume with a fresh budget, hand off to a person or give up. A limit that throws away the run's state turns a stuck agent into a total loss.

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
    5. Planning before acting

      A plan helps when each step names the check that proves it worked, so the agent can tell a finished step from an attempted one. When a step fails, replan from that step with what the failure taught, rather than retrying it unchanged or starting over. Keep plans short and revisable, since a long upfront plan goes stale at the first surprise; searching over many candidate plans multiplies cost and pays off mainly where steps can be scored.

      Test yourself on this topic

      5 graded questions · scored out of 100 with feedback · free

      Start the 5 questions
    6. Task lists and progress tracking

      On a long job, have the agent write a todo list before it starts and update it as it goes, with each item pending, in progress or done. Rewriting the list keeps the goal near the end of the context, where it is least likely to be lost, and shows anyone watching how far the run got. Allow one item in progress at a time, and mark an item done only after its check passes, not when the agent says so.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    7. Reflection and self-critique

      Asking an agent to review its own work helps when the review brings something new: a failing test, a validator error, a source that contradicts the claim. Without new evidence, a model rereading its own answer tends to keep it, or swaps a right answer for a wrong one, as research on self-correction has shown. So give reflection a tool result to react to, cap the rounds, and keep the earlier version if the revision checks out worse.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    8. Verifying work with tools

      An agent's claim that it finished is a guess until something outside the model checks it. Before it reports done, have it run the tests, the type checker or a schema validator, or reread the file or record it changed, and feed any failure back into the loop. Give it the same check you would use to accept the work, and make the final answer quote that check's result, so a reviewer sees evidence rather than an assertion.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    9. When to ask the user

      When a request is unclear, an agent can ask, assume and record the assumption, or stop. Asking costs the user's attention and stalls the run; a wrong assumption costs rework or a harmful action. Let what a wrong guess would break decide: ask before anything costly or hard to undo, assume and say so for cheap reversible choices, and gather everything you need into one question rather than five spread across the run.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions

    Chapter 3 lab

    Write the loop instruction for a failing-test triage agent

    A prompt lab that closes the chapter: you write the instruction, and it is graded on a rubric.

    Start the lab
  4. Phase 4 · Tool design

    1. Tool use and function calling

      The model never runs a tool: it emits a call with a name and arguments, and your code decides whether to run it. Validate the arguments against the schema before executing, since models sometimes send wrong types or invented fields, and return the result tagged with the call's id. A retry is safe only if repeating the call cannot do the work twice, so know which tools are read-only before the loop retries them.

      Test yourself on this topic

      6 graded questions · scored out of 100 with feedback · free

      Start the 6 questions
    2. How many tools, and how big

      Every tool you add is another choice the model can get wrong, and overlapping tools are the worst kind: two ways to search the same data split its guesses. Build tools around tasks, such as one tool that finds a customer's latest order instead of three that list customers, list orders and fetch one, and namespace the rest by service. When wrong picks rise as tools are added, cut or group the set before rewording descriptions.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    3. Tool results and errors the model can use

      A tool result is the agent's only view of what happened, and every token of it is paid for on each later step. Return the fields the next step needs, cap the length with a note on how to fetch more, and use ids the model can pass straight to another tool. Report a failure as a normal result marked as an error, saying what was wrong and what a valid call looks like, so the model corrects the call instead of retrying blind.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    4. Tools that change things

      A tool that writes, sends, pays or deletes needs more than a schema. Offer a dry run that shows what would change, require confirmation for actions that are hard to undo, and accept an idempotency key so a retried call returns the first result instead of acting twice. Return a record of exactly what changed, with ids. Protocol hints that mark a tool destructive help a client decide what to gate, but enforce the rules inside the tool.

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
    5. Parallel and dependent tool calls

      A model can request several tool calls in one turn when they do not depend on each other, such as reading three files at once. Run those concurrently and send every result back together, each matched to its call id, even when one fails. Calls that need an earlier result must wait for it, and writes to the same record should run one at a time, so turn parallel calls off for tools where order matters more than speed.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    6. Large tool catalogs

      Loading hundreds of tool definitions into every request spends much of the context before the task starts and makes each choice harder. Keep a few core tools always loaded and give the agent a search tool that finds and loads the rest on demand by name and description. Descriptions then double as search text, so write them with the words a model would search for, and log searches that found no tool.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    7. Code execution as a tool

      A sandbox where the agent can run code changes what one step can do: instead of a tool call per row, it writes a short script that loops, filters and calls tools, and only the final result enters the context. That saves tokens and round trips on data-heavy work and plays to what models write well. The price is a real execution environment to secure, with limits on time, memory, files and network.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    8. Built-in and hosted tools

      Model platforms ship ready tools: web search and fetch, code execution, file editing, shell and memory. Some run on the provider's servers, so you get them in one request but have less say over what they read, and your data and costs follow the provider's terms. Others only define the interface and your code runs them. Use hosted tools to build fast, and own the tool when you need audit logs, limits or a way to switch models.

      Reading

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
  5. Phase 5 · MCP and agent-to-agent protocols

    1. MCP from the agent's side

      In MCP your agent application is the host: it runs one client per connected server, and each server offers tools, resources and prompts. The protocol only carries messages; the host decides which servers are allowed, which tools reach the model, what the user must confirm and what data goes to which server. Treat every server's descriptions and results as untrusted input your host filters, never as instructions.

      Reading

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
    2. Connecting to MCP servers

      Local servers run as a subprocess over stdio; remote ones use Streamable HTTP, and the older HTTP plus SSE transport is deprecated. As of November 2026 the current revision, 2026-07-28, is stateless: no initialize handshake or session id, every request names its protocol version, and an unsupported version returns an error listing those the server accepts. List results carry a ttlMs freshness hint, so cache tool lists instead of refetching.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    3. MCP authorization as a client

      A protected remote MCP server points your client to its authorization server through protected resource metadata, and your client runs OAuth with PKCE for the user. Request each token with the resource parameter naming that one server, keep tokens per user and issuer, and check the issuer before redeeming the code. As of November 2026 the spec prefers Client ID Metadata Documents (an HTTPS URL as client id) and deprecates dynamic registration.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    4. Resources and prompts, not just tools

      MCP splits what a server offers by who decides: the model chooses tools, your application chooses which resources to attach as context, and the user picks prompts, often as slash commands. Data the agent always needs, such as the schema it queries or the ticket it is working, is cheaper and more predictable as a resource your host attaches than as a tool the model must remember to call. Prompts suit workflows a user starts on purpose.

      Reading

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    5. When a server needs input

      Sometimes a server cannot finish a tool call without the user, say to confirm a choice or fill a missing field. Under the 2026-07-28 revision it returns an input required result; your client asks the user, then retries the call with the answers attached. Form mode is for ordinary fields; passwords, keys and payments must use URL mode, which opens the server's own page. Always show which server is asking, and offer decline and cancel.

      Reading

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    6. Long-running MCP calls

      A tool call that takes minutes, such as a CI run or a bulk import, should not hold a connection open. As of November 2026 MCP covers this in its official tasks extension: the server returns a task id instead of a result, and your client polls it, answers through an update when it pauses for input, and may ask to cancel, which is not guaranteed. Save task ids with the run's state so a restart resumes polling instead of redoing the work.

      Reading

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    7. Agent-to-agent with A2A

      MCP connects an agent to tools; A2A connects it to another agent whose insides it cannot see, often run by another team or vendor. The remote agent publishes an agent card with its skills, endpoint and auth; longer work becomes a task with states such as working, input required and completed, returning artifacts. A2A 1.0, the first stable release, came out in March 2026. Use a tool when you know the steps, an agent when you only know the goal.

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
  6. Phase 6 · Context and memory for long runs

    1. The context budget across a run

      An agent's window is partly spent before the user types: the system prompt and tool definitions come first, then every call and result piles on, so by step thirty most tokens may be stale tool output. Log the input tokens of each model call and plot them by step; the curve shows which tool or habit eats the budget. Models also attend less reliably as the window fills, so a run degrades well before it hits the limit.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    2. Trimming tool output

      A tool result is read once and acted on, then mostly dead weight that the model rereads on every later step. Cap results at the source with filters, limits and pagination, keep the full payload outside the window behind an id or file path the agent can fetch again, and clear or shorten old results once the step that needed them is done. Leave the call itself in history, so the agent remembers it already looked.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    3. Compaction for long-running agents

      Compaction replaces the older part of a run with a summary so the agent can keep going past its window. Trigger it at a set share of the window rather than on overflow, and make the summary keep the goal, the decisions made and why, what was changed, open problems and the next step. Test it by compacting saved runs mid-task and checking the agent finishes without redoing work or reversing an earlier decision.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    4. Just-in-time context

      Instead of loading every document that might matter into the prompt, give the agent cheap ways to look: file listings, grep, search and read tools, and light references such as paths and record ids. It then pulls in only what the current step needs, and the window stays free for reasoning. The price is extra steps and time, so preload the few facts every run needs and let the agent fetch the rest.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    5. Instruction files and skills

      An instruction file such as AGENTS.md lives in the repository and loads on every run, so keep it short: build and test commands, conventions and the traps a newcomer would hit. A skill is a folder of instructions, scripts and references of which only the name and a one line description sit in context until a task needs it, so an agent can carry many at little cost. Put rules that always apply in the file and occasional procedures in skills.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    6. Notes and progress files

      Long work outlives any one context: compaction blurs detail and a new session starts blank. Have the agent keep its state in files, such as a progress log of what is done and what comes next, a structured list of features or tests it ticks off, and commits with clear messages, and start every fresh session by reading them. A structured file such as JSON is harder for the agent to quietly rewrite than prose, which keeps the record honest.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    7. Kinds of agent memory

      Memory beyond the window comes in kinds: working memory is the context itself, episodic memory records past runs, semantic memory holds facts about the user or domain, and key value state holds exact fields such as a plan or an account tier. Each suits a store: an append-only log, a vector index for fuzzy recall, a database row for exact lookup. Choose by how the agent must find it again, since vector search returns near matches, not guarantees.

      Test yourself on this topic

      7 graded questions · scored out of 100 with feedback · free

      Start the 7 questions
    8. Deciding what to remember

      Saving everything fills memory with noise that later surfaces at the wrong moment. Write a memory only when it is likely to matter again: a stated preference, a correction, a durable fact, a lesson from a failed attempt. Decide who writes it, the agent during the run or a separate pass after the session that merges and dedupes. Recall by relevance, recency and importance, and store the source and date so the agent can judge whether to trust it.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    9. Memory scope, isolation and deletion

      Every memory needs an owner, a user, a team or a tenant, and recall must filter on that owner in the store's query, not in the prompt, or one customer's details will surface in another's run. Let users see, correct and delete what is kept, and make deletion reach every copy, embeddings and summaries included. Facts go stale, so record when each was learned, prefer the newest and expire what no longer holds.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
  7. Phase 7 · Multi-agent systems and handoffs

    1. Multi-agent architectures

      Multi-agent shapes differ in who decides what happens next: an orchestrator splits work and gathers results from workers, a supervisor routes each turn to a specialist, peers pass work among themselves, and a hierarchy stacks supervisors. Every extra agent adds tokens, loses detail at its boundary and makes failures harder to trace. Start with one agent and good tools, and add a second only when you can name what the first cannot carry.

      Test yourself on this topic

      5 graded questions · scored out of 100 with feedback · free

      Start the 5 questions
    2. Spawning sub-agents within bounds

      A sub-agent is a fresh context with its own brief, tools and stop condition, useful for a contained job such as searching a codebase. An agent that can spawn agents can spawn without end, so the parent's code, not a prompt, enforces the maximum depth, how many children run at once, a token and time budget they all share, and what happens to children when the parent stops. Give each child a complete brief and ask for a short result.

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
    3. Handoff contracts and shared state

      The agent receiving work knows only what the handoff carries, so define it like an API: the goal, constraints, what is already done, inputs by reference, the expected output shape and how to report failure. When agents share a scratchpad or store, give each record one writer or use versioned writes, so no agent silently overwrites another. Send back conclusions with their evidence, not whole transcripts.

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
    4. Handing a conversation to a specialist

      In a handoff the specialist takes over the conversation itself, unlike a sub-agent that returns a result to its caller. Choose what history it inherits: the full transcript keeps context but brings the first agent's tool noise and instructions, while a filtered slice or summary keeps it focused. Tell the user when control changes, give the specialist a way to hand back, and log every transfer so two agents bouncing a user between them shows up.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    5. Parallel agents and merging results

      Run agents in parallel only on work that does not depend on each other, such as researching separate companies; anything needing another's output waits. The hard part is the merge: results overlap, disagree and come back in different shapes. Ask every worker for the same structured output with sources, then dedupe, flag conflicts instead of averaging them away, and record which worker failed rather than silently dropping its share.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    6. Critic and verifier agents

      A second agent that checks the first catches errors only if it has something the first lacked: different instructions, the original requirements, tools to run tests or look facts up, or a different model. A critic rereading the same output in the same context tends to approve it. Ask for specific failures against named criteria, not an overall verdict, require evidence for every pass, and measure its catch rate on runs you know are wrong.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    7. Coordination failures

      Teams of agents fail in ways one agent cannot: two workers do the same job, two wait on each other forever, two write the same record, or agents keep delegating while costs climb. Each has a mechanical control: work items with unique ids a worker claims, a timeout on every wait, one writer per resource, and a cap on total spend and delegation depth for the run. Trace messages between agents, since the cause usually sits at a boundary.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions

    Chapter 7 lab

    Write the handoff a planning agent sends to an execution agent

    A prompt lab that closes the chapter: you write the instruction, and it is graded on a rubric.

    Start the lab
  8. Phase 8 · Agent evals and failure analysis

    1. Outcome evals

      An agent's final message says what it believes it did; the environment shows what it actually did. Grade the end state: query the database for the record, run the tests on the changed code, diff the files, check the email was queued exactly once. Write each check from the task's requirements before reading any runs, and include tasks whose right outcome is to refuse or change nothing, so an agent that acts on everything cannot score well.

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
    2. Trajectory evals

      Two runs can reach the same correct end state, one in five steps and one in forty with a forbidden delete along the way. Trajectory evals grade the path: whether the required tools were called, whether order held where it matters, how many steps were wasted, and whether any banned action happened. Match strictly only where order is truly required; demanding one exact path punishes valid alternatives and makes the eval brittle.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    3. Eval environments

      Agents act, so an eval needs a world to act in: a sandbox with seeded data that resets to the same state before every run, fake versions of outside services that record what was called, and for conversational agents a simulated user with a goal and details it reveals only when asked. Without a reset, runs leak state into each other; without fakes, an eval can send real emails or charge real cards.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    4. Repeated runs and reliability

      The same agent on the same task can pass one run and fail the next, so one run tells you little. pass@k asks whether at least one of k attempts succeeds, which fits when a person picks the best attempt; pass^k asks whether all k succeed, which is what a user relying on every run experiences. An agent that passes 75 percent of single runs gets four in a row only about a third of the time, so run each task several times and report both.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    5. Testing the harness without a live model

      Most harness bugs live in ordinary code: the loop, budget checks, retries, tool argument parsing and resuming from a checkpoint. Test them with a fake model that returns scripted tool calls and replies, or with recorded responses replayed from disk, so tests run fast, cost nothing and give the same result every time. Script the awkward cases on purpose: malformed arguments, a tool timeout, a call that repeats forever, a stop mid-step.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    6. Reading transcripts

      Aggregate scores tell you how often an agent fails, not why. Read whole runs, failures first, and in each find the first step where it went wrong, since much of what follows is a consequence. Give that step a short label such as wrong tool, ignored result or invented value, then count labels across fifty or so runs: the most common first failure is your next fix, and the labels become your future automated checks.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    7. How agents fail

      Agent failures recur in recognisable forms, each with a trace you can check: a loop shows as the same call with the same arguments, a wrong tool as a sensible call to the wrong place, an early done as finishing before the verifying step, invented success as a claim the end state contradicts, and drift as later steps serving a goal nobody asked for. Name them in your transcripts and write a detector for each one that keeps returning.

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
  9. Phase 9 · Durable execution and human approval

    1. Durable execution

      Durable execution records the result of every step (each model call, tool call and decision) in a persistent log, so a run killed by a crash or a deploy restarts from its last finished step, not from the beginning. Agents need this twice over: their runs last minutes to days, and repeating a finished step can repeat a charge, an email or a refund. Rule of thumb: once a run can outlive one process or one request, its state belongs in a store, not in memory.

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
    2. Workflow engines under agents

      Engines such as Temporal split a program in two: deterministic workflow code, rebuilt after a crash by replaying its history, and activities that do the real I/O and are recorded once they finish. Model and tool calls answer differently each time, so they must run as activities, or a replay takes another path. Framework checkpointers such as LangGraph's are lighter, saving state between steps, but a resumed node reruns from its start, so its side effects still need idempotency keys.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    3. Recovering from errors mid-run

      Classify a failure before reacting to it. A transient error such as a timeout, a rate limit or an overloaded model is retried with backoff or sent to a fallback model; a tool error the model can fix, like a bad argument or a missing record, goes back to it as an observation so it can replan; a refused permission or an impossible goal is escalated to a person. Retrying everything the same way burns budget on errors that will never succeed.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    4. Undoing multi-step actions

      There is no rollback across separate systems: when step four fails after steps one to three booked a room, charged a card and sent a confirmation, the only way back is a compensating action for each, such as a cancellation, a refund or a correction. This is the saga pattern. Record each completed write with the action that undoes it, run compensations in reverse order, make them safe to retry, and put any step that cannot be undone behind approval.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    5. Human approval as a durable pause

      An approval gate is a pause the run has to survive. The agent stops at the gated tool call, its whole state (history, the pending call, budget used) is saved under a run id, and the process is free to exit. When the reviewer answers, hours later and perhaps on another machine, the run loads that state and carries on from the same call without asking the model again. Make resuming idempotent too: two clicks on Approve must run the action once.

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
    6. Designing the approval request

      A reviewer approves what they can understand in seconds, so show the exact action with its real arguments, the agent's reason, what it will change and whether it can be undone, not the model's paraphrase. Let them approve, reject with a reason the agent sees, or edit the arguments first. Give each request an owner, an expiry and a default when nobody answers (usually reject and escalate), and watch the approval rate: near 100 percent means people stopped reading.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    7. Progress, interruption and steering

      A run that takes minutes must show what it is doing: stream events such as step started, tool called and result received, not just the final text, so users can tell work from a hang. Interruption has to be built into the loop: check for a stop or a new instruction between steps, finish or cancel the current tool call cleanly, and add the user's redirect to the context as a message. Never abandon a write halfway without recording where it stopped.

      Reading

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    8. Background and event-triggered agents

      An agent started by a schedule, a webhook or a queue message has nobody to ask and nobody watching. So the trigger must carry everything the run needs, a redelivered event must not start the work twice (key each run on the event id), budgets and permissions should be tighter than in an interactive session, and the result must land where a person will see it. Runs that keep failing go to a dead-letter queue for review, not into silence.

      Reading

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
  10. Phase 10 · Running agents in production

    1. Systems architecture and contracts

      An agent is one layer of a stack (surface, orchestration, tools, model gateway, guardrails, observability), and many design faults are a requirement placed in the wrong layer. Ask which layer can guarantee it: a prompt can only ask, so anything that must always or never happen belongs in code. Then design the seams: a run whose length depends on its input does not fit a synchronous request, and a queue that delivers at least once needs an idempotency key on every side effect.

      Test yourself on this topic

      5 graded questions · scored out of 100 with feedback · free

      Start the 5 questions
    2. Agent frameworks and SDKs

      A framework hands you the loop, tool wiring, handoffs, tracing and often checkpoints; in return it decides how prompts are built and when state is saved. Adopt one for a need you can name, such as durable pauses or multi-agent graphs, and keep tools, prompts and evals in your own code so switching costs days, not a rewrite. Frameworks age fast: as of November 2026 Microsoft is archiving AutoGen and points users to Agent Framework, its successor.

      Test yourself on this topic

      7 graded questions · scored out of 100 with feedback · free

      Start the 7 questions
    3. Deployment and infrastructure

      An unattended agent is a long, bursty background job, so run it like one: accept the request, put it on a queue, and let workers execute runs whose state lives in a database, never in a web process a deploy will restart. Cap concurrency per tenant so one heavy customer cannot starve the rest, give each run a timeout and a heartbeat so stuck workers are found, and drain workers before a deploy so runs in flight finish or checkpoint.

      Test yourself on this topic

      5 graded questions · scored out of 100 with feedback · free

      Start the 5 questions
    4. Observability

      One agent run is a tree of model calls, tool calls and sub-agents, and the cause of a failure usually sits several steps before the error. Record every step with its inputs, outputs, tokens, latency and cost under one run id, tagged with the prompt, tool and model versions that were live. Then watch per-run measures (steps, cost, success rate) on dashboards and feed sampled runs into evals, so a regression shows up before customers report it.

      Reading

      Test yourself on this topic

      7 graded questions · scored out of 100 with feedback · free

      Start the 7 questions
    5. Tracing agent runs with OpenTelemetry

      OpenTelemetry's GenAI semantic conventions give agent runs a shared vocabulary: an invoke_agent span for the run, a span per model call and an execute_tool span per tool call, with attributes for the model, token usage and agent name. Emitting these standard names instead of a vendor format lets you change tracing backends without re-instrumenting. As of November 2026 the agent and tool spans are still marked Development, so pin a version and expect renames.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    6. Cost per task and prompt caching

      Measure agent spend per finished task: every step, retry and sub-agent added up, divided by the tasks that actually succeeded, because a cheap run that fails still costs money. Each step resends the growing history, so the prompt cache does most of the saving if the prefix stays byte-identical: keep the system prompt and tool list fixed, append to history instead of editing it, and keep timestamps out of the opening. Track the cache hit rate per run.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    7. Latency in multi-step runs

      In an agent, latency adds up: ten steps of a few seconds each is a long wait, and most of it is generated tokens and serial round trips. Cut the number of turns first, by running independent tool calls in parallel and returning tool results complete enough that no follow-up call is needed. Then send simple steps such as routing or extraction to a smaller, faster model. Measure time per step from traces, and stream progress so the wait feels shorter.

      Reading

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    8. Versioning and rolling out agent changes

      An agent's behaviour comes from its prompt, tool definitions, model and harness code together, so version them as one release: a reworded tool description can change behaviour as much as a new model. Run the eval suite on the whole bundle, send it a small share of runs as a canary, compare success rate, cost and step count with the old version, and keep the old bundle ready for rollback. Let long runs finish on the version they started on.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    9. Agent incidents and kill switches

      When an agent fleet misbehaves, by looping, spamming a customer or deleting the wrong records, you must stop it in seconds without a deploy. Build switches at several levels (everything, one tool, one tenant, one run), read by the loop before every step and by the tool layer before every write. Pause queued runs rather than dropping them, keep the traces of the bad runs, and resume only once the cause is fixed and covered by a test.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions

    Chapter 10 lab

    Write the instruction for an agent that reconstructs a failed run from its trace

    A prompt lab that closes the chapter: you write the instruction, and it is graded on a rubric.

    Start the lab
  11. Phase 11 · Agent security and sandboxing

    1. Guardrails around an agent

      A guardrail is a check the agent cannot argue its way past, so it lives in code around the model: input checks before the run, validation of each tool call's arguments against policy, output checks before anything reaches a user or another system, and a human gate on the few irreversible actions. A rule in the system prompt is guidance, not control. Log every block, so you can tell a working guardrail from a noisy one.

      Test yourself on this topic

      7 graded questions · scored out of 100 with feedback · free

      Start the 7 questions
    2. Sandboxing what the agent runs

      Treat every command and script an agent writes as untrusted, and run it where a mistake cannot reach the host, your credentials or the internal network. A container shares the host kernel, so for untrusted code prefer a stronger boundary such as gVisor or a Firecracker microVM. Scope the filesystem to one working directory, block outbound network traffic except to an allowlist of hosts, set CPU, memory and time limits, and keep secrets out of the sandbox.

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
    3. Permission modes and allowlists

      A permission system decides for each tool call whether to allow it, ask a person or deny it, and a good one matches arguments as well as tool names: allow running the tests, ask before a git push, deny reading any .env file. Deny rules should beat allow rules, and a call that no rule matches should fall to ask or deny, never to allow. Save the modes that skip every prompt for throwaway sandboxes, where the sandbox itself is the control.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    4. Agent identity and delegated credentials

      An agent acting for a user should carry that user's authority narrowed to the task, not a service account that can reach every customer. Use OAuth delegation or token exchange to issue short-lived tokens scoped to the tools and data the task needs and bound to the service they are for, and log both the user and the agent on every action. Never forward a user's token to a service it was not issued for, and never put an admin key where the model can read it.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    5. Prompt injection through tools

      Any tool result can carry an attacker's words: a web page, an issue comment, a repository file or another agent's reply may hold text that reads like an instruction, and the model may act on it with all the agent's tools. Marking or filtering that content lowers the hit rate but never to zero. So design for a hijacked step: fix the plan before reading untrusted data, let a model with no tools read it, and check each later call against the user's request.

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
    6. Data exfiltration

      An agent can leak data when it holds private data, reads untrusted content and has any way to send something out, and the outbound channel is often hidden: an image URL the chat client renders, a link with data in its query string, a web fetch, a git push, an email draft. List every such channel your agent has, then remove one of the three per session, such as no outbound fetches while customer records are loaded. Meta calls this limit the Agents Rule of Two.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    7. The agent supply chain

      Every MCP server, skill or plugin you install runs with your agent's access and adds tool descriptions and instructions the model treats as trusted. A malicious or compromised one can hide instructions in a description, or change behaviour in an update after you approved it. Install from sources you can review, pin exact versions or hashes, review again on every update, give local servers only the permissions they need, and keep an inventory of what each agent loads.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    8. Red teaming an agent

      Red teaming an agent means attacking the whole system, not just the chat box: plant instructions in the pages, files and tool results it will read, give it ambiguous goals, and try to make it misuse a tool, gain access it should not have or leak data. Score what it did (the calls it made, what changed) rather than what it said. Use a published list such as the OWASP Top 10 for Agentic Applications as a checklist, and keep each attack that works as a regression test.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
  12. Phase 12 · Computer use, browser and coding agents

    1. Computer use

      A computer use agent works through a screen: it takes a screenshot, picks a mouse or keyboard action, performs it, then takes another screenshot to see what happened. Each step costs a model call and an image's worth of tokens, and a moved button or a pop-up can derail it, so it is slow and fragile next to an API. Use it only for software with no API, run it in a virtual machine holding nothing else of value, and keep the screen resolution modest.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    2. Browser agents

      A browser agent can read a page three ways: as pixels in a screenshot, as the HTML DOM, or as the accessibility tree, a compact list of roles, names and states built for assistive technology. Structure is cheaper and more exact on a well-built page, because the agent can click a named button by reference; pixels still work on canvas apps and badly labelled pages. Reliable agents read the accessibility tree first and fall back to a screenshot when it says too little.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    3. Where GUI agents must stop

      Some steps a GUI agent should hand back instead of attempting: typing passwords or one-time codes, solving CAPTCHAs (they exist to stop automation), confirming a payment, accepting terms, and any click that sends, deletes or publishes. Detect these screens, pause with a clear request, let the person act, then resume. Pages can also try to steer the agent, so treat on-screen text as untrusted and never let it widen what the agent was asked to do.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    4. Coding agents

      A coding agent reads the code it needs, edits files, runs the tests or the build, and loops on what the output tells it. It does best on changes it can check: a failing test that should pass, a type error to clear, a clear acceptance check. Keep each change small and scoped, give it a repository instruction file with the build and test commands, make it run the checks before it claims done, and read the diff, because passing tests prove only what they cover.

      Test yourself on this topic

      4 graded questions · scored out of 100 with feedback · free

      Start the 4 questions
    5. Coding agents at scale

      Run without anyone at the keyboard, a coding agent becomes a CI job: started by an issue, a schedule or a failing build, with a fixed tool allowlist and a step budget. Give parallel agents separate checkouts (git worktrees or containers) and narrow tasks so they never edit the same files. Their output is a pull request, so treat it like one from a stranger: required checks, a human approver, no write access to protected branches, and diffs small enough to read.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions
    6. Research agents

      A research agent searches, reads and writes an answer with citations, and its quality rests on two choices: how widely it searches before going deep, and which sources it trusts. Start broad with short queries and then narrow, prefer primary sources over pages that summarise them, and check that each claim is supported by a passage in the source it cites; a citation that does not back its sentence misleads. Parallel sub-agents widen the search but multiply the cost.

      Test yourself on this topic

      3 graded questions · scored out of 100 with feedback · free

      Start the 3 questions

Practise the Agent Engineer roadmap

331 questions, each graded on the server out of 100. Free · no card.

All career paths