AI Agent Security: From Output Risks to Action Risks

    AI agents shift the security focus from generated content to real-world actions. This article examines how tool access, persistent memory, and autonomous execution expand the attack surface, and explains why least privilege, human approval checkpoints, independent policy enforcement, and runtime auditing are essential to trustworthy agent systems.

    Introduction: When AI Starts Taking Action

    For years, security discussions about large language models have focused primarily on their outputs: whether generated content contains bias, exposes private information, or enables misinformation. These discussions share an implicit assumption: whatever a model generates, a human ultimately takes action and bears the consequences.

    AI agents challenge that assumption. When a system can plan tasks, call tools, maintain memory, and execute autonomously, there may no longer be a human decision point between receiving an instruction and producing a consequence. The risk changes fundamentally. The concern is no longer just what AI says incorrectly, but what it does incorrectly.

    This shift brings a long-overlooked issue into focus: in digital systems, the consequences of an action often depend less on the reasoning component itself than on the permissions architecture surrounding it.

    1. The Shift from Output Risk to Action Risk

    1.1 The Limits of an Output-Centric Approach

    In the first phase of LLM adoption, regulatory and technical governance followed a relatively clear pattern: govern training data sources, require accurate and fair outputs, and establish content moderation and transparency mechanisms. Regulatory frameworks such as the EU AI Act broadly reflect these concerns about AI-generated information.

    The implicit assumption behind an output-centric approach is that AI’s influence stops at the information boundary. A model can influence human judgment, but it cannot directly change the state of a system.

    1.2 Agents Cross the Information Boundary

    Industry descriptions of agentic systems, including those discussed by the Open Worldwide Application Security Project (OWASP), emphasize four capabilities that turn an assistant into an executor:

    • Reasoning and planning: Breaking a goal into tasks and developing a multistep execution path.
    • Tool use: Directly interacting with file systems, browsers, APIs, and databases.
    • Persistent memory: Retaining context and state across sessions to support continuing sequences of actions.
    • Autonomous execution: Operating continuously under predefined conditions without requiring human confirmation at every step.

    Together, these capabilities can turn a hallucination into a real file deletion, an incorrect financial transfer, or an email that sends sensitive data to the wrong recipient. Errors no longer remain in text. They can become irreversible changes to system state.

    2. Permissions Architecture: The Critical Attack Surface

    2.1 Prompts Are No Longer the Only Entry Point

    Traditional application security focuses heavily on input interfaces. Agent architectures substantially expand the attack surface:

    1. Instruction injection: Malicious instructions can appear in anything an agent reads, including web pages, emails, documents, and code comments. If the agent treats retrieved or browsed content as executable instructions, it becomes vulnerable to indirect prompt injection.
    2. Tool-chain abuse: Every available tool—file access, network requests, or command execution—can become an attack lever. An attacker may not need to break into the system directly; inducing the agent to invoke its tools can be enough.
    3. Memory poisoning: False information inserted into long-term memory can influence decisions in later sessions, creating a persistent backdoor.

    2.2 An Illustrative Risk Scenario

    1. # A typical agent tool definition: the risk is overly broad permissions.
    2. tools = [
    3. {"name": "read_file", "scope": "*"}, # Can read any file
    4. {"name": "http_post", "scope": "any_url"}, # Can send data to any external URL
    5. {"name": "exec_shell", "scope": "sandbox"}, # Is the sandbox boundary truly reliable?
    6. ]

    After a successful instruction injection, this combination can enable a complete data-exfiltration path: read a sensitive file, then send its contents through an HTTP request. The model’s reasoning capabilities may be functioning normally; the attacker is exploiting the permissions available behind them.

    This illustrates the central argument: permissions architecture determines the scope of possible consequences, not model behavior alone. Strong capabilities and good alignment do not remove the exposure created by overly broad permissions. Those permissions remain available for an attacker to exploit.

    3. Building Defenses Around Action Risk

    3.1 Applying Least Privilege at Finer Granularity

    For agents, the principle of least privilege requires controls at several levels:

    • Tool-level isolation: Give each agent instance only the tools needed for its task, rather than access to a complete tool pool.
    • Resource-level restrictions: Limit file access to specific directories, network access to allowlisted domains, and database accounts to specific tables and read-only roles.
    • Session-level expiration: Use short-lived tokens for high-risk credentials and revoke them when the task ends.

    3.2 Designing Human Approval Checkpoints

    Not every operation requires human confirmation, but irreversible actions need mandatory checkpoints. An illustrative policy might distinguish between routine access and high-impact operations:

    1. action_policy:
    2. - action: "read_*"
    3. approval: "auto" # Automatically approve read operations
    4. - action: "write_*"
    5. approval: "auto_with_log" # Allow writes with full audit logging
    6. - action: ["delete_*", "transfer_*", "send_external_*"]
    7. approval: "human_in_loop" # Require human approval for irreversible actions

    3.3 Auditing Behavior and Detecting Anomalies

    An action-focused defense also requires visibility into execution:

    • End-to-end action logs: Record each tool call’s inputs, outputs, and triggering reason to create a traceable decision chain.
    • Behavioral baselines: Establish normal patterns for tool-call frequency, access scope, and execution times, then alert on deviations.
    • Validation of both outputs and actions: Place an independent policy engine between model output and execution to check whether proposed actions are permitted, rather than relying on the model to constrain itself.

    3.4 Moving Trust Enforcement Outside the Model

    The core design principle is simple: do not make the model the judge of its own behavior.

    The model reasons, the policy engine authorizes, and the execution layer acts. Separating these three responsibilities means that even if prompt injection fully compromises the model’s behavior, the attacker can reach only the limited set of actions permitted by the policy engine.

    4. How Agent Security Changes Attack and Defense

    Agent security shifts the emphasis from filtering content to controlling behavior, and from protecting the model alone to constraining its permissions. This transition has three implications for practitioners:

    1. Security reviews must cover different components. Reviews should examine not only models and prompts, but also tool inventories, permission scopes, and execution policies. These become essential subjects of application security audits.
    2. Responsibility must be defined across the system. When autonomous execution causes harm, the responsibility chain can involve the model provider, agent developer, permission administrator, and deployment operator. Organizations need to establish these boundaries as part of the system architecture.
    3. Defenses must move from static checks to runtime controls. Static input filtering is no longer sufficient. Action-centered defenses require continuous monitoring, dynamic authorization, and real-time blocking.

    Conclusion

    AI agents do not introduce a mysterious new kind of actor. They make a familiar security problem more urgent: system security ultimately depends on how permissions are assigned, how actions are approved, and how consequences can be traced.

    The more capable a model becomes, the more carefully its surrounding permissions architecture must be designed. For developers, recognizing that relationship is the first step toward building trustworthy agent systems.