The agent loop
An agent is a loop, not a single answer. The model reads the context, decides what it needs, and the harness runs that step and feeds the result back. The loop turns until the model stops asking for things or the harness stops it.
A model on its own produces text. Everything that makes an agent useful, and everything that makes it safe to deploy, sits in the code around the model. That code is the harness. It assembles the context, receives the tool requests the model emits, decides which to honour, writes checkpoints, keeps the window inside its limit, checks the output and stops at the point where a person has to take responsibility. The simulator below runs a single agent request through those six parts so you can watch where each one acts. Nothing here calls a model. Every step is derived from a scenario you can read, change and share.
Hello, I have an appointment this week but I cannot travel. Can you tell me the date and move it to next month?
What this agent may do. Anything outside this list is refused by the harness.
Compaction happens at 72%.
Select one to highlight the steps it covers in the trace.
Everything stays on your machine. Sharing puts the scenario in the link itself, not on a server.
An agent is a loop, not a single answer. The model reads the context, decides what it needs, and the harness runs that step and feeds the result back. The loop turns until the model stops asking for things or the harness stops it.
The model never runs anything itself. It emits a structured request naming a tool and its arguments. The harness decides whether to honour that request. This separation is what makes the rest of the controls possible.
Everything the model reads has to fit in a fixed window. Tool results accumulate in it. When the window fills, the harness summarises the oldest conversation and keeps policy and instructions intact, because dropping those changes behaviour.
A checkpoint records where the run had got to. When a step fails or the process dies, the harness restarts from the checkpoint instead of replaying the whole conversation, which costs tokens and can repeat side effects.
Permissions decide what the agent may do before it does it. A call outside the agent scope is refused by the harness, and the refusal is returned to the model as an ordinary result so the run continues with one option removed.
Guardrails inspect what the model produced, after the fact. They catch content problems that a permission cannot, because a permitted action can still produce the wrong text. The two controls sit at different points and do not substitute for each other.

Shahzad Asghar, CISSP, CISM · Written in a personal capacity
When my teams first put agents into production, the failures were never in the model. They were in the code around it: the part that assembles context, decides which tool calls to honour, keeps the context window in bounds and stops where a person has to decide. Nobody had a name for that layer, so engineers skipped it. This interactive explainer shows the harness working step by step, because it is the part a buyer, an auditor and a developer all need to see.
I have spent more than twenty years building data and AI systems in international development and humanitarian organisations, including over a decade in United Nations agencies: leading a data analysis group whose systems served more than 700,000 refugees, then heading data and digital solutions for a regional commission, with earlier work at UNICEF, UNOCHA and CIDA. I hold the CISSP and CISM security certifications. What I publish here is what I wish someone had handed me before my first AI project. If you work through it and want to compare notes on your own situation, I am happy to connect and discuss.
Related reading: agentic AI governance, the AI agents track, and the AI glossary.