Illustration of a computer with code blocks, test cards and review instruments.
Fundamentos5 min read

AI agents: how to define goals, tools and limits

To set limits for AI agents, describe a verifiable result, the necessary tools and stopping conditions. “Handle everything” gives less direction than a goal with an observable deliverable.

In this tutorial, the example is preparing a summary of three authorized internal documents. The agent should compare information, highlight differences and deliver a draft for reading.

1. Check whether you need an agent

The Anthropic analysis of effective agents distinguishes defined workflows from agents choosing their next steps. That distinction helps avoid configuring something more complex than the task needs.

If the same three documents always follow the same stages, a fixed process may suffice. Reserve autonomy for decisions that genuinely depend on material found during the work.

2. State the result concretely

Define what the person will receive: a discrepancy table and a summary referencing the documents. State the audience and detail level needed to use the delivery.

Add a success condition, such as identifying which file supports each claim. This gives the agent a way to assess completeness without inventing information to fill gaps.

3. Separate reading from acting

List which tools are needed and why. Reading documents, editing a draft and sending that draft to someone are different actions.

Capability Use in this example
Read authorized files Find evidence in the three documents
Write a draft Organize the summary and discrepancies
Publish or send Outside this example’s goal
Find additional material Only with defined scope for doing so

This separation makes configuration easier to understand. A prompt restriction should match the permissions actually provided by the environment.

4. Define when to stop

Specify what happens if a file is missing, information conflicts or a tool fails. Stopping with the gap identified can be more useful than repeating the same attempt indefinitely.

You can also set a step limit appropriate to the task. Treat the number as a configuration choice to revise in practice rather than a quality guarantee.

5. Assemble the work instruction

Goal: compare the three attached authorized documents.
Delivery: summary of up to 300 words and a discrepancy table.
Evidence: link each conclusion to its corresponding document.
Tools: read the files and write the local draft.
Limits: do not send messages or inspect other folders.
Stop if a document is missing or a source does not support a claim.
At the end, list what remains unanswered.

This example is a task specification rather than a promise that every tool automatically enforces these permissions. Check the configuration available in your chosen product.

6. Assess a small first run

Compare the delivery with the documents and note where the instruction was ambiguous. Adjust the goal or tool according to the observed problem instead of adding rules without a diagnosis.

For agents changing code, also use the AI code change review guide. The final delivery should show the result, evidence and outstanding issues that still matter.

Frequently asked questions

How should I define a goal for an AI agent?

Describe the expected result and how it will be checked. Include available inputs, the delivery format and situations in which the agent should stop.

Does every task require an autonomous agent?

No. A fixed sequence of steps or a single response may solve simple tasks with less configuration.

How should I choose an agent’s tools?

Start with the capabilities required for the task and distinguish reading, editing and external actions. Provide only what the workflow needs.