A. Module overview
| Field | Value |
|---|---|
| Module ID | L3-M01 |
| Level | 3 - AI Agent Quality Engineer |
| Description | Opens Level 3 by looking inside an agent before testing it: telling a workflow (models and tools orchestrated through predefined code paths) from an agent (the model directs its own process and tool use) using a sourced definition, the four parts of an agent (model, tools, loop, environment), the tool layer running in a sandbox, the loop with six stop reasons (maximum steps, budget, final answer, consecutive-error limit, loop guard, policy error), three planning patterns (direct, plan-then-execute, reason-act) compared on the same task, the observability layer (trace, span, log, logical clock, redaction of sensitive data, trace lint) and an architecture map with risk annotations. The module lab is a small, deterministic simulated agent that runs offline: no model calls, no API key, and tools run only inside a temporary sandbox directory. What is known about real agents is quoted from sources read on 2026-11-04 (the ReAct paper, the "Building effective agents" article, the Claude tool use documentation, the OpenTelemetry concept pages on traces and logs, the OWASP Excessive Agency entry; the Plan-and-Solve paper was read as an abstract only); the reading level of each source is recorded in §12 of each lesson. |
| Why this module matters | Agents fail in ways a single model call cannot: they do not stop, they repeat a call, they use up the budget before recording a result, they leak secrets into logs, or they have write permissions that are too broad. Most of these failures live in the loop code and the tool layer, so ordinary tests can catch them if you know where to look. This module teaches where to look, and lays the groundwork for the Level 3 modules on tool contracts, multi-step scenarios, trajectories, state, reliability and safety. |
| Target professional competency | Level 3, learning outcome 1: "Map an agent's architecture and execution lifecycle, and identify the risk at each step". |
| Estimated duration | 5 lessons (120 + 120 + 120 + 120 + 90 minutes) = 9.5 hours + module assignment ~4 hours + quiz 0.5 hours ≈ 14 hours for someone who has completed L2-M08. The figure is higher than the Level 3 plan's average of ~80 minutes per lesson because each lesson has a long independent exercise. An estimate, not yet measured with real learners. |
| Prerequisites | L2-M08 (the Level 2 capstone; the first lesson needs L2-M08-L04). The module reuses, without repeating: the tool_use / tool_result protocol, parameter validation and a chat agent with fake tools (L1-M05-L03 to L05), prompt injection (L1-M04-L04), the test oracle (L1-M01-L01), pytest and exit codes (L1-M07), the fail-closed gate and the paired comparison (L2-M07, L2-M08). No API key needed. |
| Module output (deliverable) | An agent architecture map with risk annotations: a data file describing nodes, edges, trust boundaries, loop limits and a list of risks (score, control, test), passed through the lab's validator; plus the small products of each lesson: a workflow-or-agent label with reasons, a stop-condition test suite, a comparison of two patterns on one task, a redacted trace that passes lint |
| Cost | 0 VND |
What learners build. Step by step, in code-labs/l3-m01: (L01) a tool layer in a sandbox with exact tool-name matching and strict JSON parameters, a workflow-or-agent classifier over six self-declared fields, nine fake tasks with an end-state oracle and three simulated policies; (L02) a loop with six stop reasons, a loop guard with a canonical call key and a state fingerprint, a limits lint; (L03) a plan lint and a comparison of three patterns on the same task, seed and limits, with and without simulated faults; (L04) a trace writer with a logical clock, redaction of sensitive data, a trace lint and an agent-convention lint; (L05) an architecture map as data, a validator, a risk table and declared-test coverage. The lab is independent of the earlier labs and needs only pytest.
What the module does not do. It does not measure real models or agents, it states no price, speed or reliability for any model or vendor, and it does not rank or recommend any framework: every number in the lab describes the simulation. It does not run shell commands, network calls or files outside the temporary sandbox directory. It does not create or edit an automatically running workflow in the repository. It gives no legal opinion. Lints and validators only flag; the loop guard and the limits lint block the run (fail closed); a person decides the thresholds and every real-world effect.
Terms reused with a different meaning (each lesson has a sentence that separates the senses). agent has the same meaning as in L1-M05-L05; oracle (the mechanism that decides pass or fail) differs from the oracle context of L2-M06; the agent's plan differs from the "comparison plan" of L2-M07; trace is the span tree of one run, different from the transcript of L1-M05-L05 and the trajectory of L3-M04; span differs from the evidence span of L2-M06; observability (answering questions about one run) differs from monitoring (aggregate metrics over time); step, loop and state take their meaning from the agent loop; the loop guard (blocks a repeated call at run time) differs from the guard of L2-M03-L02, a deterministic check placed next to a similar point; declared-test coverage (the share of risks that declare a test) differs from the coverage of the confidence interval (L2-M01-L04) and the dataset coverage (L2-M02-L02).
B. Learning objectives
| ID | Objective |
|---|---|
| MO1 | Classify a system as a workflow or an agent using a sourced definition, identify the four parts of an agent, and test the tool layer in the sandbox with bad calls. |
| MO2 | Read one run of the loop, list every stop reason, compute by hand the stopping point at edge cases, and evaluate a loop guard together with its blind spot. |
| MO3 | Compare planning patterns on the same task, seed and limits, lint a plan, and read simulation results without inferring anything about real models. |
| MO4 | Attach traces, spans and logs to a simulated agent, redact sensitive data before writing, and lint a trace, stating what the lint does not check. |
| MO5 | Draw an architecture map with risk annotations, run the validator, and turn risks that have no test yet into work for later modules. |
C. Lessons
| ID | Lesson | Duration | Prerequisite | Concepts | Practical output |
|---|---|---|---|---|---|
| L3-M01-L01 | What an agent is: model, tools, loop and environment | 120' | L2-M08-L04 | workflow and agent, four parts, tool layer in a sandbox, end-state oracle, excessive agency | Classify a system as workflow or agent |
| L3-M01-L02 | The agent loop and stop conditions | 120' | L01 | six stop reasons, edge cases for step count and budget, loop guard, limits lint | Trace a loop and find its exit conditions |
| L3-M01-L03 | Planning patterns: direct, plan-then-execute and reason-act | 120' | L02 | ReAct and Plan-and-Solve as sourced, plan lint, comparing patterns under fair conditions | Compare two patterns on one task |
| L3-M01-L04 | Observability: traces, spans and logs | 120' | L03 | trace, span, log, logical clock, redaction of sensitive data, trace lint | Attach observability to a fake agent |
| L3-M01-L05 | Architecture map and risk analysis | 90' | L04 | map as data, trust boundaries, risk annotations, validator | An architecture map with risk annotations |
D. Module assignment
The module assignment (exercises.md): build an architecture map with risk annotations for HocVui Assistant v2 (adding the share_note tool) together with four accompanying products (classification and tool layer, a stop-condition test suite, a comparison of three patterns, a redacted trace), five reports generated by one script, a decision by one person, acceptance criteria AC1-AC6 and a 100-point rubric; plus one independent challenge (SachMo). The five independent per-lesson exercises are in code-labs/l3-m01/exercises/ and in §9 of each lesson. Module quiz: quiz.md (12 questions, 20 points, pass mark 14).
E. Module assessment
The practice for each lesson is in practice-01.md to practice-05.md (with .en.md versions). The module quiz, the module assignment rubric and the acceptance criteria AC1-AC6 are in quiz.md and exercises.md. The solutions, answer key and instructor guide are for instructors only and are not published.
F. References
The shared list is in references.md (seven sources, access dates, how much of each source was read); each lesson also has its own references table in §12.
Objective ↔ assessment matrix
| Objective | Lesson | Independent exercise (§9) | Quiz question | Module assignment criterion |
|---|---|---|---|---|
| MO1 | L01 | exercises/test_l01_agent.py |
Q1, Q6 | AC1 |
| MO2 | L02 | exercises/test_l02_loop.py |
Q2, Q3, Q10 | AC2 |
| MO3 | L03 | exercises/test_l03_planning.py |
Q4, Q7, Q9 | AC3 |
| MO4 | L04 | exercises/test_l04_trace.py |
Q8, Q11 | AC4 |
| MO5 | L05 | exercises/test_l05_archmap.py |
Q5, Q12 | AC5 (AC6 is reproduction, shared by all objectives) |