# AI Agent

An AI agent is a model-centered system that selects and executes actions in a feedback loop to pursue a goal within defined tools, permissions, and stopping conditions.

- Type: framework
- Domain: Engineering & architecture
- Level: Intermediate
- Last reviewed: 2026-09-26
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/ai-agent/>)

## What it means

An AI agent combines a model with instructions, state, tools, and an execution loop. The model observes context, chooses a next action, receives results from the environment, and continues until it finishes, fails, or reaches a stopping condition. This model-directed control distinguishes an agent from a fixed workflow whose steps are determined in code, though products often combine both.

## Why it matters

Agents can handle open-ended tasks whose exact steps are hard to predefine, but model-directed action compounds errors and increases cost, latency, and security exposure. Product design must make scope, progress, permission, review, recovery, and accountability legible.

## When to use it

Use an agent when tasks are multi-step, outcomes are verifiable, tools can be tightly scoped, and flexibility adds measured value over a fixed workflow. Prefer deterministic orchestration for predictable processes, especially when actions are high impact or errors cannot be reversed.

## How it works

1. Define the goal, success evidence, environment, allowed actions, budget, and stopping conditions.
2. Expose narrow, well-described tools with least privilege, typed inputs, and deterministic validation.
3. Let the model choose an action, then execute it in a controlled environment and return the observation.
4. Apply checkpoints, confirmation, monitoring, and limits based on action risk and uncertainty.
5. Verify the final state independently, record the trace, and support cancellation, rollback, and incident review.

## A practical example

A support agent investigates a delivery issue by reading an order and carrier status, then proposes a remedy. It may issue only low-value credits within policy; address changes and refunds require customer confirmation and deterministic authorization, and every tool call appears in an audit trail.

## Where it breaks

Errors can compound across steps, and success may be hard to observe. Agents consume more time and compute than single calls, can be manipulated through tool results or external content, and may act beyond user expectations. Human checkpoints can become rubber stamps.

## Common mistakes

- Calling a fixed prompt or chatbot an agent without a model-directed action loop.
- Giving broad tools or credentials because the model is expected to follow instructions.
- Using autonomy where a short deterministic workflow would be easier to test and trust.
- Showing a completion message without independently checking the environment's final state.

## Visualization

[View the visualization on the website](<https://wiki.soroush.uk/topic/ai-agent/#visualization-ai-agent>)

## Sources

1. [Building Effective Agents](<https://www.anthropic.com/engineering/building-effective-agents>) — Anthropic · Official engineering guidance
2. [ReAct: Synergizing Reasoning and Acting in Language Models](<https://arxiv.org/abs/2210.03629>) — International Conference on Learning Representations · Peer-reviewed research

## Related topics

- [Tool Calling](<https://wiki.soroush.uk/topic/tool-calling/>)
- [Human in the Loop \(HITL\)](<https://wiki.soroush.uk/topic/human-in-the-loop/>)
- [Prompt Injection](<https://wiki.soroush.uk/topic/prompt-injection/>)
