Mindket
AdvancedFree

Harness engineering: build the code around an AI agent

A black banner titled "Harness engineering" over the line "The loop, tools and guardrails around an agent".

This free harness engineering course has four lessons for developers who build AI agents. A harness is the code around the model: the loop, the tools, the files it reads and the rules it follows. You will write tools an agent uses well, keep an agent working across many sessions and set guardrails such as sandboxes, permissions and hooks.

What you'll be able to do

  • Explain what an agent harness is and which parts of an agent it controls.
  • Write tool names, descriptions and results that an AI agent uses correctly.
  • Keep an agent on a long task across many context windows with a feature list, progress notes and git.
  • Limit what an agent can do with sandboxes, permission rules and hooks.
All courses

Who it's for

For developers who have built an agent loop or used the Claude Agent SDK or the OpenAI Agents SDK. Take the Claude API or OpenAI API course first if tool calls are new. The examples use Python.

Lessons

  1. 1What is an agent harness? The loop, tools and checks around a modelAn agent harness is the code around a model: its loop, tools, context, permissions and checks. See what Codex and the SDKs put in one, with a Python sketch.10 min
  2. 2Tools for AI agents: names, descriptions and results a model uses wellA model knows your tools only by their names, descriptions and results. How to shape, name, describe and size tools for AI agents, and test each change.11 min
  3. 3Long-running agents: keep one task going across many sessionsKeep an AI agent on one task for hours: an initializer session, a feature list, a progress file, git, end-to-end checks and a loop that restarts it.11 min
  4. 4AI agent guardrails: sandboxes, permission rules and hooksLimit what an AI agent can do: a sandbox for files and network, permission rules, hooks that check each tool call and approvals for risky actions.11 min

Frequently asked questions

Is this harness engineering course free?

Yes. Every lesson is free to read. The examples call model APIs, and those providers may bill for their use.

What is an agent harness?

It is the code that runs a model as an agent: the loop that calls it, the tools it may use, the context it gets and the checks around each action. Lesson 1 takes one apart.

Do I need a framework to build a harness?

No. A harness can be a short loop in plain Python. SDKs such as the Claude Agent SDK and the OpenAI Agents SDK give you one ready-made, with tools, context handling and permissions.

What should I learn after this course?

The AI security course is next. It covers prompt injection, jailbreaks, the OWASP Top 10 for LLM applications and how to red team your own app. The AI evals course follows it.

Share this course

See agents built on a harness

Browse the agents on Mindket, each listed with a preview, to see what a model with good tools and rules can do.

Browse agents

All courses · All articles