What is a ReAct Agent?

2 min read Updated

A ReAct agent follows the Reasoning + Acting paradigm, alternating between thinking steps (reasoning about what to do) and action steps (executing tools or API calls), using observations from actions to inform subsequent reasoning.

WHY IT MATTERS

The ReAct pattern, introduced by Yao et al. in 2022, solved a key limitation of pure reasoning — language models could think about what to do but couldn't verify their reasoning against reality. ReAct interleaves thought and action.

A ReAct agent might think: 'I need to check the current ETH price' → act: call price API → observe: $3,200 → think: 'This is below my buy threshold' → act: execute swap → observe: transaction confirmed. Each observation grounds the next reasoning step.

This think-act-observe loop is now the dominant agent pattern. Most agent frameworks implement some variant of ReAct, whether they call it that or not. It's particularly effective for tasks that require real-world information to make decisions.

HOW POLICYLAYER USES THIS

PolicyLayer intercepts the 'act' phase of ReAct loops when financial actions are involved. The agent can reason freely, but every financial action must pass through policy validation before execution — adding a policy check between 'think' and 'act.'

FREQUENTLY ASKED QUESTIONS

How is ReAct different from chain-of-thought?
Chain-of-thought is pure reasoning — the model thinks step by step but doesn't take actions. ReAct combines reasoning with actions, allowing the model to gather real information and ground its thinking.
Is ReAct the best agent pattern?
It's the most widely used. For simple tasks, a direct function-calling loop may be more efficient. For complex tasks, patterns like plan-and-execute (plan all steps first, then execute) can outperform pure ReAct.
Do modern models need explicit ReAct prompting?
Not always. Modern models (GPT-4o, Claude) naturally interleave reasoning and tool use without explicit ReAct formatting. The pattern is built into their training. But explicit ReAct prompting can still improve performance on complex tasks.

FURTHER READING

Enforce policies on every tool call

Intercept is the open-source MCP proxy that enforces YAML policies on AI agent tool calls. No code changes needed.

npx -y @policylayer/intercept
github.com/policylayer/intercept →
// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.