DEV Community

Cover image for The Hidden Dangers of AI Agents: Why Businesses Need Stronger Security in 2026
Aasim Ghaffar
Aasim Ghaffar

Posted on

The Hidden Dangers of AI Agents: Why Businesses Need Stronger Security in 2026

The Hidden Dangers of AI Agents: Why Businesses Need Stronger Security in 2026

AI agents are rapidly evolving from tools that generate text into systems that can browse websites, access corporate data, call APIs, write code, and perform actions with limited human intervention.

Gartner projected that 40% of enterprise applications would feature task-specific AI agents by the end of 2026, up from less than 5% in 2025. McKinsey's research has also highlighted the growing adoption of AI agents and the security challenges organisations face as they scale their use.

The problem is straightforward: when an AI system can take action, a manipulated output is no longer just a bad answer. It can become a data breach, an unauthorised email, a database deletion, or a production system failure.

For businesses, AI agent security must increasingly resemble privileged-access security. This means applying least privilege, execution isolation, strong authentication, independent policy enforcement, detailed audit trails, and human approval for consequential actions.

Introduction: Why AI Agents Change the Security Landscape

Traditional generative AI systems primarily produce information. AI agents connect that intelligence to tools and business systems.

An enterprise agent might read Outlook emails, search SharePoint documents, update Salesforce records, execute code, and communicate with external services during a single workflow.

This combination of untrusted information, access to sensitive data, and permission to act creates a significantly larger attack surface.

Security researchers and AI providers have warned that malicious instructions embedded in webpages, emails, documents, or images can manipulate agents into performing unintended actions.

Imagine an AI agent instructed to summarise an email. The email contains hidden instructions telling the agent to forward confidential documents to an external address.

The agent should treat those instructions as untrusted content, not as commands. However, if the system lacks appropriate safeguards, it may follow the malicious instructions.

This is known as indirect prompt injection, and it represents one of the most important security challenges facing tool-enabled AI systems.

Where AI Agents Are Vulnerable

Prompt injection is a major threat, but it is only one part of the problem.

AI agents can also be exposed to excessive permissions, compromised integrations, poisoned retrieval data, credential leakage, unsafe code execution, and manipulation between interconnected agents.

Here are five important attack vectors businesses should understand.

1. Indirect Prompt Injection

Attackers hide malicious instructions inside webpages, emails, documents, images, or tool responses.

When an agent processes that content, it may interpret the embedded instructions as legitimate commands.

Potential impact: Confidential information exposure, unauthorised actions, and manipulation of business workflows.

Mitigation: Separate instructions from untrusted content, restrict tool permissions, validate actions independently, and require approval for sensitive operations.

2. Excessive Tool Permissions

An AI agent may receive broader access than its task requires.

For example, an agent designed to summarise customer records might also have permission to delete records, export databases, or modify account permissions.

If the agent is compromised, those additional privileges increase the potential damage.

Potential impact: A small vulnerability can become a much larger security incident.

Mitigation: Apply the principle of least privilege. Give every agent only the permissions necessary for its defined responsibilities.

3. Malicious or Compromised Tools

AI agents frequently depend on external APIs, connectors, plugins, and Model Context Protocol (MCP) servers.

If a connected tool is compromised or returns malicious content, it may influence the agent's subsequent decisions. An integration with excessive permissions can also expose credentials or sensitive information.

Potential impact: Unauthorised data access, unsafe code execution, and compromise of connected systems.

Mitigation: Verify tool identities, maintain allow-lists, restrict network access, validate tool responses, and isolate execution environments.

4. Poisoned Memory and Retrieval Data

Many agents use retrieval-augmented generation (RAG), memory stores, or document repositories to obtain additional context.

If attackers manipulate those sources, malicious information may influence future responses or actions.

Potential impact: Persistent misinformation, unauthorised recommendations, or repeated unsafe behaviour.

Mitigation: Validate data provenance, restrict who can modify trusted knowledge sources, monitor changes, and maintain clear boundaries between trusted instructions and retrieved content.

