What are AI agents, and when should you use one?
Understand the goal, observation, action, and verification loop through a read-only policy comparison with explicit access boundaries and approval gates.

Short answer
An AI agent is a software system that pursues a goal across multiple steps, chooses its next actions, and uses approved tools. It observes intermediate results and adapts its approach. A model, instructions, permissions, guardrails, and exit conditions limit what the agent may do independently.
Contents
- Define an agent by its decisions and actions
- Choose an agent only when the path can vary
- Turn the policy task into a bounded goal
- Grant the minimum tools and permissions
- Follow the observe, act, and verify loop
- Defend the loop against manipulated content
- Keep human approval at policy boundaries
- Decide whether several agents help
- Check the agent before accepting its report
The bounded agent loop
Open each stage to follow a read-only comparison of two workplace policies.
Goal
Define the comparison table, approved documents, required citations, and conditions for stopping.
Observe
Read the two policy files and record the clauses relevant to location, hours, expenses, and approval.
Act
Extract claims into a draft table without changing, sending, or publishing any source file.
Verify
Check every row against a cited clause and hand ambiguous or conflicting language to a person.
You need to compare two workplace policies before a team updates its handbook. One file covers remote work; the other covers hybrid office attendance. The documents use different headings, overlap on expenses, and disagree about who approves exceptions.
This task has a clear output but a variable path. An agent can inspect both files, decide which clauses relate, build a cited comparison, and stop when language conflicts. The safest first version remains read-only and produces a draft for human review.
Define an agent by its decisions and actions
An artificial intelligence (AI) agent receives a goal, observes a state, chooses a next action, uses a tool, and evaluates the result. The loop continues until it reaches success, a limit, a failure, or a human approval boundary. That differs from one model response because later steps depend on earlier observations.
Google's agent glossary describes agentic software as reasoning about input to plan and execute actions on a person's behalf. OpenAI groups the core around a model, tools, and instructions. In practice, permissions, state, guardrails, evidence, and exit conditions make those parts operable.
“Autonomous” does not mean unrestricted. An agent should act only inside the action space you define. For our comparison, that space includes reading two named documents and writing one draft table, not editing policies or emailing employees.
Choose an agent only when the path can vary
Use a fixed workflow when the steps are known in advance. A scheduled export that reads six columns, creates a file, and stores it in one folder does not need a model to choose its path. Code can perform that sequence with lower cost and a smaller failure surface.
The policy comparison contains variable work. The agent must find differently named sections, connect clauses that express similar rules, and notice missing or conflicting information. Its choices remain useful only when each claim can be traced back to the source.
Anthropic distinguishes workflows, where code determines the route, from agents, where a model directs its process and tool use. Begin with the less flexible design that meets the need. Add an agent loop when adaptation produces a result you can verify.
Turn the policy task into a bounded goal
Write the expected artifact before granting tools. Our output is a table with rows for work location, required office days, core hours, equipment, travel expenses, exceptions, and approval. Every cell must cite a page, heading, or stable clause reference.
State what the draft must do when evidence fails. If one policy lacks a rule, write “Not stated” and cite the searched section. If two clauses conflict, quote neither at length; cite both, label the conflict, and request a decision.
The assignment can follow the structure from your first good prompt:
Goal: Compare the approved remote and hybrid work policies.
Inputs: Read only policy-remote.pdf and policy-hybrid.pdf.
Output: A cited table covering seven named policy topics.
Rules: Never edit source files. Do not infer missing policy.
Write only to drafts/policy-comparison.md.
Stop: Ask for review when clauses conflict or a file is unreadable.
Limits: 20 tool calls and no external network access.
The request names data, actions, output, and stop conditions. It also prevents a tidy table from hiding uncertainty.
Grant the minimum tools and permissions
Start with read access to the two files. Grant write access only to the draft path if the agent must save its table. Do not provide broad drive access, messaging tools, policy edit rights, or administrator credentials.
Least privilege limits the cost of a wrong action and the reach of malicious instructions. A policy file could contain text that tells an automated reader to upload documents or ignore prior rules. The agent must treat document contents as data, not as authority to expand its task.
Keep secrets outside the prompt and tool output. If a connector requires credentials, use the platform's protected credential mechanism and scope the account. The model should never need to see a reusable password to compare two files.
Follow the observe, act, and verify loop
On its first observation, the agent inventories both documents and their headings. It then searches for the seven topics and records candidate clauses with source locations. This intermediate evidence should remain available for review.
The action step converts matched clauses into one table row at a time. After each row, verification checks that the wording stays within the cited evidence. A missing citation, unsupported interpretation, or conflict prevents that row from being marked complete.
The agent repeats the loop until all topics have a supported value, an explicit “Not stated,” or a flagged conflict. It then stops and reports the draft path, source coverage, unresolved items, and limits reached. It does not publish the table or change either policy.
Defend the loop against manipulated content
The National Institute of Standards and Technology (NIST) reports indirect prompt injection as an agent security concern. Malicious text can appear inside web pages, email, files, or repositories and attempt to redirect tool use. Strong system instructions help, but technical permissions provide the firmer boundary.
Allow only known file paths and tools. Validate every requested destination outside the model, cap steps and cost, and log tool calls. Require approval for any action that sends, deletes, publishes, pays, changes access, or exposes confidential material.
Guardrails reduce risk without proving safety. A permitted action can still be wrong, and a cited source can still be outdated. Human review remains necessary when the result affects employment rules or other consequential decisions.
Keep human approval at policy boundaries
Suppose one file says managers approve remote-work exceptions while another assigns approval to People Operations. The agent should not select the newer-looking sentence unless you defined a reliable precedence rule. It should cite both clauses and ask an accountable owner to resolve them.
Approval is also required before distributing the comparison. A reviewer should inspect citations, source versions, omissions, and the handling of conflicts. The final publication process should use the organization's normal document controls rather than an agent's broad send permission.
This distinction mirrors responsible vibe coding. The model can perform substantial work, but a person defines correctness and accepts the outcome.
Decide whether several agents help
One agent can compare both policies with fewer handoffs. Splitting extraction and review between two agents may add an independent check, but only when their inputs and outputs are explicit. Two agents sharing one draft can overwrite evidence or reproduce the same mistaken assumption.
If you parallelize, give each agent an isolated artifact. One can extract clauses from the remote policy while another extracts from the hybrid policy. A separate comparison step then joins their cited outputs and flags mismatches.
Do not use multiple agents to compensate for unclear ownership. More roles add cost, context boundaries, and integration work. Start with one bounded run and split only after measuring a specific bottleneck or error pattern.
Check the agent before accepting its report
Use this list for the read-only policy comparison:
- The goal names the seven comparison topics and the required table format.
- Tools can read only the two approved source files and write only one draft.
- Every table value has a source location or an explicit “Not stated” marker.
- Conflicting clauses remain flagged for human approval instead of being resolved silently.
- Tool calls, step limits, cost limits, failures, and final status are visible.
- No source file, permission, message, or published policy changed during the run.
- A responsible policy owner reviews the cited draft before distribution.
An effective agent is a bounded decision loop with observable evidence. The policy example works because read access, output, limits, and approval are explicit. Remove those controls and the same flexible behavior becomes difficult to trust.
Mini quiz
Check the agent boundary
Choose the design that fits a variable research task without granting unnecessary control.
1 / 3
Show solutions
1. Which task most clearly benefits from an agent loop?
Correct answer: Compare changing policy documents, cite clauses, and flag conflicts.
The research path depends on what each document contains and requires observation, adaptation, and verification.
2. Which permission matches the policy comparison?
Correct answer: Read access to the two approved files and write access to one draft location.
Least privilege limits both accidental changes and the impact of manipulated content.
3. The agent finds conflicting eligibility clauses. What should happen?
Correct answer: Cite both clauses, mark the conflict, and request a human decision.
Ambiguous policy meaning is a decision boundary, not a gap the agent should hide or resolve silently.
Sources
- A practical guide to building agentsOpenAI · accessed 2026-07-15
- Building effective agentsAnthropic · accessed 2026-07-15
- Machine Learning Glossary: AgenticGoogle for Developers · accessed 2026-07-15
- Insights into AI Agent Security from a Large-Scale Red-Teaming CompetitionNIST · accessed 2026-07-15
Frequently asked questions
How is an AI agent different from a chatbot?
A chatbot normally returns an answer and waits for another message. An agent can choose a next step, call an approved tool, inspect the result, and continue until it reaches a stopping condition.
Does every agent need persistent memory?
No. Many tasks need only the context of one run. Persistent memory adds freshness, privacy, access, correction, and deletion requirements, so add it only for a defined use case.
Does an agent need internet access?
No. It can work with local files or internal tools. Access should match the goal, and a read-only task should not receive write, send, delete, or publish permissions.
Are several agents better than one?
Not by default. Separate agents help when subtasks are independent and outputs have clear contracts. They also add handoffs, cost, and integration risk.
Which actions need human approval?
Require approval before irreversible, external, sensitive, or financial actions. Examples include publishing, sending, deleting, paying, changing permissions, and exposing confidential data.

