AI agents are reasoning systems that are granted access to emails, cloud storage, and internal tools to execute tasks or achieve certain goals. That autonomy and ability to act is precisely what drives organizations to deploy AI agents, but it also represents the source of new security risks: their logs can show an authorized system executing apparently legitimate actions, even when it deviates from its original purpose.

“An agent stays aligned with your intent as long as they correctly interpret your request at every step. However, that interpretation can fail in three ways: the agent can make a mistake, lose sight of the intent in the middle of a workflow, or let an indirect prompt injection override it. In all three cases, whether or not there is an attacker behind it, the agent continues working with legitimate access and its activity appears normal in the logs,” explain the researchers at Proofpoint, a company specialized in cybersecurity focused on people and AI agents.

With these valid permissions, AI agents can perform actions that the user has never requested or exceed the limits of the task assigned to them. This behavior is known as semantic escalation of privilege. The problem is that traditional security controls are not designed to identify these types of deviations, since once trust is granted to an agent, it is usually maintained until it is revoked.

Protection systems against internal threats usually detect activities that deviate from a previously established pattern of behavior. However, AI agents can deviate from their mission without their actions appearing anomalous. “An agent can deviate from the user’s intention after a single compaction of the context window or a single iteration of its reasoning cycle, even if the actions appear to be typical of the job for which it was deployed,” the experts warn.

Instruction injection, a means of attack

An attacker does not need to have credentials or prior network access to manipulate an AI agent: they simply need to find a way to enter text that can be interpreted as an instruction. For example, through public data collection forms on web pages, which accept content sent by any Internet user, agents can process hidden instructions in these fields and end up transmitting information to a domain controlled by an attacker.

In another case investigated, a single line of instructions injected into a form could prompt an agent to collect all the records it found and email the information to the attacker. These scenarios show how AI agents can become a means of data exposure if their behavior is not adequately monitored and the scope of their actions is not controlled.

How to detect and stop malicious AI agents

To identify possible malicious behavior or deviations from AI agents, security teams need to contrast the actions they execute with the mission assigned to them. In the case of intelligent assistants, this verification must be carried out at each step and in real time, preventing an out-of-context action from triggering consequences before being detected.

“These checks must also be automated, because a single request can trigger dozens of actions, many more than a security team can review manually,” they argue from Proofpoint.

Currently, there are cybersecurity tools designed to monitor AI agents that compare each action with three criteria: the user’s request, the purpose for which the agent has been deployed, and the policies established by the organization. From the beginning of the workflow, a model specifically designed for this task can evaluate every tool call, every data access, and every interaction with a large language model (LLM) based on its purpose.

To carry out these checks, factors such as the type of action, the information involved, the sequence of previous actions and the planned workflow are taken into account. This way, organizations can better monitor the behavior of their AI agents and detect potential deviations before they compromise critical information or processes.

When an action fails any of these checks, it can be blocked in real time, flagged for human review, or logged for further analysis. As for best practices for businesses, Proofpoint recommends progressively moving forward with monitoring and controlling AI agents: “Organizations typically start in visibility mode, move into detection mode as their policies mature, and enable real-time policy enforcement for workflows involving sensitive data or irreversible operations.”