# What does "Max turns (10) exceeded" mean in an agent run?

In the OpenAI Agents SDK, "Max turns (10) exceeded" means the run used up its allowed turns, each one an LLM call, without the agent producing a final output, and the SDK raised `MaxTurnsExceeded`. The default is 10 and the number in the message is whatever `max_turns` was set to.

A turn that calls a tool or hands off leads to another turn, so a run that never produces a final answer continues until the cap stops it. [The SDK docs](https://openai.github.io/openai-agents-python/running_agents/) let you pass a larger `max_turns`, pass `None` to remove the limit, or register an `error_handlers` entry for `max_turns` that returns a fallback output instead of raising.

Read the trace before changing any of them. Ten turns of the same tool call is a loop, and a larger cap just runs it longer; [an agent that loops](/answers/failure-modes/why-does-an-agent-get-stuck-in-a-loop) needs a bound outside the model's judgment. Passing `None` removes the turn limit, so nothing in this setting stops a loop.

A handler that returns a fallback makes the run look like a normal completion, so count how often it fires.

---

Published: 2026-11-18

Sources:
- OpenAI Agents SDK docs: Running agents: https://openai.github.io/openai-agents-python/running_agents/ (fetched 2026-11-18)
- OpenAI Agents SDK source: DEFAULT_MAX_TURNS: https://github.com/openai/openai-agents-python/blob/main/src/agents/run_config.py (fetched 2026-11-18)
- OpenAI Agents SDK source: MaxTurnsExceeded message: https://github.com/openai/openai-agents-python/blob/main/src/agents/run_internal/run_loop.py (fetched 2026-11-18)

Source: https://tessary.ai/answers/agent-error-messages/what-does-max-turns-exceeded-mean-in-the-openai-agents-sdk
More on Agent error messages: https://tessary.ai/answers/agent-error-messages
From Tessary, agent reliability for AI agents in production: https://tessary.ai
