What it is used for

This discussion decides which jobs may be handed to an agent, and under what conditions. For example, an agent that only reads and summarizes documents is far easier to secure than one allowed to reply to customer emails and change sales records.

For ordinary users, this framework helps judge products: a good agent explains the limits of its access, asks approval before important actions, and provides an activity log. For builders, it becomes a checklist to complete before release to real users.

How to use it

Five habits make using an agent far safer. First, give as little access as possible. An agent whose job is summarizing documents does not need access to email or payment data. Second, install human approval gates: actions that are hard to undo, such as sending a message, deleting a file, or making a payment, must stop and wait for your permission.

Third, separate reading from acting. Reading and drafting may proceed on their own; sending, changing, or deleting always passes human eyes. Fourth, limit steps and cost, so a confused agent does not loop without end. Fifth, review its action log regularly, the same way you review a human assistant's work report.

Practitioner level

The signature threat to agents is prompt injection, an attack of hidden instructions: text written by someone else is slipped into content the agent reads, and that text orders the agent beyond your instructions. Anthropic's documentation divides it into two forms. Direct injection comes from a user who deliberately crafts input to break through the application's guardrails. Indirect injection is the more dangerous form for ordinary users: the user is innocent, but third party content the agent processes, such as the body of an incoming email, a web page, a document, or a tool result, contains hidden instructions.

Imagine an agent asked to summarize incoming email. One message contains a hidden sentence ordering the agent to forward your private data to a certain address. An unfenced agent might obey that sentence, because it reads instructions and data in the same form of text. This is why outside content must always be treated as untrusted data, not as commands.

The guardrails Anthropic recommends are layered: untrusted content is delivered only through tool results with its origin stated clearly, a written policy that tool content may never override the user's request, screening of tool outputs before the agent acts on them, and least privilege, meaning the agent holds only the data and actions it genuinely needs.

Expert level

The expert principle behind all these guardrails: model behavior is not a security control. Models are trained to refuse hidden instructions, but that refusal is a probability, not a guarantee. A safe design assumes an injection will succeed one day, then limits what that success can reach: what data the agent can access, what actions it can carry out, and what outbound channels it has.

Advanced practices documented by Anthropic include running tools in isolated sandboxed environments, screening user input and tool outputs with a lightweight model before they reach the main conversation, red teaming your own agent with documents and emails deliberately planted with attacks before release, and continuous monitoring of outputs for signs of a successful injection. Anthropic also recommends such sandbox testing with appropriate guardrails before real use, because autonomy means higher costs and the potential for compounding errors.

Limits and risks

Plainly: no proven method today is immune to prompt injection. Layered guardrails lower the odds and limit damage, but do not remove the risk. The right question is therefore not "is this agent safe", but "for this job, with these guardrails, is the risk reasonable".

Other risks exist beyond attacks. An agent can misunderstand an instruction, choose the wrong tool, or declare the job done when the result is not actually right. Such errors need no attacker; they arise from the nature of the model itself. An agent holding broad access without approval gates combines both risks at once; never use that combination for data or money that matters to you.