Essam ShaabanSr Software Engineer
Agentic AI pattern · Reasoning technique

ReAct (reasoning and acting) pattern

An agent loops through reasoning, acting with a tool and observing the result, deciding each next step until the task is complete.

In plain terms Like a detective: think about the next clue, check it, learn from the result and repeat until the case is solved.

Last reviewed · Build from primitives Agents’ tool-calling loops follow a reason–act–observe cycle; explicit ReAct prompting is custom.

How it works

The agent alternates reasoning, acting with a tool and observing the result, deciding each next step from what it just learned until the task is done.

Workflow: Input, then reason, act using tools, observe the result and check if the task is complete: if not, reason again; if yes, Output.

Roles in the example

  • Nova · ReAct agent Thinks, calls a tool, observes, repeats.

At a glance

Pattern type
Reasoning technique
Execution model
Iterative reason–act–observe loop
Coordination
Single agent with tools
Runs agents in parallel
No, one step at a time
Implementation complexity
Medium
Relative latency
Medium · Grows with the number of tool calls
Relative operational cost
Medium · One agent over several reason–act cycles; tools can add their own cost.
Predictability
Low · Next action depends on each observation
Scalability
Scales per request; bound iterations to control cost.

Complexity, latency, cost and predictability are qualitative ratings that compare these patterns with each other, not measured benchmarks.

When to use it

Good for: Tool-heavy tasks where each step depends on what was just learned.

Use when

  • Tool-heavy tasks where each step depends on the last result
  • Lookup–compute–decide workflows
  • Exploratory troubleshooting

Avoid when

  • The steps are known in advance (use a workflow)
  • Tools have costly or irreversible side effects without approval
  • Strict latency budgets

Enterprise use cases

  • Sales data analysis via APIs
  • IT troubleshooting with diagnostic tools
  • Customer account investigations

Advantages and limitations

Advantages

  • Grounds reasoning in real tool results
  • Handles unexpected intermediate results
  • Transparent step trace

Limitations and trade-offs

  • Can loop or wander
  • Many tool calls raise cost
  • Sensitive to tool descriptions

Security, oversight and failure handling

Security and governance

  • Tool calls are model-generated — validate and authorize them
  • Approval for high-risk tools
  • Treat tool outputs as untrusted input (indirect prompt injection)

Human oversight

Optional. Approval before tool calls that change data; people review reasoning traces when a loop misbehaves.

Failure handling and recovery

  • Maximum iterations per request
  • Handle tool errors as observations, not crashes
  • Return a partial answer with explanation

Implementation guidance

Decisions to settle before building

  • Set a maximum number of reason–act cycles and a timeout for each tool call.
  • Treat tool results as untrusted input: they can carry indirect prompt injection.
  • Require approval for tools that change data or systems.

Supported technologies

TechnologySupportHow
Microsoft Agent FrameworkBuild from primitivesAgent tool-calling loop with iteration limits and tool approval
Microsoft FoundryBuild from primitivesAgent Service agents with tools
Copilot StudioBuild from primitivesGenerative orchestration selects and chains tools

Code samples and step-by-step guides for Python, C#, Microsoft Foundry and Copilot Studio are in the interactive explorer’s Developer implementation section.

Official references

Last reviewed 5 December 2026 against Microsoft Agent Framework (Python 1.26 release line), Microsoft Foundry Agent Service, Copilot Studio. Platforms change often: confirm details in the linked documentation.