AI Agent Security Controls: From Prompt Injection Defense to Execution Interception

    Prompt injection is only one part of the Agent security problem. This article explains why model-layer defenses cannot provide complete protection, identifies three major sources of Agent risk, and presents a four-layer control model built around the critical point between model output and actual execution. It also outlines how permission modes, policy rules, confirmation workflows, system-level interception, and auditability should work together—and which questions to ask when evaluating an Agent security solution.

    AI Agent Security Controls: From Prompt Injection Defense to Execution Interception

    1. The Classic Review Question—and Why It Misses the Point

    In security reviews for AI office platforms, one question comes up repeatedly:

    How do you prevent prompt injection?

    Most vendors give similar answers: strengthen the system prompt, filter inputs, review outputs, and add a content-safety service as a fallback. This sounds comprehensive, but it actually answers a different question: How do we prevent the model from saying the wrong thing?

    That is not the same as asking how to prevent an Agent from doing the wrong thing. The gap between these two questions is at the heart of Agent security design.

    The key issue is where the control point is placed. If all security defenses are concentrated at the model layer—relying on prompt hardening, input sanitization, and output review to stop attackers from manipulating the model—what remains when the model is persuaded by carefully crafted web content, an email containing hidden instructions, or a multi-turn jailbreak? Many solutions are vague about what happens next.

    A more practical approach starts with a different assumption: the model may be persuaded, but even then, an out-of-bounds operation must be blocked at the moment of execution.

    In other words, hard controls should be placed after model output but before actual execution, rather than relying on the model itself to provide absolute protection. Moving the control point to this stage is not simply a matter of replacing one technology with another. It represents a broader change in security architecture.

    2. Three Sources of Agent Risk—and One Uncomfortable Fact

    To understand why controls need to be enforced after the model generates an action, it is important to distinguish Agent risks from the risks of traditional AI applications.

    Traditional AI applications mainly create the risk of saying the wrong thing: generating inaccurate text or exposing sensitive information from training data, for example. The blast radius is usually limited to a piece of content.

    An Agent introduces the risk of doing the wrong thing: deleting critical files, running dangerous commands, sending credentials outside the organization, or transmitting data to the wrong recipient. The blast radius can expand from a single piece of text to an endpoint and multiple business systems. Many such actions are irreversible: a deleted file is gone, leaked credentials are exposed, and an unauthorized request may already have been sent.

    Agent failures are commonly divided into three categories.

    1. Model hallucinations and misjudgments.
    The model may misunderstand the task or generate incorrect parameters, resulting in an unintended operation. The input to this type of risk originates within the model itself. It can theoretically be reduced through prompt constraints, context management, and improvements in model capability.

    2. External attacks.
    Web pages, documents, and emails may contain hidden instructions. Attackers may also use multi-turn jailbreaks or indirect prompt injection to manipulate the model into executing malicious instructions without recognizing the attacker’s intent. The input in this case comes from outside the model, and the model cannot reliably identify every malicious objective.

    3. Supply-chain risks.
    These include poisoned skills or plugins, vulnerable external protocol services, and untrusted third-party tool integrations. These risks originate in the surrounding ecosystem, and the model has no reliable way to assess them.

    The uncomfortable fact is that only the first category is controlled by the model itself. The other two are supplied by someone else: malicious content from an attacker or a compromised component from the supply chain.

    Even as models become more capable, they cannot fundamentally eliminate threats originating from external content and third-party components. More importantly, an Agent dynamically generates each step of its operation. A rule engine cannot enumerate every possible execution path, which means that trying to block every malicious behavior with predefined rules is inherently impractical in an Agent environment.

    3. A Four-Layer Control Model: Building Hard Boundaries Before Execution

    If the model layer cannot provide complete protection, hard controls must be established at the execution layer. A complete Agent security model usually contains four levels. Together, they operate in the critical window after model output and before actual execution.

    3.1 Permission Modes: Define the Reachable Boundary First

    Permission modes are the first gate. They determine which systems, file paths, and resource types an Agent can access during a specific session or task.

    Common designs include read-only mode, restricted-write mode, and full-access mode. The names vary by platform, but the underlying principle is the same: define the Agent’s operating boundaries before the task begins, rather than waiting until each operation is about to run.

    3.2 Security Center Policies: Coordinating Seven Policy Groups

    A security center typically contains seven groups of core settings:

    • Sensitive path protection
    • File operation rules
    • Command execution policies
    • Network access controls
    • Credential management policies
    • Child-process restrictions
    • Audit and alerting settings

    Together, these settings form a framework for constraining Agent behavior.

    For example, sensitive path protection may cover eight common categories of sensitive locations, including SSH key directories, cloud credential storage, system configuration files, and browser data directories.

    Predefined file operation rules may number in the hundreds, with separate handling for read, write, and delete operations. Reading an SSH key directory might trigger a confirmation prompt. Writing to a system-level configuration file might require explicit user approval. Deletion might be denied or require confirmation by default.

    3.3 Three-State Rules: Allow, Ask, and Deny

    Each operation rule generally has three possible outcomes:

    • Allow: Let the operation proceed immediately.
    • Ask: Request confirmation and let the user decide whether to continue.
    • Deny: Block the operation immediately.

    This three-state design reflects the need to balance efficiency and control. Not every operation needs to be blocked, but not every operation should be allowed automatically either.

    High-risk commands are often configured to require confirmation before execution. Recursive forced deletion and privilege escalation, for example, may trigger a confirmation prompt as soon as they are initiated.

    A blacklist for high-risk programs should also apply to child processes. Otherwise, an Agent could attempt to bypass detection by using an allowed parent process to indirectly invoke a blacklisted program.

    The key principle is:

    Intercept behavior, not just command strings.

    Attackers can evade command-text matching through string concatenation, encoding transformations, or aliases. Behavioral controls are more difficult to bypass through superficial changes. Examples include determining whether an operation is attempting to modify a protected path or write credential contents to an external destination.

    The following example illustrates how such policies might be organized. It is a conceptual structure, not a real product interface:

    1. # Illustrative policy structure (not a real product interface)
    2. security_policy:
    3. sensitive_paths:
    4. - path: "~/.ssh"
    5. operations:
    6. read: ask
    7. write: deny
    8. delete: deny
    9. - path: "/etc/systemd"
    10. operations:
    11. read: allow
    12. write: ask
    13. delete: deny
    14. command_rules:
    15. - pattern_type: "behavior"
    16. behavior: "recursive_force_delete"
    17. action: ask
    18. - pattern_type: "behavior"
    19. behavior: "privilege_escalation"
    20. action: ask
    21. child_process:
    22. inherit_blacklist: true

    3.4 System-Level Interception of High-Risk Operations

    The fourth layer is system-level interception of high-risk operations. It works at the operating-system or runtime level and provides a final fallback below the application layer.

    Examples include monitoring specific system calls, blocking abnormal file-handle operations, and detecting unauthorized outbound network activity in real time.

    This layer ensures that even if an application-level policy is bypassed for some reason, the system can still provide a final point of interception.

    4. Content Review and Execution Control: Two Different Responsibilities

    Content-layer defenses—input filtering, output review, and content-safety services—address the problem of helping the model avoid saying the wrong thing. Their scope is semantic: they identify and filter malicious input and block inappropriate output.

    Preventing harmful actions requires a different control system.

    This distinction is important because content review can be bypassed in many ways, including encoding obfuscation, semantic rewriting, fragmented injection, and multi-turn manipulation. These techniques may evade content review, but they do not automatically bypass a sandbox or execution control.

    The two systems operate at different abstraction layers:

    • Content review makes semantic judgments.
    • Execution control blocks behavior.

    They are complementary rather than interchangeable.

    Another important design principle is that enterprise policy should act as a baseline on the client. Employees may add stricter restrictions, but they should not be able to weaken the enterprise policy.

    Attempts to manually edit local configuration files to reduce the security level should be detected and automatically reverted. This preserves a consistent security baseline and prevents a single misconfigured endpoint from becoming a weak link.

    5. Four Questions to Ask in a Security Review

    Returning to the review meeting: when someone asks, “Can you prevent prompt injection?”, nearly every vendor will answer yes. The question provides little differentiation because few vendors will admit that their product cannot fully stop it.

    More useful questions focus on what happens after injection succeeds.

    Question 1: After a successful injection, what is the maximum scope of access available to the Agent?

    The answer directly reflects the strength of the vendor’s execution-layer controls. If the only response is “we will strengthen input filtering,” the security design is probably still centered on the model layer.

    Question 2: How many confirmation gates are required before a high-risk operation executes?

    The granularity of the confirmation mechanism, the strictness of default policies, and whether operations can be assigned different risk levels help distinguish between a product that merely has security features and one whose security controls are practical to use.

    Question 3: What happens if a local policy is modified or tampered with?

    Client-side tamper protection and policy recovery mechanisms are important tests of whether the security baseline is actually enforceable.

    Question 4: Can the audit log reconstruct the complete decision chain for an operation?

    A complete record—from the model’s generated intent, through policy matching, to the final allow or block decision—is essential for incident investigation and continuous improvement.

    These questions share a common characteristic: they do not ask whether a vendor can prevent every attack. Instead, they ask how many barriers remain when prevention fails.

    A solution that can answer these questions clearly is more likely to have invested in real execution-layer security design.

    6. Conclusion

    The central challenge in Agent security is that models generate actions dynamically, making complete rule coverage impossible. At the same time, external attacks and supply-chain risks are outside the model’s control.

    The practical response is to acknowledge this reality and place hard controls after model output but before actual execution:

    • Use permission modes to define boundaries.
    • Use policy configurations to constrain behavior.
    • Use three-state rules to balance productivity and security.
    • Use system-level interception as the final fallback.

    The value of this approach is not the promise of absolute prevention. It is the ability to ensure that even when prevention fails, the potential damage remains bounded.

    Changing the question in a security review immediately reveals the depth of a solution. Asking “How do you prevent prompt injection?” produces a standard answer. Asking “After a successful injection, what is the maximum scope of access?” reveals how thoroughly the vendor has designed the execution layer.