Rebuilding Security Rules for the AI Agent Era: From Model Output to Action Chains

    This article examines how AI agents shift security risks from what a model says to what it actually does. It explains how excessive permissions, tool-chain amplification, memory poisoning, prompt injection, and unbounded autonomous loops combine into action-level risk, then presents a defense framework built on least privilege, short-lived credentials, Policy-as-Code checks, sandboxing, data trust levels, full-chain auditing, and emergency circuit breakers. A phased rollout path is also outlined for moving from control to observability to limited autonomy.

    Rebuilding Security Rules for the AI Agent Era: From Model Output to Action Chains

    The emergence of AI agents did not create a mysterious new entity out of nowhere. It works more like a mirror, reflecting a fact that has long been underestimated in digital systems: what truly determines the consequences of behavior is often not what the model itself “figured out,” but the permission structure, tool channels, and execution boundaries built around the model. As systems evolve from “giving advice” to “taking action directly,” the focus of security discussions must shift from output content to action chains.

    1. The Shifting Risk Focus: From “Saying the Wrong Thing” to “Doing the Wrong Thing”

    Over the past few years, security discussions around large models have mostly centered on the output layer: whether training data is compliant, whether generated content carries bias, how to identify misinformation, and whether answers are explainable. These questions remain important, but they share an implicit assumption—the model is only responsible for producing information, while whether to adopt it and how to execute it is still gated by humans.

    This assumption is failing. A new generation of agent systems typically has four types of capabilities:

    • Reasoning and planning: breaking high-level goals into executable steps;
    • Tool invocation: reading and writing files, operating browsers, accessing APIs, and triggering workflows;
    • Memory persistence: saving context, state, and intermediate results across sessions;
    • Autonomous execution: running continuously under predefined conditions with reduced human confirmation.

    When these four capabilities are combined, the human buffer between “receiving an instruction” and “producing a consequence” is greatly compressed. Output risk affects cognition and judgment, while action risk affects data, funds, system state, and business continuity. Therefore, the core question of agent security is no longer “will it say something wrong,” but “can it execute the wrong action, at the wrong time, with the wrong permissions.”

    2. How Action Risk Is “Assembled”

    Action risk is usually not a single-point vulnerability, but an emergent result of multiple components combined.

    1. Over-concentrated permissions
      Agents are often granted broad file, network, and API permissions to complete tasks. Once the task goal is poisoned or reasoning deviates, those permissions are directly converted into destructive power.

    2. Tool-chain amplification
      Tool invocation turns “ideas” into “side effects.” A single erroneous write, delete, release, or transfer call can produce irreversible consequences in seconds.

    3. Memory poisoning and state drift
      If long-term memory lacks source labeling and credibility grading, erroneous information in historical context will be repeatedly referenced, creating a state drift that gets “more biased the more it is used.”

    4. Goal hijacking and prompt injection
      If external content (web pages, documents, tickets, emails) is treated as trusted instructions, attackers can alter the agent’s execution path by crafting inputs.

    5. Autonomous loops without circuit breakers
      Long-running tasks without thresholds for budget, steps, failure rate, and sensitive operations will continuously amplify anomalies.

    3. Defense Framework: Confining “Action” Within Verifiable Boundaries

    The most effective approach to action risk is not to pursue absolute model correctness, but to make the system controllable, rollback-capable, and traceable even when errors occur.

    1. Least Privilege and Short-Lived Credentials

    • Grant only the minimum necessary permissions per task, with read/write separation and environment isolation;
    • Use short-lived credentials that are revoked as soon as the task ends;
    • Require secondary confirmation or two-person approval for sensitive actions such as deletion, release, payment, and permission changes.

    2. Pre-Execution Policy Checks (Policy-as-Code)

    Push security rules down from “prompt constraints” to “pre-execution checks,” so that every tool call must pass through a policy engine.

    1. policy:
    2. - name: deny-destructive-ops
    3. match: {tool: ["fs.delete", "db.drop", "deploy.release"]}
    4. action: require_approval
    5. - name: egress-control
    6. match: {tool: "http.request", dest_zone: "internet"}
    7. action: allow_if_in_allowlist
    8. - name: budget-guard
    9. match: {run: true}
    10. action: stop_when {steps: 50, cost: 5.0, error_rate: 0.2}

    3. Sandboxing and Isolated Execution

    • Place file and command execution inside containers or restricted runtimes;
    • Deny network access by default and open allowlists on demand;
    • Use independent sessions for browser and external content access to avoid carrying high-privilege credentials.

    4. Trusted Inputs and Data Classification

    • Mark external content as “untrusted data” by default; it must not be directly elevated to instructions;
    • Attach source, time, and credibility to memory entries, with support for expiration and revocation;
    • Perform conflict detection on retrieval results to avoid being hijacked by a single source.

    5. Full-Chain Auditing and Observability

    • Record goals, plans, tool calls, parameter summaries, results, and approval records;
    • Build anomaly detection through logging services and monitoring alerts: unusual tool combinations, sensitive operation frequency, and privilege escalation attempts;
    • Retain replayable execution traces for key actions to support review and forensics.

    6. Emergency Circuit Breakers and Rollback

    • Define “stop conditions”: budget overrun, rising error rate, and triggered sensitive operations;
    • Adopt canary and rollback-capable design for change-type operations;
    • Establish a human takeover channel to ensure a switch from automatic mode back to controlled mode at any time.

    4. Engineering Rollout Order: From Control to Scalability

    It is recommended to proceed along the path of “constrain first, observe next, autonomy last”:

    1. First converge permissions and the tool surface, disabling unnecessary execution capabilities;
    2. Then integrate policy checks and sandboxes to ensure every call is manageable and controllable;
    3. Next complete auditing and alerting to achieve visualization and traceability;
    4. Finally, gradually open up autonomy in low-risk scenarios, and continuously validate circuit breakers and rollback through drills.

    When implementing on the cloud, you can combine container platforms for isolation, object storage for execution traces, message queues for task decoupling, and logging services with monitoring alerts to build an observability system. General capabilities from Baidu AI Cloud can also be selected and integrated following this architectural approach, but the core remains permission and policy design rather than any single product.

    5. Conclusion

    AI agents have not changed the essence of security; they have only pushed the question of “how permissions are used” to the forefront. The change in offense and defense rules lies not in whether the model is smarter, but in whether we confine action within verifiable, rollback-capable, and traceable boundaries. Whoever establishes a governance system centered on permissions, gated by policies, and grounded in auditing earlier will be able to hold both efficiency and risk in hand in the agent era.