# What is an AI agent?

An AI agent is a language model run in a loop with tools. It reads a goal, picks a tool, reads the result and goes again until the work is done, so what it does matters as much as what it says.

## How it works

A chatbot answers once. An agent works in steps:

1. It reads the goal and what it has seen so far.
2. It writes a tool call: a search, a shell command, a query, an email.
3. The app around it runs the tool and hands back the result.
4. It reads the result and decides the next step.

The loop ends when the agent says it is done, or when a limit stops it. Memory, a plan and other agents can be added, but the loop with tools is what makes it an agent.

## What changes with agents

- **Actions.** A wrong answer can be ignored. A wrong action has already happened.
- **Untrusted text.** Web pages, files and tool results enter the context, and any of them can carry an [indirect prompt injection](/glossary/indirect-prompt-injection).
- **Length.** A run can take hundreds of steps with no person reading each one.

## What to control

Give the agent no more access than the task needs ([least privilege](/glossary/least-privilege-for-ai-agents)), check each tool call before it runs ([tool call guardrails](/glossary/tool-call-guardrails)), and keep a record of every step ([agent tracing](/glossary/agent-tracing)).

## With White Circle

[Control](/products/control) checks an agent's prompts, replies and tool calls against your policies as they happen, and blocks an unsafe action before it reaches the tool.

