Skip to content

Drop 14 · An environment for a tool-using agent, designing tools an agent can use, five workflow patterns with evals, and threat-model an agent

Choose a tag to compare

@TarrySingh TarrySingh released this 06 Nov 11:15
· 2 commits to master since this release

The fourteenth drop of Synapsa Commons: free, hands-on AI courses that run anywhere.

New this week: an environment for a tool-using agent, designing tools an agent can use, five workflow patterns with evals, and threat-model an agent

Four new lessons in four areas. Each one is a notebook you do: exercises that check themselves, hidden hints, and a progress board.

Lesson What you build Open
An environment for a tool-using agent (Post-training) A small tool environment with reset, step and state, its reward modes and the terminated and truncated split, following the conventions of the environment hubs; episode collection with a softmax policy, the group-relative advantage with its zero-variance case and a policy-gradient update for a tabular agent that learns which tool to call; and a measurement of how often the agent games a reward that pays for tool calls instead of outcomes Colab
Designing tools an agent can use (Agents and protocols) A validator whose error messages name the parameter, the value received and what is accepted; a linter for vague tool names, thin descriptions, bare parameter names and unchecked ids, with a finder for confusable names; an episode loop with exact counts of success, wasted calls, silent failures and recovery; and a measurement of which design lever changes a scripted agent's results most Colab
Five workflow patterns in plain Python, each with an eval (AI engineering) Prompt chaining with a gate and retries, a router with a fallback, parallel voting with a stated tie rule, an orchestrator that plans its own sub-tasks, and evaluate-and-refine with a revision cap, all over a scripted model; and, for each pattern, its accuracy, calls per task, paired gains and losses against a single call and the failure modes it adds, swept over slip rates Colab
Threat-model an agent (Evaluation and governance) A finder for the data flows that cross a trust boundary, a taint propagation that handles cycles, a risk register that maps components and flows to the OWASP Top 10 for Agentic Applications, a mitigation checklist generated from the register, and a check runner that fails closed until each mitigation is present Colab

All four are in lessons/. None needs an API key, a GPU, PyTorch or a download, and each generates its own data from a fixed seed. The tool-design and workflow lessons run a scripted agent and a scripted model and say what such a result does and does not tell you about a language model; the environment lesson says the same of its toy agent. The environment lesson takes about two hours, the tool-design and workflow lessons about 75 minutes each and the threat-model lesson about 45 minutes.

Also in this drop

  • Three earlier lessons are updated after a confirmation review on 6 November 2026: DPO from the RLHF objective, Vet before you connect, and Judges that agree with humans. In the DPO lesson the notebook check of exercise 4 no longer works out the finished formula for you, the failure messages of exercises 3 and 4 no longer spell out the line you are asked to write, the checks of exercises 3, 4 and 8 now ask for numpy arrays (as the grader already did), and one take-away line now gives the right count. In the MCP lesson one notebook check no longer carries an invisible character in its source, and one sentence about the two tools it compares is corrected; what it prints is unchanged. The judges lesson changes only in its grading, behind the scenes. All three are now counted as independently reviewed.
  • The front page and the lessons index are regenerated (103 lessons).
  • Sources re-checked on 6 November 2026. All 35 quoted passages in the four new lessons were compared with the live pages and still say what the lessons quote. The environment lesson reads its conventions from OpenEnv release v0.9.0 and says so; OpenEnv has since reached v0.12.0, and the passages the lesson quotes read the same there.
  • The time limit still has two limits. Every graded check has a time limit and a runaway answer fails its own row, on Linux and macOS (Colab, Kaggle, Binder, Codespaces and local Jupyter). On native Windows there is no time or memory limit, so use WSL, Colab or Codespaces there; and one long native call, such as a very large numpy operation, is stopped only when it returns.
  • Worked solutions and full grading come with enrolment on Synapsa, opening in the coming weeks.

The four new lessons and the three updated ones passed all 14 quality gates today, with the time limit in place. The four new lessons print the same results on Python 3.11 and 3.12 and on Linux and macOS (Linux checked on an emulated x86 machine). The three updated lessons were checked on macOS and on Python 3.11 against 3.12 today; their Linux check was done on 5 November and not repeated. Not every one of the 103 lessons was re-run today: these seven were. Each new lesson went through an independent review while it was built and every critical and major finding was fixed; those fixes have not yet been through a confirmation pass, which is why the README counts 99 of the 103 lessons as independently reviewed.