What happens when the chatbot stops chatting and starts doing? That question drives every conversation about AI agent security risks. A plain language model that writes a bad email is annoying. An AI agent that can read your inbox, query your database, and call an external API is a different kind of problem entirely. It has hands as well as a mouth.
That shift from talking to acting is what makes agent security a distinct discipline rather than a subset of ordinary application security. The risks are real, they are documented, and many of them are surprisingly easy to trigger by accident. This article walks through what actually goes wrong, where the danger comes from, and what tends to work when teams try to lock things down.
What makes an AI agent different from a chatbot
An AI agent is a system that uses a language model to decide on and execute actions, usually by calling tools, APIs, or other software. The model plans; the tools act. That loop is what separates an agent from a simple assistant.
The security consequence is straightforward. Every tool you give an agent is a new entry point, and every piece of text the agent reads can become input to its decision-making. A web page, an email, a PDF, a calendar invite, a code comment: all of it can influence what the agent does next.
There is no single agreed definition of an agent across standards bodies, which complicates risk assessment. But most working definitions share three traits: autonomy, tool access, and the ability to chain multiple steps without a human approving each one. Each trait adds risk surface.
Prompt injection: the risk that refuses to go away

If you read only one thing about agent security, make it prompt injection. The Open Worldwide Application Security Project ranks it as the top risk for large language model applications, describing how crafted input can override a model’s instructions. The OWASP entry on prompt injection explains the mechanism and why it sits at number one.
The direct version is obvious enough: a user types “ignore your rules and do X.” The indirect version is where agents get into trouble. In indirect prompt injection, malicious instructions hide in content the agent processes on its own. A 2023 paper by Greshake and colleagues documented how indirect prompt injection can compromise real-world LLM-integrated applications, including data exfiltration through tool calls.
Picture an agent that summarizes incoming email. A stranger sends a message containing hidden text instructing the agent to forward the last ten emails to an outside address. The user never typed anything malicious. The agent simply did what the content told it to do.
This is the core lesson: for an agent, data is instruction. Any text it reads can function as a command. That inverts a foundational assumption of traditional security, where data and code live in separate lanes.
Excessive agency: when the agent has too much power
The second big category is excessive agency. This covers what happens when an agent gets more permissions, more tools, or more autonomy than its job requires. It appears in the OWASP Top 10 for LLM Applications as a named risk category, and the full OWASP Top 10 for LLM applications shows how it sits alongside related concerns like supply chain and insecure plugin design.
The pattern is painfully common in practice. A team builds an agent to answer questions about support tickets. To make it useful, someone grants it database write access. Then it gets access to the billing system. Then someone connects it to the deployment pipeline because it seemed convenient. Six months later, a helpful assistant has the effective privileges of a junior administrator with no supervision.
A useful discipline here is asking, for every tool and permission: what is the worst thing this agent could do with it, and would a human in that role be allowed to do the same? Most agents fail that second question badly.
The supply chain problem hiding in your tool list
Agents rarely operate alone. They call third-party APIs, use plugins, and pull in libraries and model providers. Each of those is a supply chain dependency, and each one can fail or be compromised.
OWASP names supply chain risk and insecure plugin design as separate categories for good reason. An agent’s security posture is only as strong as the weakest tool it can reach. A plugin with sloppy input validation becomes the agent’s problem, because the agent is the thing feeding it data.
Practical teams tend to underestimate this. They audit the model, harden the prompt, and then connect a community plugin that was last updated two years ago. The tool list deserves the same scrutiny as any third-party dependency in a software bill of materials.
Frameworks worth knowing: NIST, MITRE, and the EU AI Act
Several formal references give structure to what can otherwise feel like an endless list of hypotheticals.
The NIST AI Risk Management Framework is a voluntary framework released in January 2023, with a Generative AI Profile added in July 2024. It organizes risk work around govern, map, measure, and manage. The NIST AI Risk Management Framework hub links both documents. Because it is voluntary, it functions as a shared vocabulary rather than a compliance checklist.
MITRE ATLAS takes a different approach. It is a knowledge base of adversarial tactics and techniques against AI systems, modeled on the familiar ATT&CK framework. The MITRE ATLAS knowledge base catalogs techniques including prompt injection and model manipulation, and it is updated continuously. For threat modeling, it is arguably the most directly useful resource available.
Then there is regulation. The EU AI Act entered into force on 1 August 2024, with general-purpose AI rules applying from 2 August 2025 and most high-risk obligations from 2 August 2026. The official text of the EU AI Act sets out the risk tiers. Whether a specific agent counts as high-risk depends entirely on its use case, so blanket answers are unwise. An agent summarizing public documents and an agent screening job applicants sit in very different places.
Guidance also exists on the engineering side. The UK’s National Cyber Security Centre and US CISA co-sealed guidelines for secure AI system development in November 2023, covering secure design, development, deployment, and operation. The NCSC guidelines for secure AI system development are worth reading in full if you build these systems.
| Framework | Type | Best used for |
|---|---|---|
| NIST AI RMF | Voluntary framework | Organizing risk work and shared vocabulary |
| MITRE ATLAS | Threat knowledge base | Threat modeling specific techniques |
| OWASP LLM Top 10 | Risk catalog | Prioritizing common failure modes |
| EU AI Act | Regulation | Legal obligations by risk tier |
| NCSC/CISA guidelines | Engineering guidance | Secure design and operations |
Practical controls that actually help
No single control eliminates agent risk. What works is layers, applied with a bias toward limiting blast radius.
Start with least privilege
Give the agent the minimum permissions its task requires, and nothing more. Read-only where possible. Scoped credentials rather than broad ones. Separate identities per agent rather than a shared service account. A useful walkthrough of this approach is available in this guide to giving an AI agent the minimum permissions it needs, which covers how to scope access without breaking functionality.
Test before you grant write access
Read access can leak data. Write access can change the world. Teams routinely grant write permissions before testing how the agent behaves under adversarial input. A structured approach to testing AI agents before granting write access helps catch the cases where an agent does something unexpected under pressure.
Treat all external content as hostile
Anything the agent reads from outside your trust boundary should be treated as potentially adversarial. That means emails, web pages, documents, issue trackers, and API responses. Strip or neutralize embedded instructions where you can. More importantly, design so that a hijacked agent cannot do much damage.
Require human approval for irreversible actions
Sending money, deleting records, deploying code, emailing customers. These deserve a confirmation step. It is slower, and product teams will push back, but the alternative is an agent that can cause irreversible harm at machine speed.
Log everything and watch for drift
Agents behave differently over time as prompts, tools, and models change. Log tool calls with enough context to reconstruct what happened. Watch for unusual call patterns, unexpected destinations, and sudden spikes in activity.
Common mistakes teams make
A few failure patterns show up again and again.
Confusing a system prompt with a security boundary. Instructions in a prompt are suggestions to a model, not enforcement. If the only thing stopping an agent from deleting a database is a sentence telling it not to, you do not have a control. You have a hope.
Granting broad credentials because scoping is tedious. This is the single most common shortcut, and it is the one that turns a minor prompt injection into a serious incident.
Skipping the tool inventory. Teams often cannot list every tool their agent can call. If you cannot enumerate them, you cannot assess them.
Assuming vendor guardrails are sufficient. Model providers add safety layers, and they help. They are not a substitute for your own authorization design.
Forgetting the humans. An agent that summarizes alerts can be manipulated into hiding one. The people reading its output need to know it can be wrong or steered.
Getting the organizational side right
Technical controls fail when nobody owns them. Someone needs to hold the agent inventory, review new tool grants, and decide which use cases require escalation. That is a governance question as much as an engineering one.
Security teams also need the right skills. Agent security blends application security, identity management, and machine learning knowledge in ways that traditional role descriptions do not capture. A useful reference for hiring and team design is this breakdown of what to look for in an AI security role description, which covers the mix of skills that actually matters.
Broader coverage of enterprise agent and cloud security topics lives in this enterprise AI and cloud security resource, and teams preparing to brief leadership may find this example of what an enterprise security advisory should tell you useful for structuring the message. Additional material sits in the security category archive.
Conclusion
AI agent security risks are not exotic. They are the familiar problems of over-permissioned accounts, untrusted input, and weak supply chain oversight, arriving at machine speed and with a natural-language interface. Prompt injection can turn ordinary text into a command. Excessive agency turns a small mistake into a large one. Supply chain gaps turn someone else’s bug into your incident.
The good news is that the defenses are largely known. Least privilege, scoped credentials, human approval for irreversible actions, careful testing before write access, and honest logging cover most of the ground. Frameworks like NIST’s AI RMF and MITRE ATLAS give you vocabulary and structure. Regulation raises the stakes in some jurisdictions, but it does not change the fundamentals.
The teams that handle this well share a habit: they assume the agent will be fooled, and they design so that being fooled is survivable. That mindset, more than any single tool, is what separates a safe deployment from a cautionary tale.
Frequently asked questions
What is prompt injection in simple terms?
Prompt injection is when text fed to an AI system is crafted to make it ignore its original instructions and follow the attacker’s instead. In agents it gets worse, because the injected text can trigger real actions like sending data or calling tools. The input does not have to come from the user; it can hide in an email, web page, or document the agent reads.
Can’t I just write a stronger system prompt to stop attacks?
No. A system prompt is an instruction to a model, not an enforcement mechanism. Models can be persuaded to depart from instructions, especially when processing untrusted content. Real protection comes from limiting what the agent is technically able to do, not from asking it nicely to behave.
What is excessive agency?
Excessive agency is when an AI system is given more permissions, tools, or autonomy than its task requires. It is a named risk category in the OWASP Top 10 for LLM applications. The fix is least privilege: grant only the access needed, scope credentials tightly, and require human approval for irreversible actions.
Do AI agents fall under the EU AI Act?
Sometimes. The EU AI Act, in force since 1 August 2024, sets obligations by risk tier rather than by technology type. An agent used for a high-risk purpose, such as employment screening or critical infrastructure, faces stricter requirements than one summarizing public documents. The use case determines the answer, not the label “agent.”
How do I test an agent before letting it write to systems?
Start in a sandbox with realistic but fake data, then try to break it deliberately. Feed it documents containing hidden instructions. Attempt to make it call tools it should not reach. Log every tool call and review the results. Only grant write access once you have seen how it fails and how it succeeds.
Is open-source agent tooling riskier than commercial tooling?
Not automatically. The real question is how well the tooling is maintained, whether it validates inputs, and how much access it demands. A well-audited open-source plugin can be safer than a closed commercial one with broad permissions. Treat every tool as a supply chain dependency and assess it on evidence rather than licensing model.







