Skip to main content
Alfaro EngineersBook a Consultation

AE-AICSF

A security framework for AI agents that assumes they will be hijacked

The Alfaro Engineers AI Cybersecurity Framework is six controls, seven rules and a five-stage path for putting agents into production without betting on a perfect defense.

Author: Jorge Alfaro

No agent is impenetrable

An agent reads content it did not write and acts with permissions someone gave it. Sooner or later, something it reads will try to redirect it, or a permission will turn out to be wider than intended.

So the framework starts from one assumption: the agent will be hijacked. The work is to build it so a hijacked agent cannot do serious damage.

That changes the question from how to stop every attack to how much can go wrong when one succeeds. The second question has an engineering answer.

The six controls

Every request an agent handles passes through six controls, in this order.

One principle sits above all six: a rule the agent is only told to follow is not a control. Every control is enforced outside the model, in the tool gateway, the identity system or the infrastructure.

A request comes in

  1. Authenticate every agent

    Each agent has its own identity and short-lived credentials. It never borrows a person's login and never shares credentials with another agent. No other credential is within its reach: none sits in files, repositories or settings the agent can read.

  2. Limit every tool

    An agent gets only the tools and the environment its task needs, and staging credentials do not work on production. Read, write and delete are separate grants. Backups sit in a separate account or storage from the data they protect, no agent holds credentials that can delete or change them, and deletion is locked.

  3. Fence untrusted content

    Everything an agent reads is data, never an instruction. Email, documents and web pages cannot change what the agent was asked to do, and the system enforces that, not a prompt.

  4. A person decides

    Approve consequences

    A named person signs off on anything irreversible: deleting, paying, sending outside the organization or denying a request. The approval covers one exact action, shown as the system will run it rather than as the agent describes it, expires quickly, and is checked again when the action runs.

  5. Record everything

    Every action is logged against the agent, the person who asked, the tool and the input, where the agent cannot edit it.

  6. Operate under attack

    The agent is tested the way an adversary would test it, monitored in production, and can be turned off with one switch. Every agent has a named owner who reviews its permissions on a schedule and can suspend it. A restore from the separate backup is tested on a schedule.

The action goes out, and the cycle repeats

The seven rules

The controls become seven rules. None of them is optional.

  1. No agent shares credentials with a person or another agent, and none can reach a credential it was not issued.

  2. No tool, environment or permission is granted that the task does not need, and no agent can reach the recovery copies of what it works on.

  3. No content an agent reads is treated as a command, and the system enforces that, not a prompt.

  4. No single agent holds private data, untrusted input and an outbound channel at the same time.

  5. No irreversible action runs without a named human approval of that exact action, shown as the system will run it.

  6. No action happens without a log entry that names who asked.

  7. No agent reaches production without attack testing, a tested off switch, a tested restore of what it can touch, and a named owner.

Where a person must approve

Not every action needs a person. Actions fall into three tiers, so approvals land where they matter.

  1. Read only

    The agent proceeds on its own, and the action is logged.

  2. Reversible changes

    The agent proceeds within its limits, and the change can be undone.

  3. Irreversible actions

    The agent prepares the work and stops. A named person approves that exact action, as the system will run it.

The path

The framework is adopted in stages, and the order matters.

  1. Inventory

    List every agent, tool and credential in use, including the ones nobody approved. List the destructive actions each platform allows and whether they ask for confirmation or can be delayed. Name an owner for each agent. Repeat the inventory whenever a tool is added.

  2. Identity and scope

    Apply Authenticate and Limit: separate identities, least privilege on every tool.

  3. Fence and approve

    Apply Fence and Approve: isolate untrusted content and put a person in front of irreversible actions.

  4. Record and monitor

    Apply Record: complete, attributable logs that the agent cannot change.

  5. Attack it

    Apply Operate: test adversarially, rehearse the off switch, test a restore from the separate backup, and repeat on a schedule.

A worked example: the PocketOS incident

In April 2026, according to its founder, a Cursor agent running Claude Opus 4.6 deleted PocketOS's production database and volume-level backups in nine seconds while working on a staging task. It found a token that was not issued for the task and used it. The backups sat on the same volume as the data.

MIT's AI Incident Database lists broad credentials, backups stored with production data, no confirmation step and weak environment separation among the causes. Each maps to a control: Authenticate and Limit (credentials, environments, backups), Approve (the irreversible delete), Operate (testing the restore).

Sources

Read the full walkthrough

Score your agents against the framework

Seventeen questions, two to four per control. Answer for the agents you run today, not the ones you plan to build.

Your answers stay in this browser tab. Nothing is stored or sent.

Authenticate every agent

Does every agent have its own identity, separate from any person's login?
Are agent credentials short-lived and rotated automatically?
Is every credential an agent can reach one that was issued to it for its task, with none left in files, repositories or settings it can read?

Limit every tool

Is each agent limited to the tools and the environment its task needs, so that staging credentials do not work on production?
Are read, write and delete permissions granted separately?
Are backups held in a separate account or storage from the data they protect, with no agent able to delete or change them?

Fence untrusted content

Is content an agent reads, such as email, documents and web pages, unable to change its instructions, with that enforced by the system and not by a prompt?
Is every agent that reads untrusted content kept from holding both private data and a way to send it out?

Approve consequences

Does a named person approve every irreversible action before it runs?
Is it impossible for an agent to approve its own actions?
Is each approval tied to one exact action, shown to the approver as the system will run it, and good only for a short time?

Record everything

Is every agent action logged with the agent, the person who asked and the input?
Could you reconstruct what an agent did last week, and why, from those logs?

Operate under attack

Are agents tested against adversarial inputs before each release?
Is there a tested switch that turns an agent off immediately?
Does every agent have a named owner who reviews its permissions on a schedule and can suspend it?
Has a restore from the separate backup been tested on a schedule you set?

Your result

0 of 17 answered

Answer all seventeen questions to see your score.

How it relates to existing standards

AE-AICSF does not replace the OWASP Top 10 for Agentic Applications or the NIST AI Risk Management Framework. Those describe what can go wrong and how to govern it.

AE-AICSF is the build order: six controls an engineering team can implement and an auditor can check.

Versions

  • v1.2, November 2026: backups moved to a separate failure domain with tested restores; no stray credentials; enforcement outside the model; approvals bound to one exact action; a named owner per agent; environment separation.
  • v1.1, November 2026: added an explicit backup isolation requirement under Limit, based on practitioner feedback.
  • v1.0, November 2026: first published version.

Cite as

Alfaro, J., AE-AICSF v1.2, Alfaro Engineers, 2026, alfaroengineers.com/en/ai-security-framework

Contact

Find out where your agents stand

If you are putting agents into production, a first conversation covers where you stand against the six controls and what to fix first.