# AI Training > An open training suite for getting started with AI, from concepts and safety to using, customizing and building AI agents. This site is pre-release. Its pages may change, and a lesson may be rewritten or moved. Content is licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/), and code under [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). The [sitemap index](https://schubergphilis.github.io/ai-training/sitemap-index.xml) lists every page. The [data index](https://schubergphilis.github.io/ai-training/data/index.json) lists the data tree as JSON files. ## Concepts - [Concepts](https://schubergphilis.github.io/ai-training/concepts/index.md): What AI models are and how they behave. - [How a language model works](https://schubergphilis.github.io/ai-training/concepts/how-models-work/index.md): What a language model actually does when it answers, why that explains its strengths, and why it explains its failures too. - [What the model can see](https://schubergphilis.github.io/ai-training/concepts/context-window/index.md): Measure a page of text in tokens and work out how many pages a context window holds, so a long chat that contradicts itself has an explanation. - [Instruction, context and format](https://schubergphilis.github.io/ai-training/concepts/prompt-anatomy/index.md): Turn a one-line request into a prompt with a clear instruction, marked context, a named audience and a stated output format, and see what each part changes. - [Show one example](https://schubergphilis.github.io/ai-training/concepts/one-example/index.md): Replace a paragraph of formatting rules with one worked input and output pair, see the model copy the pattern, and learn when to show an example instead of describing and how many to give. - [Output the next step can use](https://schubergphilis.github.io/ai-training/concepts/structured-output/index.md): Ask a chat assistant for action items as named fields with allowed values, check the result with the program that has to read it, and fix the prompt until it passes. - [The prompt before the conversation](https://schubergphilis.github.io/ai-training/concepts/system-prompt/index.md): The system prompt sets the role, the tone and the standing rules before the first message, and it is where behavior that should hold every time gets fixed. - [Change the prompt before you retry](https://schubergphilis.github.io/ai-training/concepts/iterating-on-a-prompt/index.md): A summary skips the decisions of a meeting. Name the gap, change one line of the prompt, compare with the last round, and move the fix you made twice into a saved template. - [Where a model makes things up](https://schubergphilis.github.io/ai-training/concepts/thin-path/index.md): Why one model gives a reliable summary and an invented citation in the same afternoon, which tasks earn a spot-check and which earn a check of every specific, and how naming the two properties behind a wrong answer picks the fix. - [Same prompt, different answer](https://schubergphilis.github.io/ai-training/concepts/same-prompt-twice/index.md): Run a toy model on the page ten times at two temperatures, count how often the answers agree, and see why one good run proves nothing and what check a workflow built on a model needs. - [Getting a straight answer](https://schubergphilis.github.io/ai-training/concepts/straight-answer/index.md): Why a model praises your plan and folds under pushback, how a leading question produces a leading answer, and three ways to ask so that the answer tells you something. - [Wrong about the world, or wrong about the text](https://schubergphilis.github.io/ai-training/concepts/wrong-about-the-world/index.md): Two kinds of wrong answer, one wrong about the world and one wrong about the text you gave the model, and the check that finds each kind. - [What every token costs](https://schubergphilis.github.io/ai-training/concepts/what-tokens-cost/index.md): Price a short prompt and a long one on a small model and a large one, see why the answer and the model size set the bill and the wait, and find the rule a long instruction file buried. - [Watch a tiny agent work](https://schubergphilis.github.io/ai-training/concepts/agent-loop/index.md): Read the transcript of a toy agent that lists a folder and reads a note, name each phase as observe, think or act, see how a tool is described to the model, and learn the ways the loop ends. - [One prompt, many requests](https://schubergphilis.github.io/ai-training/concepts/one-prompt-many-requests/index.md): Follow one prompt to an agent through every model request it causes, see what the harness sends each time and what comes back from the environment, and learn why the model needs the whole history on every request. - [Assistant or agent?](https://schubergphilis.github.io/ai-training/concepts/assistant-or-agent/index.md): Separate the model from the software around it, apply one test that tells an assistant from an agent whatever the interface looks like, name the parts of the harness, and list an agent's tools before judging its reach. - [Who decides the next step](https://schubergphilis.github.io/ai-training/concepts/autonomy-scale/index.md): Place a product or workflow on the autonomy scale by asking who decides the next step, see one coding agent land on three points in three permission settings, and name the step that moves a workflow up or down. - [Reading the token counts](https://schubergphilis.github.io/ai-training/concepts/reading-token-counts/index.md): Read the input and output token counts of every request in a short chat and in one prompt to an agent, see why a one-line question late in a conversation costs more than the same question at the start, and learn when to start a new conversation. - [Caching and effort](https://schubergphilis.github.io/ai-training/concepts/caching-and-effort/index.md): See what an effort level changes in everything the model writes, choose a level for a kind of work, and read a long chat priced with and without a prompt cache to find what the cache saves and what makes it stop working. - [Answers from documents the model never saw](https://schubergphilis.github.io/ai-training/concepts/retrieval/index.md): Read the output of a small keyword search over four policy texts, see it find the leave policy in the document's own words and miss it in a colleague's words, and learn what grounding promises and what it leaves for you to check. - [Where memory comes from](https://schubergphilis.github.io/ai-training/concepts/memory/index.md): Take the phrase "it remembered" apart into what was stored and what was read back, see how a long session drifts as its window fills, and pick summarize, start fresh or retrieve as the way out. ## Safety - [Safety](https://schubergphilis.github.io/ai-training/safety/index.md): Using AI safely, and judging the risk of letting an agent act. - [What may go into an AI tool](https://schubergphilis.github.io/ai-training/safety/responsible-use/index.md): Where a prompt goes once you press enter, and which of the data you handle may follow it. How to try a new tool with dummy data, and when to say that AI helped. - [Redacting a document before you paste it](https://schubergphilis.github.io/ai-training/safety/redact-before-you-paste/index.md): Take the names, numbers and addresses a task does not need out of a document before it goes into an AI tool, check that the task still works on what is left, and put the values back with a map that never left your computer. - [Saying that AI helped, and crediting what it copied](https://schubergphilis.github.io/ai-training/safety/saying-ai-helped/index.md): Write the disclosure line in its three parts, what the AI did, what you checked and who is accountable, use a comparer that shows how much of a generated function came from a library, and look up the disclosure rule of the place the work goes to. - [What an invented fact looks like](https://schubergphilis.github.io/ai-training/safety/spotting-hallucination/index.md): Read a model's fluent summary of a report, predict which of its figures, quotes and references have no source, and check each one against the report with a checker on the page. - [Seeing bias across many answers](https://schubergphilis.github.io/ai-training/safety/bias-in-patterns/index.md): Read two shortlists from a simulated ranker on the page that each look fair on their own, count who made the cut when the names are swapped, and decide how much checking a task that affects people gets. - [When the tool is usually right](https://schubergphilis.github.io/ai-training/safety/when-the-tool-is-usually-right/index.md): Why attention to a tool's output decays fastest when the tool is good, what aviation and medicine found out about that, and how to build the check into the process rather than into willpower. - [Checking habits that run when you are in a hurry](https://schubergphilis.github.io/ai-training/safety/checking-habits/index.md): Find the row that does not add up in a table a chat assistant wrote, learn the four checks that run on everything that leaves your desk, and set how deep each one goes from the cost of being wrong. - [Following a claim back to its source](https://schubergphilis.github.io/ai-training/safety/following-the-source/index.md): Walk two references in an AI-written paragraph back to the reports they name, find the one that does not exist and the one that says something else, and learn what to do with a claim you cannot check in time. - [Asking a model to disagree](https://schubergphilis.github.io/ai-training/safety/asking-a-model-to-disagree/index.md): Why a model's yes to your plan is not a check, how to ask for the strongest counter-argument before asking for confirmation, and how to strip your own opinion out of the question when you want an assessment. - [Marking what a person has checked](https://schubergphilis.github.io/ai-training/safety/marking-what-a-person-checked/index.md): Why an answer a person has checked and one nobody has checked look the same unless someone marks the difference, how CS50 marks the answers of its AI tutor, and how to put a light "checked by" line into a team's process and sample whether it gets filled in. - [Checking what an agent changed](https://schubergphilis.github.io/ai-training/safety/checking-what-an-agent-changed/index.md): Compare what an agent did with what you asked for, find the deleted file and the sent message its summary left out, and put the one pause before the step that cannot be undone. - [Why agent safety is different](https://schubergphilis.github.io/ai-training/safety/agent-risk/index.md): What changes once an AI can act instead of only answer. How to decide what it may reach and do on its own, and where a person must approve first. - [Sizing an agent's blast radius](https://schubergphilis.github.io/ai-training/safety/sizing-the-blast-radius/index.md): Read an agent's permission list as read, write and send rows, cut it down to the task, and put the one approval on the row that can't be undone. - [Tracing a planted instruction to the tool that leaks](https://schubergphilis.github.io/ai-training/safety/tracing-a-planted-instruction/index.md): Follow one planted line on a web page through three permission sets, and find that the tool that can send is the one that leaks. - [Writing an AI policy a team can apply](https://schubergphilis.github.io/ai-training/safety/writing-an-ai-policy/index.md): Turn "use AI responsibly" into a one-page policy with allowed tasks, data, approvals, logging and an escalation route with names, using read and write access as two levels of sign-off. - [Reading agent logs and rerunning after a model change](https://schubergphilis.github.io/ai-training/safety/reading-agent-logs/index.md): Reconstruct what an agent was asked, called and changed from its log, keep the log where the agent can't edit it with a named reader, and rerun a task set when the vendor changes the model. - [Assessing the risk of a use case before it starts](https://schubergphilis.github.io/ai-training/safety/assessing-a-use-case/index.md): Rate three proposed AI use cases on impact and likelihood, find the ones at or above the threshold, and decide between extra controls and a written acceptance, with a record that can be reviewed. - [Introduction to the EU AI Act](https://schubergphilis.github.io/ai-training/safety/eu-ai-act/index.md): What the European Union's AI Act asks of people who build and use AI at work. Whether a tool is an AI system, which risk tier a use falls in, whether you are provider or deployer, and which transparency duties touch everyday work. ## Using agents - [Using agents](https://schubergphilis.github.io/ai-training/using-agents/index.md): Delegating work to an agent and checking what comes back. - [Finding information with an assistant](https://schubergphilis.github.io/ai-training/using-agents/finding-information/index.md): Ask an assistant what a newcomer must know from a text you supply, with a quote behind each claim, and see why the same question from memory gives a confident wrong answer. - [Working from your own files and images](https://schubergphilis.github.io/ai-training/using-agents/working-from-files/index.md): Hand an assistant a screenshot of a table instead of describing it, get the rows back for a spreadsheet, and count the cells that came back wrong. Then compare two versions of a contract with a brief that says which differences matter. - [Thinking a problem through with an assistant](https://schubergphilis.github.io/ai-training/using-agents/thought-partner/index.md): Ask an assistant which of two job offers to take and get your own framing back as advice, then brief it to argue against your lean and list what you left out, so the thinking is yours. - [Drafting a text and asking for critique](https://schubergphilis.github.io/ai-training/using-agents/drafting-and-critique/index.md): Brief a chat assistant for a short email and check every fact in the draft, then ask for critique of it as a colleague's text against criteria you wrote first, and get problems in place of praise. - [Delegating a task to an agent](https://schubergphilis.github.io/ai-training/using-agents/delegating/index.md): Write a brief, choose how much the agent may do on its own, and review the result against what you asked for. - [How much the agent may do before it asks](https://schubergphilis.github.io/ai-training/using-agents/choosing-autonomy/index.md): Choose draft only, ask before anything that can't be undone, or run to completion by what a wrong step costs, add check-ins on a first run, and write the setting as one sentence. - [Changing the brief while the agent works](https://schubergphilis.github.io/ai-training/using-agents/adjusting-the-brief/index.md): Run a brief with a gap in it, answer the agent's question in the brief instead of the chat, state a changed limit as a replacement, and stop a run whose first result shows the goal was wrong. - [Breaking a task into pieces an agent can finish](https://schubergphilis.github.io/ai-training/using-agents/breaking-work-into-pieces/index.md): Hand a three-part report to an agent as one prompt and see it blend. Then split the task into pieces that each have an input, an output and a check, and run the first one. - [Delegating in rounds](https://schubergphilis.github.io/ai-training/using-agents/delegating-in-rounds/index.md): Delegate one piece of a split report, check the result line by line, change the brief with what the miss showed, and carry the change into the next piece, with a two-line log per round. - [When to stop delegating and do it yourself](https://schubergphilis.github.io/ai-training/using-agents/when-to-stop/index.md): Read three round logs, name the three signs that another round costs more than doing the step yourself, and see why taking a step back says nothing about the tool or about you. - [Chat, agent or automation](https://schubergphilis.github.io/ai-training/using-agents/chat-agent-or-automation/index.md): Pick chat, agent or automation for a task by its worst case, match the checks to the level, and write the rule that would move the pick up or back. - [Trying two models on the same task](https://schubergphilis.github.io/ai-training/using-agents/trying-two-models/index.md): Run one reformatting task, one classification task and one ambiguous request on a small and a large model, time each answer, and read a six-cell table to see where the large model earns its price. - [The steps that stay human](https://schubergphilis.github.io/ai-training/using-agents/steps-that-stay-human/index.md): Walk an eight-step hiring process twice, once for what an agent could do and once for what stays with a person, and learn the three reasons a step stays human and why the list is decided early. - [Reasoning across tool levels](https://schubergphilis.github.io/ai-training/using-agents/reasoning-across-tool-levels/index.md): Read two before-and-after pairs, a summary and a filed folder, and name the check that stopped working when a tool took over the level and the check that replaces it one level up. ## Coding with agents - [Coding with agents](https://schubergphilis.github.io/ai-training/coding-with-agents/index.md): Shipping software changes with a coding agent. - [Your first session with a coding agent](https://schubergphilis.github.io/ai-training/coding-with-agents/first-session/index.md): Start a coding agent in a small repository and give it the context it needs. Then make one change behind a permissions prompt and review the diff before you trust it. - [Keeping API keys out of the agent's reach](https://schubergphilis.github.io/ai-training/coding-with-agents/keys-and-secrets/index.md): Move a coding agent's API key out of its settings file into a password manager, hand it over through an environment variable or a key helper, deny the agent's reads of the secrets that stay, and scan the fixture and the transcript for what a hand forgot. - [Deciding whether to build it at all](https://schubergphilis.github.io/ai-training/coding-with-agents/deciding-what-to-build/index.md): An agent makes building cheap, so the judgment moves before the code. Find the problem behind a request, price the change by what the team owns afterwards, and write success criteria a stranger could check. - [Let the agent interview you](https://schubergphilis.github.io/ai-training/coding-with-agents/agent-interviews-you/index.md): Have the agent interview you about a feature before any plan exists, answer with decisions or "not decided yet", write the settled terms down, and check that the spec and a fresh session's plan use them. - [Splitting the work into components the agent can build one at a time](https://schubergphilis.github.io/ai-training/coding-with-agents/decomposing-the-work/index.md): Split a feature into components with one responsibility and a one-sentence interface each, order them by dependency, and write the acceptance test for the first one before it exists, so it fails on a stub. - [A prototype you throw away](https://schubergphilis.github.io/ai-training/coding-with-agents/prototype-to-throw-away/index.md): Write down one design question, have a coding agent build the smallest program that answers it, put the answer into the spec and the test, and delete the program before it can grow into the system. - [Plan first, then drive the change from a failing test](https://schubergphilis.github.io/ai-training/coding-with-agents/plan-then-test/index.md): Put a coding agent in plan mode for a bug that spans three modules, correct one step of its plan while corrections are cheap, then have it write the failing test, fix the code until the test passes, and read the diff. - [Working from a spec in small increments](https://schubergphilis.github.io/ai-training/coding-with-agents/spec-driven-increments/index.md): Write a one-page spec for a due-dates feature in the to-do fixture, have a coding agent split it into increments that each leave the program working, order them with the least certain one first, and land the first one against the spec's own success criteria. - [Keeping every agent change easy to undo](https://schubergphilis.github.io/ai-training/coding-with-agents/reversible-changes/index.md): Have a coding agent land the three increments of the due-dates spec as one commit each on a branch, revert the middle one to see why the boundaries matter, design data changes with the way back written down, and write the commit messages and pull request description a reviewer needs. - [Telling the agent where the task is and where it stops](https://schubergphilis.github.io/ai-training/coding-with-agents/scoping-and-referencing/index.md): Rewrite a vague brief for a small repository so it names the files in play, the files off limits, the example to imitate, the test to extend and the check to run, and compare which files the agent reads before and after. - [Writing project instructions the agent reads every session](https://schubergphilis.github.io/ai-training/coding-with-agents/project-instructions/index.md): Read two coding agent sessions on the same small repository, find the mistake the agent makes in both, fix it with one line in the project's instructions file, and keep later sessions short enough that the agent keeps following that file. - [What each phase starts with](https://schubergphilis.github.io/ai-training/coding-with-agents/what-a-phase-starts-with/index.md): When planning ends, decide what the implementation phase starts with: the same session, a cleared session and the written plan, or a compacted summary. Know what each keeps, and what the starting context costs before you type. - [Staying the engineer who understands the system](https://schubergphilis.github.io/ai-training/coding-with-agents/keeping-understanding/index.md): An agent that writes most of the code moves the understanding away from you unless you keep it. Read agent code like a colleague's, explain the system from memory after each increment, and keep the architecture decisions in a folder the project instructions point at. - [Reviewing a diff you did not write, against the spec](https://schubergphilis.github.io/ai-training/coding-with-agents/reviewing-the-diff/index.md): Review a prepared agent branch for the due-dates spec in the order brief, tests, diff, read every changed file and question what the spec never asked for, and check the success criteria item by item to find the criterion dropped, the edge case skipped and the test deleted behind a summary that says all tests pass. - [A review from a fresh session](https://schubergphilis.github.io/ai-training/coding-with-agents/review-in-a-fresh-session/index.md): Give the due-dates branch to a new agent session with the diff, the spec and the criteria, ask only for gaps against the spec, check each finding before acting on it, and sort the findings into ones to fix, ones to reject and ones to turn into a rule, while the gates still decide the merge. - [Reproducing a fault before the agent fixes it](https://schubergphilis.github.io/ai-training/coding-with-agents/observing-and-debugging/index.md): Turn a "sometimes fails" report against a nightly sales import into a rerun that fails every time, read the log of a failing run next to a good one to rule out the suspected cause, halve the exports until one row is left, and only then brief the agent with the confirmed cause and check the fix against the same reproduction. - [Giving the agent a check it can run, with a limit](https://schubergphilis.github.io/ai-training/coding-with-agents/self-checking-loops/index.md): Turn the reproduction steps of the nightly sales import into a test the coding agent runs after every change, brief the fix-and-rerun loop with a limit of five attempts and a read-only test file, confirm with git that the test did not change, and tell the deterministic gates that can block a merge from a second model's opinion. - [Tests that prove behavior and docs that stay current](https://schubergphilis.github.io/ai-training/coding-with-agents/tests-and-docs-that-hold/index.md): Break a small pricing module on purpose to find the agent-written tests that mirror the code, rewrite one so it proves the price, keep the tests fast and whole in the agent's loop, and review a change for the documentation it left stale. - [Reviewing what the agent pulled in](https://schubergphilis.github.io/ai-training/coding-with-agents/dependency-review/index.md): A coding agent adds packages fast and with confidence. Review each one in proportion to its risk, with the OpenSSF Scorecard checks as the security step and a written skip list. - [Reading agent code as if the input were hostile](https://schubergphilis.github.io/ai-training/coding-with-agents/security-review/index.md): Run a static analyzer over an agent-written search function, find the string-built query it reports and the swallowed error it misses, and brief the agent for a parameterized fix with a test. - [Sandboxing a coding agent](https://schubergphilis.github.io/ai-training/coding-with-agents/sandboxing/index.md): Compare the ways to contain a coding agent, put the controls that matter outside its trust boundary, and set up Claude Code's built-in sandbox with a network allowlist whose effect you predict. - [Attacking your own agent before someone else does](https://schubergphilis.github.io/ai-training/coding-with-agents/red-teaming-your-agent/index.md): Make a scratch copy of a small invoice tool with a planted file that hides instructions for the agent, start the coding agent there with web access and writes outside the copy blocked, attack it three ways, check what it did, and turn each finding into a permission change, a line in the instructions or a gate. - [Saying what the agent did, in the commit and the review](https://schubergphilis.github.io/ai-training/coding-with-agents/attribution-and-review-norms/index.md): Get an agent's change ready for review, say in the pull request what the agent did and what you checked, and attribute it in a commit trailer with no sign-off the agent cannot give. - [Enforcing the team's rules with hooks and CI](https://schubergphilis.github.io/ai-training/coding-with-agents/ci-and-hooks/index.md): Make two team rules run without anyone remembering them: a Claude Code hook that blocks agent edits to the nightly import's test and data, and a pinned CI job that runs the deterministic gates on every pull request, with the agent fixing the failing job from its log within a bound. - [A backlog and standards the agent can read](https://schubergphilis.github.io/ai-training/coding-with-agents/backlog-and-standards/index.md): Move a two-part spec into the issue tracker as two issues with a "blocked by" link that an agent reads through `gh`, then turn a finding that came up in two reviews into a line in a standards file or a check, and block on style only for a rule in the file or a failed check. - [Running several agent sessions in worktrees](https://schubergphilis.github.io/ai-training/coding-with-agents/parallel-sessions/index.md): Run two agent sessions on one project at once, each in its own git worktree and branch with a task that changes other files, keep a one-line note per session, and integrate in a fixed order: merge the API branch, have the docs session rebase and run the check again, and keep every session away from the shared stash and port. - [Writing down how the team uses agents](https://schubergphilis.github.io/ai-training/coding-with-agents/team-practice/index.md): Write the team's practice for agent use into the project instructions file, starting from the incidents in the project's history, take out the rule no incident supports, and decide which agreements a hook or a CI check also enforces. ## Customizing agents - [Customizing agents](https://schubergphilis.github.io/ai-training/customizing-agents/index.md): Configuring an agent for a project with instructions, skills, tools and permissions. - [Project instructions: AGENTS.md](https://schubergphilis.github.io/ai-training/customizing-agents/instructions/index.md): Write the one file a coding agent reads before it touches your project, and keep it short enough that it keeps working. - [Load it, point at it, or cut it](https://schubergphilis.github.io/ai-training/customizing-agents/load-point-prune/index.md): Take a long instruction file and make it short: keep what nearly every task needs, move what only some tasks need behind a one-line pointer, and delete the lines the agent would not miss. - [Instruction, skill or tool?](https://schubergphilis.github.io/ai-training/customizing-agents/skill-or-tool-or-instruction/index.md): Three ways to change what an agent does, the question to ask before choosing one, and what each costs in context and access. - [Writing your first skill](https://schubergphilis.github.io/ai-training/customizing-agents/first-skill/index.md): Build a release skill for a small package step by step, in the open skill format: the description that triggers it, the steps in order with exact commands, the check that says the result is right, and what to do when a step fails. - [Who invokes a skill, and where it lives](https://schubergphilis.github.io/ai-training/customizing-agents/who-invokes-a-skill/index.md): Decide whether the agent may start a skill on its own or only a person may, what each choice costs in context, and whether the skill belongs in the project, in your own configuration or with the organization, including which one runs when two share a name. - [Testing a skill from a fresh session](https://schubergphilis.github.io/ai-training/customizing-agents/testing-a-skill/index.md): Run the release skill from the first-skill lesson in a clean clone and a new session, read the transcript for where the agent hesitated, asked or guessed, turn each place into a check, a failure step or a sharper success test, and run it again. - [Loading only what the skill needs](https://schubergphilis.github.io/ai-training/customizing-agents/progressive-disclosure/index.md): Measure what the release skill costs at each loading stage, move its rollback procedure into a reference file the skill points to, and measure again, so the common path stays small. - [Reading a plugin before you install it](https://schubergphilis.github.io/ai-training/customizing-agents/plugins/index.md): Read an invented release plugin part by part, name what each skill, hook, subagent and server does in your sessions, and decide whether to install it, copy one skill out of it, or leave it. - [Adopting a published skill set](https://schubergphilis.github.io/ai-training/customizing-agents/adopting-a-skill-set/index.md): Vet an invented skill set skill by skill for license, maintenance, scripts and pre-approved tools, take two of its skills, and check what they change in a session against what they add to the context. - [Connecting an agent to your systems with MCP](https://schubergphilis.github.io/ai-training/customizing-agents/mcp/index.md): The operator's view of a remote tool server, from the identity the agent acts under to the point where a CLI is the better connection. - [Connecting your first tool server](https://schubergphilis.github.io/ai-training/customizing-agents/mcp-first-server/index.md): Connect a local file-system server scoped to one copied directory, give the agent a list-and-summarize test task, and read the transcript for every tool call and its arguments before the server touches real work. - [Logging from a stdio server](https://schubergphilis.github.io/ai-training/customizing-agents/logging-from-a-stdio-server/index.md): Break a stdio tool server with one debug line on standard output, watch the client fail to parse the first line, move the line to standard error, and read the reference file-system server's log while an agent calls it. - [Measuring what a tool server costs](https://schubergphilis.github.io/ai-training/customizing-agents/mcp-tool-cost/index.md): Count what a twenty-tool server's definitions take from the context window, run one query through the server and through a CLI, and decide which tools and servers stay connected. - [Hardening a tool connection](https://schubergphilis.github.io/ai-training/customizing-agents/mcp-hardening/index.md): Give a notes server a read-only token that expires in an hour, turn on its tool-call log, plant an instruction in one note, and read in the log which control stopped the send it asked for. - [Seeing what the agent sends](https://schubergphilis.github.io/ai-training/customizing-agents/seeing-what-the-agent-sends/index.md): Watch the context meter while you connect one more tool, find the session in its record on disk, and log the requests on your own machine to see what the tool definitions add to each one. - [Choosing a permission mode per task](https://schubergphilis.github.io/ai-training/customizing-agents/permission-modes/index.md): Run one small task with a coding agent in a mode that asks before everything and in one that accepts edits, count the prompts, and choose the mode by what a mistake would cost. - [Allowing the commands the task needs](https://schubergphilis.github.io/ai-training/customizing-agents/allowlists/index.md): Run one small task with a coding agent twice, first with nothing pre-approved and then with an allowlist for the test command and the files it edits, then prune every rule the run never used. - [Where a setting comes from](https://schubergphilis.github.io/ai-training/customizing-agents/settings-layering/index.md): Why a coding agent's setting seems ignored: the settings files in override order, one worked example where four layers disagree and the effective permission set is derived entry by entry, and what a team commits versus what each person keeps local. - [Writing a hook that blocks a mistake](https://schubergphilis.github.io/ai-training/customizing-agents/first-hook/index.md): Write a Claude Code hook that runs before each commit and blocks it when the lockfile changed and the manifest did not, test it by hand, then make the mistake on purpose and read what the agent does with the message. - [Keeping the project in charge](https://schubergphilis.github.io/ai-training/customizing-agents/project-stays-in-charge/index.md): When an installed skill asks for a push the project forbids, remove the conflict from your copy of the skill, refuse the push with a PreToolUse hook whose reason names the open route, and see why a bare refusal leaves other spellings of the same command open. - [Delegating to a subagent with narrower permissions](https://schubergphilis.github.io/ai-training/customizing-agents/subagents/index.md): Define a read-only reviewer subagent with its own instructions and tool list, have a coding agent delegate a review of a small diff to it, and compare what the main context holds before and after. - [Reading what the agent remembers](https://schubergphilis.github.io/ai-training/customizing-agents/memory-review/index.md): Read the auto-memory notes a coding agent keeps for a project, delete the two that have gone stale, and move a team fact into a context file that the instruction file imports. - [Notes that go stale](https://schubergphilis.github.io/ai-training/customizing-agents/notes-that-go-stale/index.md): Tell a primary source from a secondary one, name the source each memory note summarizes, and decide whether to trust, check or delete each note. - [Directing the summary before compaction](https://schubergphilis.github.io/ai-training/customizing-agents/compaction/index.md): Load a session log with three planted facts, compact it on command with instructions that name decisions, open items and rules, and check which facts the summary kept. - [Handing work to the next session](https://schubergphilis.github.io/ai-training/customizing-agents/session-handoff/index.md): End a session that stopped halfway with a handoff file that names the state, the decisions and what was ruled out, and count the turns a fresh session needs with and without it. - [Turning repeated work into something the agent keeps](https://schubergphilis.github.io/ai-training/customizing-agents/repeated-work/index.md): Read three coding sessions that each work out how to regenerate an API client, place each repeated explanation in the instructions, a skill, a hook or a context file, and cut the instruction lines that a hook and a skill now cover. ## Building agents - [Building agents](https://schubergphilis.github.io/ai-training/building-agents/index.md): Build an agent from a model, a loop and tools. - [What a tool call looks like on the wire](https://schubergphilis.github.io/ai-training/building-agents/how-a-model-calls-a-tool/index.md): The request, the tool_use reply, the tool_result message and the final answer of one real API tool call, mapped onto the fake model of the first agent lesson. - [Building your first agent](https://schubergphilis.github.io/ai-training/building-agents/agent-loop/index.md): Define one tool, run the loop that lets a model call it, and see why the loop is the whole architecture. - [Writing a tool schema the model uses correctly](https://schubergphilis.github.io/ai-training/building-agents/tool-schemas/index.md): Give a fake model two overlapping tools, watch it pick the wrong one, and fix that with a description that says when to use the tool and an enum the model cannot guess around. - [When a tool fails](https://schubergphilis.github.io/ai-training/building-agents/tool-errors/index.md): Break a tool on purpose, return the failure as data the model can read, and give the loop a retry policy with a named stop reason. - [Approving a risky tool call](https://schubergphilis.github.io/ai-training/building-agents/approving-a-tool-call/index.md): Make the loop stop before a refund tool runs, show a person the call and its exact arguments, and send a refusal back to the model as the tool's result. - [Several tool calls in one turn](https://schubergphilis.github.io/ai-training/building-agents/parallel-tool-calls/index.md): Let the fake model ask for three weather lookups in one reply, run them together and return the results as one message, then watch a fourth call that needs the first result wait for its own round. - [Stopping the loop on purpose](https://schubergphilis.github.io/ai-training/building-agents/stopping-the-loop/index.md): Give the agent loop every reason it needs to stop, run three fake models that never answer, and name the rule that ended each run. - [Rebuilding the loop on an agent SDK](https://schubergphilis.github.io/ai-training/building-agents/loop-on-an-sdk/index.md): Put the weather agent on the Claude Agent SDK, name the five parts of the hand-written loop the SDK took over, set the turn and cost limits the defaults leave open, and see where the SDK's compaction gets in the way of an evaluation. - [Retrieval as a tool the agent calls](https://schubergphilis.github.io/ai-training/building-agents/retrieval-as-a-tool/index.md): Build a keyword search as a tool, run it once per question and then in a bounded loop against a twelve-document handbook, and use a six-question test set to decide which version a question needs. - [Where an agent's memory lives](https://schubergphilis.github.io/ai-training/building-agents/agent-memory/index.md): Compare five places an agent can keep what it should know tomorrow, start with a notes file a person can read, see what changes when that file grows to ten thousand lines, and see how memory files and compaction keep an agent's context window small. - [Turning good into a rubric](https://schubergphilis.github.io/ai-training/building-agents/rubrics/index.md): Score twelve runs of a handbook assistant on five quality pillars, rewrite "well grounded" as an anchored 0-1-2 criterion two graders agree on, and check it against a model judge on a sample. - [A golden set is the agent's regression suite](https://schubergphilis.github.io/ai-training/building-agents/golden-sets/index.md): Run a golden set of fifteen handbook questions with the qualities a good answer has, predict what a one-line prompt change breaks, hold one item in five back for release, and add two items. - [Recording and grading the path the agent took](https://schubergphilis.github.io/ai-training/building-agents/traces-and-trajectories/index.md): Give an invoice assistant's loop a trace of every model and tool call, grade two runs with the same answer by the path they took, write the expected path for a lookup as a rule, and read two transcripts the scores passed. - [Reading failures one by one](https://schubergphilis.github.io/ai-training/building-agents/error-analysis/index.md): Read a handbook assistant's ten failed runs of one week, one at a time, name the step where each went wrong, count the kinds, fix the most common one first, and turn every failure into a golden-set item. - [A model as the grader](https://schubergphilis.github.io/ai-training/building-agents/llm-as-judge/index.md): Have a stand-in judge with a length bias grade runs of a handbook assistant, compare its scores with a person's, and pair numbers that rise on their own with ones that catch them. - [Workflows before agents](https://schubergphilis.github.io/ai-training/building-agents/workflows-before-agents/index.md): Run a chain with a gate, a route and parallel calls on a shop's emails, with code deciding the order of the fake model calls, and tell those tasks apart from one that needs an agent that chooses its own steps. - [Reasoning before each action](https://schubergphilis.github.io/ai-training/building-agents/react/index.md): Give the fake model a one-line thought before each tool request, compare its trace with the plain loop's on the same tasks, and see when the reasoning changes the call and what it costs. - [A second pass that critiques the first](https://schubergphilis.github.io/ai-training/building-agents/reflection/index.md): Run a fake critic and reviser on four handbook answers, see a critic without criteria loop on a trivial edit, and bound the pattern with concrete checks, a cap of two rounds and a view of what each round costs. - [Writing the plan before taking the steps](https://schubergphilis.github.io/ai-training/building-agents/planning/index.md): Have the fake model write a numbered plan before any tool runs, work through it, and see a stale plan send a false email until the model revisits the plan after each step. - [Plan everything first or react step by step](https://schubergphilis.github.io/ai-training/building-agents/plan-or-react/index.md): Place plan-then-execute and reactive agents on one spectrum, compare a fixed workflow with an agent, count what six patterns cost at twelve steps, and name what is lost between levels of plans and at each handoff of a composition. - [Orchestration in code or by a model](https://schubergphilis.github.io/ai-training/building-agents/orchestrating-agents/index.md): Run three fake agents as a pipeline in code and then under a manager model that calls two of them as tools, name the sequential, hierarchical and collaborative arrangements, and stop the run with a report when a fault hits a boundary. - [What every extra agent costs](https://schubergphilis.github.io/ai-training/building-agents/orchestration-tax/index.md): Count the tokens that a pipeline and a manager with workers spend on handoffs and repeated context next to a single agent, name the rest of the tax, ask what one agent can't do, and compare both designs on the same golden set. - [How a running agent gets attacked](https://schubergphilis.github.io/ai-training/building-agents/agent-attack-surface/index.md): Name the four risks that appear once a model can act, count the outbound channels in a support agent's permission list, see what a planted line does when the system prompt is the only layer, and cut the agent down to what its task needs. - [Guardrails in layers](https://schubergphilis.github.io/ai-training/building-agents/guardrails-in-layers/index.md): Add a permission check, an output filter for account numbers and an approval gate one at a time around a shop's support agent, run the planted recipe page after each, read in the trace which layer acted, and say what each layer catches and misses. - [Gating a deploy on the evaluation](https://schubergphilis.github.io/ai-training/building-agents/eval-gated-deploys/index.md): Turn the golden set script into a gate with a threshold per metric, predict what it does with a prompt that drops one instruction, fix the prompt from the failing transcripts, and plan a staged rollout with a rollback that is a configuration change. - [Growing the evaluation set from traces](https://schubergphilis.github.io/ai-training/building-agents/evals-from-traces/index.md): Read a weekly sample of the handbook assistant's traces, label each run good or bad, find the failures the golden set has no case for, strip personal data from them, and add them as cases that the deploy gate runs on the next change. - [Cost, caching and pinning the model](https://schubergphilis.github.io/ai-training/building-agents/cost-and-provider-operations/index.md): Give an agent loop a cost record and a token budget, cache the prompt prefix that never changes, retry the provider errors that go away after a wait and report the others, and pin the model id. - [Protocols for tools and for other agents](https://schubergphilis.github.io/ai-training/building-agents/agent-protocols/index.md): See how the Model Context Protocol and agent-to-agent protocols such as A2A turn N x M integrations into N plus M, what an Agent Card declares, and why each connection is a trust decision that the defense layers of a support agent still have to cover. ## Guides - [Running a workshop](https://schubergphilis.github.io/ai-training/guides/running-a-workshop/index.md): Plan and run a one-day, face-to-face workshop on one area of this site, with three tables for three levels. - [How to study with the tutor](https://schubergphilis.github.io/ai-training/guides/tutor/index.md): Install the ai-tutor skill in Claude Code or opencode, open a lesson with it, and know what it does and doesn't do. - [Writing pages](https://schubergphilis.github.io/ai-training/guides/writing-pages/index.md): Add Markdown pages, wire them into the sidebar, and link between them. ## Reference - [Glossary](https://schubergphilis.github.io/ai-training/glossary/index.md): Every concept on the topic map, with its one-paragraph definition. - [Checkpoint export](https://schubergphilis.github.io/ai-training/data/checkpoints.json): Every checkpoint of the live lessons as JSON, with its options, hint and answer. - [Tutor instructions](https://schubergphilis.github.io/ai-training/data/tutor.md): The instruction file an AI tutor reads before it helps a learner with one lesson. ## Optional - [Full course text](https://schubergphilis.github.io/ai-training/llms-full.txt): The Markdown alternate of every course page and live lesson, in one file. - [Contributing](https://schubergphilis.github.io/ai-training/contributing/index.md): Building the site and contributing to it. - [About this project](https://schubergphilis.github.io/ai-training/about/index.md): Why this training suite exists, what it contains, how its lessons work, and how it was built and is maintained.