The word agent is now used for almost anything with a language model inside it, from a chat box in the email client to a script that calls a model. That makes it a hard word to base a purchase on. This text is part one of two. It sets out what an agent is, what surrounds the model and where the limits on what the agent may do should sit. Part two covers what separates an agent that works in a demo from one that holds up in production.
1. Agent or workflow
In its guide to how agents are built, Anthropic distinguishes between two kinds of system. In a workflow, the model and the tools are directed through code paths set in advance. In an agent, the model directs its own process and which tools it uses.
Take a supplier invoice. In a workflow the order is fixed: read the amount, look up the supplier, put the case in the approval queue. If the invoice does not fit, the workflow stops, or gets it wrong. An agent is instead given the task of getting the invoice handled correctly, and chooses for itself what it needs to retrieve and in what order. That is why it can cope with things nobody foresaw, such as an invoice in two currencies or an email with three cases in the same thread. For the same reason, it can go wrong in ways nobody has written down.
Anthropic recommends looking for the simplest solution that works and adding complexity only when it is needed. Many workflows manage fine as ordinary workflows in which a model handles one of the steps. We cover how to decide in Most workflows need no AI at all. The rest of this text is about the cases where an agent really is the right choice.
2. What surrounds the model
An agent in production is much more than a model. Around the model there are tools, a framework of ordinary code and a log, and that is where most security decisions end up.
The model is needed for what cannot be written as a rule, such as deciding which case an attachment belongs to, or suggesting the account coding when no rule applies. The rest of the decision logic is ordinary code. Duplicate checks, checking bank accounts against a register, VAT logic and approval rules give the same answer every time and can be tested. The rule of thumb is code where that is enough, a model where one is needed and a human where there is ambiguity, accountability or consequences that cannot be undone.
The tools are what the agent can do in your systems. A good tool does one thing: retrieve a supplier record, create a draft reply, flag a case, put an invoice in the approval queue. OWASP, which publishes a list of security risks in applications built on language models, advises against open-ended tools where possible, such as running a command or fetching any web address. A tool like that gives the agent an open door into the system.
The framework is the code that holds the rest together. In practice the model can only write text. If it wants something to happen, it writes a request: this tool, with these values. The framework receives the request, checks that the tool exists and is allowed in this particular workflow, checks the values, makes the call and passes the response back. A request that is not allowed is stopped there and written to the log.
| The model | The framework | |
|---|---|---|
| Sees | What the framework hands over | The source systems |
| Decides | What should be done next | Whether it may be done |
| Carries out | Nothing | Every call to your systems |
| Knows the permissions | No | Yes |
OWASP writes that the permission checks should sit in the systems that receive the calls, rather than relying on the model to decide whether an action is allowed. In practice that gives two layers: the framework, which rejects calls that are not allowed, and the permissions in your own systems, which mean that a call that is not allowed does not go through anyway.
3. An instruction is not a limit
You can write "never pay an invoice above this amount" in the instruction to the model. That is a wish, and the model can misunderstand it, be talked into ignoring it or simply get it wrong. A limit is something else: a tool that does not exist, a permission that was never granted, a check in the framework that rejects the call.
OWASP calls the risk Excessive Agency and gives three causes: too much functionality, permissions that are too broad and too much autonomy. The countermeasures follow from the causes. The agent gets only the tools the workflow needs. The tools get only the permissions they need, and read permission is often enough. Actions with a large impact are approved by a human before they are carried out.
4. The agent can be tricked by what it reads
First on the OWASP list is prompt injection: input that changes the model's behaviour or responses in a way that was not intended. The indirect variant is the one that affects agents. The model takes in content from an external source, such as a web page or a file, and the content contains text written to be read as an instruction. In a finance workflow the source could just as easily be an attached PDF or the text of an incoming email. The model cannot reliably tell data from commands, and OWASP itself writes that it is unclear whether any method fully prevents prompt injection.
The developer Simon Willison calls the dangerous combination "the lethal trifecta": access to private data, exposure to untrusted content and the ability to communicate externally. If an agent has all three, an attacker can trick it into retrieving private data and sending it to the attacker. Willison's conclusion is that the combination should be avoided entirely. He is sceptical of the filter products sold as protection, because in ordinary web security a safeguard that stops most attacks would count as a failure.
We assume that an agent can be tricked by content it reads. So an agent that has read untrusted text must not be able to trigger payments or pass data on.
In practice this means that the tools for payments and for sending anything out do not exist in that workflow, or that the framework blocks them as soon as untrusted content has come in.
5. The human who approves
It is right for a human to approve a payment before it goes out. That is how an approval policy works, and the agent should fit into it. But the sign-off step is an approval check, not a security control. The approver sees a proposal, often many a day, and a proposal that looks reasonable goes through. A proposal based on a manipulated attachment can look just as reasonable.
Security lies in what the agent is able to do at all: least privilege and no tools it does not need. The approval sits as a layer on top and replaces none of that.
So be sceptical of promises that an agent resists manipulation a certain percentage of the time. A figure like that describes how good a filter is, whereas the limits above hold whatever the agent reads.
6. The log and the law
Everything the agent does must be traceable afterwards. The framework writes an entry for every step: what the agent received, what it retrieved, which tool it requested, whether the request was approved and what happened. When an auditor asks why a particular invoice was coded the way it was, the log provides the answer. It should be kept on your side and be readable without you having to ask the developer for help.
The Swedish Cybersecurity Act (2025:1506) has applied since 15 January 2026 and requires appropriate and proportionate security measures based on risk. Under Chapter 2, Section 3, the measures must cover, among other things, security in the acquisition, development and maintenance of network and information systems (point 5) and personnel security, access control policies and asset management (point 9). An agent that works with permissions in your systems becomes part of those systems. Which tools it has, which permissions they carry and where the block sits are therefore part of your own security work, and cannot be left to the supplier as a technical detail. That applies if you are covered by the Act, and it is a sensible way of working even if you are not. We go through what the Act says about your suppliers in a separate text on the Cybersecurity Act and suppliers.
7. How to start
Choose one workflow and a clearly bounded goal. Give the agent few tools, and read permission where that is enough. It is easier to add a tool to an agent that works than to take one away from an agent that already does too much.
Put the agent in shadow mode first. It runs alongside the existing workflow and makes proposals while your staff work as usual. The difference between the proposals and what was actually done shows where the agent holds up and where it does not. After that it may act, with every action reviewed, and it gets more autonomy step by step.
Build in stops from the start. Anthropic describes agents that pause for human feedback at checkpoints, and stopping conditions such as a maximum number of iterations. Where an error is costly, the checkpoint can come before the first call: the agent writes down what it intends to do, and a human reads it before anything has happened.
8. Questions to ask before you say yes
Seven questions for anyone who wants to build or sell you an agent. Ask to see the answers in the configuration and in the log.
- What is the agent's goal, and which workflow is it limited to?
- What does it read, and which of the sources are untrusted: incoming email, attachments, web pages?
- Which tools does it have, and what does each tool do? Is any of them open-ended, such as running commands or sending email to any recipient?
- Which permissions do the tools carry in your systems, and where are they set? "In the prompt" is the wrong answer.
- Can the agent trigger payments or send data out? If so, does it also read untrusted content in the same workflow?
- Where is the log kept, what does it contain and can you read it yourselves?
- Where are the checkpoints at which a human takes over, and has the agent run in shadow mode before being allowed to act?
If any of them goes unanswered, you do not know what the agent can do in your systems.
Part two, AI agents: beyond the basics, covers what happens when the agent leaves the demo: input checks, defined behaviour on errors, retries, resource limits and the test set that is run on every change.
Sources
- Anthropic, Building effective agents Published 19 December 2024. The sections What are agents? (workflows are directed through predefined code paths, agents direct their own process and tool use), When (and when not) to use agents (the simplest possible solution, more complexity only when needed) and Agents (pausing for human feedback at checkpoints, stopping conditions such as a maximum number of iterations)
- OWASP Top 10 for LLM Applications 2025, LLM06:2025 Excessive Agency The sections Description (the three causes: excessive functionality, excessive permissions, excessive autonomy) and Prevention and Mitigation Strategies (Minimize extensions, Avoid open-ended extensions, Minimize extension permissions with the example of read permission, Require user approval, Complete mediation)
- OWASP Top 10 for LLM Applications 2025, LLM01:2025 Prompt Injection The section Description (the definition, direct and indirect prompt injection, the sentence stating that it is unclear whether there are methods that fully prevent prompt injection)
- Simon Willison, The lethal trifecta for AI agents: private data, untrusted content, and external communication Published 16 June 2025: the three parts, that an attacker can trick the agent into sending private data to them, that the combination should be avoided entirely, and the paragraph on protection products as a failing grade in web security
- Swedish Cybersecurity Act (Cybersäkerhetslag (2025:1506)) Chapter 2, Section 3, first paragraph (appropriate and proportionate security measures) and second paragraph, points 5 (security in the acquisition, development and maintenance of network and information systems) and 9 (personnel security, access control policies and asset management); entry into force 15 January 2026