5. Agent-to-Agent Manipulation

Some enterprise systems use multiple agents that collaborate on complex tasks.

One agent might gather information, another might analyse it, and a third might execute an action.

If one agent is compromised or produces manipulated output, other agents may act on that information without independently verifying it.

Potential impact: Cascading failures across multiple systems and workflows.

Mitigation: Give each agent a separate identity, enforce independent authorisation checks, validate outputs between stages, and monitor interactions across the entire workflow.

AI Agent Security Risks at a Glance

Attack vector Potential impact Primary mitigation
Indirect prompt injection Data leakage or unauthorised actions Content isolation and approval gates
Excessive permissions Large compromise blast radius Least privilege and scoped credentials
Compromised tools Credential theft or unsafe execution Tool verification and sandboxing
Poisoned retrieval data Persistent manipulation Provenance checks and trusted-data boundaries
Agent-to-agent manipulation Cascading failures Independent identities and policy enforcement

The key lesson: the AI model should never be the only security boundary.

Even a highly capable model can encounter malicious content. Security must remain effective when the model makes a mistake or is successfully manipulated.

Real-World Warning Signs and Security Incidents

Security concerns around AI agents are no longer limited to theoretical research.

Research demonstrates prompt-injection risks

In 2024, research projects such as InjecAgent and AgentDojo demonstrated how indirect prompt injection could manipulate tool-enabled AI agents in experimental environments.

InjecAgent evaluated 1,054 indirect prompt-injection cases, while AgentDojo introduced a benchmark containing hundreds of security test cases across realistic tasks involving banking, messaging, travel, and workplace tools.

These studies illustrate why traditional testing alone is insufficient for agentic systems.

However, experimental attack success rates should not be interpreted as estimates of the probability that a production enterprise agent will be compromised. Results depend on the model, tools, attack scenarios, and defensive controls being evaluated.

Microsoft 365 Copilot and EchoLeak

In 2025, Microsoft addressed EchoLeak, tracked as CVE-2025-32711. The vulnerability demonstrated how a specially crafted email could potentially manipulate Microsoft 365 Copilot into disclosing information accessible within the victim's environment under particular conditions.

The incident highlighted the importance of considering how agents process untrusted communications alongside their access to corporate information.

Coding agents and operational failures

Reports about AI coding agents have also raised concerns about destructive operations, insufficient safeguards, and failures to respect operational constraints.

An agent with access to production infrastructure can potentially make changes much faster than a human operator can review them.

This is why production access, database deletion, deployment permissions, and other high-impact capabilities should be protected by controls that operate independently of the model.

AI-assisted cyber operations

Security researchers have also reported campaigns in which attackers used AI capabilities to automate or accelerate parts of cyber operations.

This creates a dual risk: attackers may target AI agents to compromise organisations, while also using their own agents to increase the speed and scale of attacks.

The takeaway is that organisations must defend both the AI systems they deploy and the wider infrastructure those systems can access.

Why AI Agent Security Is a Business Risk

For business leaders, AI security is not simply a model-quality problem. It is a question of operational control.

Consider a few examples:

  • Sales: An over-permissioned agent could expose customer information or send unauthorised communications.
  • Software engineering: A coding agent with production credentials could modify critical infrastructure or delete data.
  • Finance: An agent might initiate an incorrect transaction or change financial records.
  • Human resources: An agent could disclose confidential employee information.
  • Customer service: An agent could modify account details or issue refunds without appropriate authorisation.

Because agents can perform multi-step workflows, one compromised decision can propagate across connected systems before a human notices.

Organisations therefore need to evaluate agents based not only on what they can do, but also on what they are authorised to do.

Regulatory and Governance Considerations

Regulatory requirements and security guidance increasingly emphasise risk management, accountability, cybersecurity, and appropriate human oversight for AI systems.

The EU AI Act has a phased application schedule, with different obligations applying at different times depending on the provision and system involved. Organisations should verify the requirements relevant to their specific use cases rather than assume every AI agent is subject to identical obligations.

