AI agents are moving beyond chat. Instead of simply answering questions, they plan multi-step tasks, call tools and APIs, read and write files, browse the web and act on behalf of users — triaging alerts, updating tickets, writing code, managing cloud resources. That autonomy is what makes them useful, and it is also what makes them a new category of security risk. An agent that can act can be manipulated into acting badly.
What makes an agent different from a chatbot
A conventional language model application takes text in and returns text out; a person decides what to do with the answer. An agent closes that loop. It typically combines:
- A model that reasons about the task and decides on next steps.
- Tools — APIs, code execution, databases, browsers, email — that it can invoke, often through integration standards such as the Model Context Protocol.
- Memory that carries context across steps or sessions.
- Credentials granting access to the systems those tools touch.
Each component expands the attack surface. In effect, the agent becomes a privileged user whose instructions can be influenced by any content it reads.
The key risks
Prompt injection, direct and indirect
Direct prompt injection happens when a user crafts input that overrides the agent's instructions. Indirect prompt injection is more dangerous: malicious instructions are hidden in content the agent processes, such as a web page, an email, a shared document, a code comment or a support ticket. Because the model cannot reliably tell data from instructions, an agent summarising an inbox might obey an embedded command to forward sensitive messages elsewhere. Prompt injection heads the OWASP Top 10 for Large Language Model Applications.
Excessive agency
Agents are often granted far broader permissions than any single task requires: full mailbox access when they only need to read, write access to production when staging would do. When an agent is manipulated, or simply makes a mistake, excessive permissions turn a minor error into a serious incident.
Tool and supply chain compromise
Agents depend on third-party tools, plugins, models and connectors. A malicious or compromised tool can return poisoned results, exfiltrate the data passed to it or perform unexpected actions. Even tool descriptions can carry hidden instructions aimed at the model.
Data leakage
Agents pull information from many sources into a single context. Sensitive data can then leak through responses, logs, calls to external services or memory that persists between users.
Insecure output handling
When agent output flows into other systems — a shell, a database query, a web page — without validation, classic vulnerabilities such as command injection, SQL injection and cross-site scripting reappear in a new form.
Memory and context poisoning
An attacker who can write to an agent's long-term memory or retrieval sources can influence its behaviour long after the original interaction has ended.
Attackers with agents of their own
The same technology helps adversaries automate reconnaissance, produce convincing phishing at scale and adapt exploits faster. Defenders should expect higher volumes of better-crafted social engineering.
Controls that reduce agent risk
| Risk | Practical controls |
|---|---|
| Prompt injection | Treat all external content as untrusted, separate instructions from data, limit which tools can run after untrusted content is read, require confirmation for sensitive actions |
| Excessive agency | Least-privilege, task-scoped credentials; read-only by default; short-lived tokens; allow-lists of permitted actions |
| Tool compromise | Approve and pin tools and connectors, review tool descriptions, run tool execution in sandboxes |
| Data leakage | Data classification, output filtering for sensitive data, restricted outbound destinations, per-user memory isolation |
| Insecure output handling | Validate and encode agent output exactly as you would user input; never pass it unchecked to an interpreter |
| Weak accountability | Log every prompt, tool call, parameter and result; attribute actions to a named human owner; alert on anomalies |
Keep a human in the loop where it matters
Not every action needs approval, but irreversible or high-impact ones should: sending external communications, moving money, deleting data, changing access rights or deploying code. Design approval prompts that show exactly what the agent intends to do and why, so reviewers make an informed decision instead of clicking through.
Test agents like any other application
Include agents in penetration tests and red team exercises. Test for direct and indirect prompt injection, privilege boundaries, data leakage between users and the security of every connected tool. MITRE ATLAS catalogues adversary techniques against AI systems and is a useful starting point for test planning.
Bring agent activity into the SOC
Agent actions should be as visible to security operations as human user activity. Send agent logs to the SIEM, baseline normal behaviour and build detections for unusual tool use, bulk data access or connections to unexpected destinations.
Governance frameworks
Several frameworks help organisations manage AI risk systematically. The NIST AI Risk Management Framework organises activity into four functions: govern, map, measure and manage. ISO/IEC 42001:2023 specifies requirements for an AI management system that can sit alongside an existing ISO/IEC 27001 programme. The OWASP Top 10 for Large Language Model Applications gives developers a focused view of the most important technical risks, and data protection rules such as the UK GDPR still apply whenever agents process personal data.
A starting checklist
- Inventory every AI agent and integration in use, including those adopted informally by individual teams.
- Document each agent's purpose, data access, tools and credentials.
- Reduce permissions to the minimum each task requires.
- Require human approval for high-impact actions.
- Log all agent activity centrally and review it.
- Test agents for prompt injection and privilege abuse before and after deployment.
- Train staff on what agents can, and cannot, be trusted to do.
Used well, AI agents make security teams faster at summarising alerts, enriching investigations and drafting reports. The goal is not to avoid them but to deploy them with the discipline applied to any privileged system. Our red team assessments can bring AI agents and their integrations into scope, and our SOC analyst and blue team course covers monitoring and investigating modern attack techniques.
Get the monthly security briefing
One concise email a month with new threats, practical defences and upcoming courses. No spam — unsubscribe anytime.

