# Agent loop

Canonical: https://revyl.com/glossary/agent-loop/
Last updated: 2026-12-02

> An agent loop is the cycle where a model picks a tool call, the harness runs it and returns the result, and the model picks again until it stops.

Also called: agentic loop.

An agent loop is the cycle in which a model chooses a tool call, the harness runs it and returns the result, and the model decides what to do next, until it answers, asks a question or is stopped.

## How does an agent loop work?

In OpenAI's description of the Codex loop, the model either answers or requests a tool call. The agent runs the call, adds its output to the prompt and queries the model again, until the model replies with a message instead of a tool call. An agent can check a change this way: it starts a browser or device through the Revyl CLI or MCP server, runs the changed flow and reads the result. If the check fails, the model can use the output to try a fix or ask the user for missing input. The pattern goes back at least to the 2022 ReAct paper, which had a model "generate both reasoning traces and task-specific actions in an interleaved manner".

## How does it relate to other terms?

The loop runs inside a harness, the software around the model. A [long-running agent](https://revyl.com/glossary/long-running-agents/) keeps the work going across hours or days.

## How do I try it on Revyl?

Revyl is verification infrastructure for cloud agents.

- Web browsers, iOS simulators, Android emulators and macOS computers.
- Revyl Atlas: the behavior observed in web, iOS and Android sessions.
- Free plan: Up to 1,200 free device minutes every month, no card, 2 devices at once, and unlimited developers and agents, no seat fees.
- Pro: pay as you go, no monthly fee, with 10 devices at once.
- Revyl computers, macOS workspaces where agents build and test apps, come with Pro. Add a card to unlock them, and your 1,200 free minutes still cover their sessions.
- Proof of changes, once enabled: by default, a status on each PR with a build.
- A proof that exercised the change shows its score and screenshots, and on web, iOS and Android its recording.
- Agents include Claude Code, Codex, GitHub Copilot coding agent, Devin and Amp. See Agents and MCP for setup instructions.
- They connect through the Revyl CLI, MCP server, skills or plugin.

Sources: [Pricing](https://revyl.com/pricing/) · [Proof of changes](https://docs.revyl.com/agents/proof) · [Agents and MCP](https://docs.revyl.com/agents/mcp)

One command installs the Revyl CLI:

```sh
curl -fsSL https://revyl.com/setup | sh
```

[Start free](https://app.revyl.ai/signup) · [Pricing](https://revyl.com/pricing/)

Building agents into your own product? [Integrate Revyl into your agent platform](https://docs.revyl.com/partners).

## Sources

- [ReAct: Synergizing Reasoning and Acting in Language Models (Yao et al., 2022-10-06)](https://arxiv.org/abs/2210.03629)
- [Unrolling the Codex agent loop (OpenAI, 2026-01-23)](https://openai.com/index/unrolling-the-codex-agent-loop/)