Cybersecurity guidance from bodies such as the UK National Cyber Security Centre and the National Institute of Standards and Technology also reinforces the importance of managing AI risks throughout a system's lifecycle.

However, compliance documentation alone does not make an AI agent secure.

An organisation can maintain policies and complete risk assessments while still operating an agent with dangerously broad credentials or insufficient safeguards.

Effective governance must be reflected in the technical architecture, permissions, monitoring, and approval processes.

How Businesses Can Secure AI Agents

The strongest approach is defence in depth: multiple independent controls that continue to protect the organisation even if one safeguard fails.

1. Treat Every Agent as a Privileged Digital Identity

Give every agent a unique identity and narrowly scoped permissions.

Use short-lived credentials where possible, restrict access to sensitive resources, and separate read permissions from write permissions.

For example, an agent that summarises emails should not automatically have permission to send them. An agent that reviews code should not automatically have production deployment rights.

2. Separate Data Access from Action Authority

Reading information and acting on that information are different capabilities.

A customer-service agent may need to view an order to answer a question. It may not need permission to issue refunds, change account ownership, or delete customer records.

High-impact operations should pass through deterministic policy checks outside the language model.

Examples include:

  • Financial transfers and payments.
  • Deletion of records or databases.
  • Credential and permission changes.
  • Production deployments.
  • Bulk communications.
  • Transfers of confidential information.

Never rely solely on the model's own judgement to authorise a high-impact action.

3. Sandbox Agent Execution

Agents that execute code, browse websites, or interact with external tools should operate within appropriately restricted environments.

Sandboxing can limit filesystem access, network connectivity, executable permissions, and access to sensitive credentials.

This reduces the potential damage if an agent encounters malicious instructions or executes unsafe code.

4. Maintain Independent Audit Logs

Security teams need reliable records of agent activity.

Logs should capture relevant information such as:

  • The identity used by the agent.
  • Tools and connectors invoked.
  • Resources accessed.
  • Actions attempted and completed.
  • Policy decisions and approval events.
  • Errors, unusual behaviour, and security alerts.

Where appropriate, protect logs against tampering and restrict access to them.

An agent's own explanation of what happened is not a substitute for an independent audit trail.

5. Red-Team the Entire Workflow

Testing the underlying model is not enough. Security teams must test the complete system, including its tools, permissions, retrieval sources, and connected applications.

Useful scenarios include:

  • A malicious instruction embedded in an email.
  • A webpage attempting to extract confidential information.
  • A poisoned document in a retrieval database.
  • A tool returning manipulated content.
  • An agent attempting an unauthorised action.
  • Multiple agents passing unsafe instructions between one another.

Repeat these tests whenever models, tools, permissions, connectors, or workflows change.

6. Keep Human Approval for Consequential Actions

Human oversight should focus on actions with meaningful financial, operational, legal, or privacy consequences.

Approval processes should provide enough context for a reviewer to understand what the agent intends to do, which resources it will affect, and why the action is being requested.

A confirmation button alone is not sufficient if the reviewer cannot assess the consequences.

The goal is to combine automation with meaningful accountability, rather than require manual approval for every harmless operation.

Conclusion: Design AI Agents for the Possibility of Compromise

AI agents can deliver substantial productivity gains precisely because they can access tools, coordinate workflows, and take action.

That same capability creates their greatest security risk.

No credible security strategy should assume that a model will resist every prompt injection, identify every malicious document, or make the correct decision in every situation.

Instead, organisations should ask a more practical question:

If an AI agent is manipulated tomorrow, how much damage could it actually cause?

The safest deployments are designed with that possibility in mind. They restrict authority, isolate execution, enforce policies independently, monitor activity continuously, and require meaningful human oversight for consequential actions.

In 2026, secure AI adoption is not about trusting a model to behave perfectly. It is about building systems that remain safe when the model makes a mistake.


Top comments (0)