kosa8 / AI agent security

Guide · AI agent security

AI agent security: how to secure AI agents that act

Updated

A chatbot can only say something wrong. An AI agent can do something wrong: run a command, call an API, push code, move data, spend money. AI agent security is the work of bounding what an agent can do when it is wrong, tricked or simply too eager. This page explains what makes agents different from chat and LLM apps, the threat model for agents that act, the controls that contain each threat, a maturity checklist, and how kosa8 implements every control outside the agent's reach. If you are evaluating kosa8 for your organisation, the page for CISOs and security teams is the short version.

01What makes AI agents different from chat and LLM apps

An AI agent is a language model that chooses and calls tools in a loop until a task is done. The model is the same one behind a chat app; the difference is what it is connected to. Four things change the security picture:

  • Tools. The agent calls a shell, a browser, APIs and MCP servers. Each tool is a way to change something real.
  • Code. Coding agents and code interpreters write programs and run them, so anything the model can be talked into writing, it can also execute.
  • Credentials. To use those tools the agent holds API keys, tokens and cloud credentials, often with more reach than the task needs.
  • Network. It can open connections, so data it reads can leave and code from the internet can arrive.
Chat or LLM appAI agent
What it producesText for a person to readActions: commands, API calls, file changes, messages
Who acts on the outputA person, who can ignore itThe agent itself, often unattended
Worst case of a bad answerA wrong or harmful replyDeleted data, leaked keys, data sent out, money spent
Where the main control sitsFilters on what the model reads and writesLimits on what the agent can reach and do

That last row is the point of this page. Guardrails and prompt filters still help, because they lower the odds of a bad action. They cannot set a ceiling on the damage when one gets through. Agent security sets that ceiling, and it has to sit outside the agent, because anything inside the agent's reach can be switched off by a hijacked agent. For the wider picture across the enterprise, see AI security for the enterprise.

02The AI agent threat model

Most incidents involving agents follow a few paths. Most start with something the agent reads and end with something it does.

  • Prompt injection that becomes tool misuse. Instructions hidden in a README, an issue, an email, a web page or a tool result, which the agent follows as if they came from you, and then carries out with its tools. Indirect prompt injection · prompt injection in coding agents.
  • Excessive agency. More tools, permissions or autonomy than the task needs, so one mistake reaches far. OWASP lists it as LLM06:2025. Excessive agency, explained.
  • Credential and key theft. Keys in environment variables, dotfiles and config are readable by any code the agent runs, including code it was tricked into writing. Why the key should never enter the sandbox.
  • Data exfiltration. Private data, untrusted content and a way out (the lethal trifecta) let one request, DNS lookup or image URL carry data away. How agents leak data.
  • Supply chain and MCP. Poisoned packages, hallucinated package names, malicious agent skills, and MCP tools that carry hidden instructions or change after you approved them. MCP tool poisoning and rug pulls · the coding-agent supply chain.
  • Rogue and looping agents. An agent that keeps going after it should stop: retrying, spawning work, calling the same tool, or pursuing a goal someone else gave it. OWASP's agentic list names rogue agents (ASI10) and cascading failures (ASI08).
  • Destructive actions. rm -rf, a dropped table, a force-push, a deleted cloud resource. Often not an attack at all, just a confident mistake. Stop an agent deleting files.
  • Escape from a shared kernel. Containers share the host's kernel, so a kernel bug reached from one agent can reach the host and every other agent on it. Containers vs microVMs.

When many agents work together, these risks gain new paths between agents. That is covered on swarm and multi-agent security.

03The controls that contain each threat

Each control below is enforced outside the agent, and each limits a threat without needing to detect it first. Together they apply least privilege to a worker that can be talked into anything.

ControlWhat it meansThreats it limits
Isolation per agentEach agent in its own machine, with its own kernel, seeing one folderEscape, destructive actions, supply chain, spread between agents
Egress allow-listOutbound traffic denied by default, only the hosts the task needs allowed, enforced outside the agentExfiltration, downloads of attacker code, command-and-control
Keys outsideThe agent holds a placeholder; something outside it adds the real key to approved requestsCredential theft, key reuse elsewhere
Tool rules and approvalsEach tool call checked against rules; destructive or escalating calls wait for a named personTool misuse, excessive agency, destructive actions
Pinned tools and componentsMCP tool definitions, models and agent kits pinned, with a changed one withheld until reviewedTool poisoning, rug pulls, supply chain
Checkpoint and rewindThe whole machine saved before risky steps and put back after a bad oneDestructive actions, poisoned state, failed runs
Limits and a stopSize, time and count limits, and a way to pause or stop an agent at onceRogue and looping agents, runaway cost
AuditA tamper-evident record of every action, refusal and approval, written by something the agent cannot touchUnattributed actions, weak incident evidence

For a step-by-step version, see the AI agent security checklist for 2026. For identity, keys and access in zero trust terms, see zero trust for AI agents.

04An AI agent security maturity checklist

Few teams start with every control in place. This checklist orders them so that each stage cuts the worst outcomes first. Use it to see where your agents are today.

Stage 1: contained. A hijacked agent cannot reach beyond its task.

  • Every agent runs in its own isolated machine, not on a laptop or a shared host.
  • Each agent sees only the folder it works on.
  • Outbound network is denied by default, with an allow-list per agent.
  • No real API key or token sits inside the agent's machine.

Stage 2: governed. Risky actions need a person, and rules are set centrally.

  • Destructive and escalating tool calls wait for a named approver.
  • Which MCP servers and tools each team may use is decided by a policy, not by each agent's config.
  • Each agent has its own identity and an accountable human owner.
  • Agents have time and size limits, and anyone on call can pause or stop them.

Stage 3: recoverable and evidenced. You can undo, explain and prove.

  • The machine is checkpointed before risky steps, and a bad run is rewound.
  • Every action, refusal and approval is in a log the agent cannot edit, forwarded to your SIEM.
  • You can hand an auditor evidence they can verify without trusting the vendor.
  • Your controls are mapped to the frameworks your auditors use, with the gaps written down.

05How kosa8 implements each control

kosa8 is secure infrastructure for AI agents. Every control above is enforced on the host, out of the agent's reach, and each is a command you can run on your own machines and servers today.

ControlHow kosa8 does itCommand
Isolation per agentEach sandbox is a microVM with its own kernel, disk and network: Apple's Virtualization framework on a Mac, Cloud Hypervisor on KVM on Linux. The agent sees the folder you mount and nothing else.kosa8 agent run -w ~/code/api claude
Egress allow-listEvery frame crosses a network guard on the host, so root in the guest cannot lift the rules. DNS answers listed names only, and refusals are counted and audited.kosa8 sandbox create sealed --egress-allow api.anthropic.com
Keys outsideAn egress broker on the host holds the real key and adds it on the way out, only to the provider's own hosts. The sandbox holds a placeholder that is worthless anywhere else.kosa8 sandbox egress agent
Tool rules and approvalsSigned rules read each call's arguments and answer allow, deny or ask. A held call waits for a named approver; signed approvals are spent once. A policy can require one or two approvers.kosa8 mcp asks
Pinned tools and componentsA signed MCP policy sets which servers and tools each scope may use; tool definitions are pinned by digest and a changed tool is withheld until reviewed. Model weights and agent kits are pinned too.kosa8 mcp-policy check
Agent identityEach agent gets a token tied to a scope and an accountable human owner, and its name appears in every audit entry it causes.kosa8 agent token create reviewer --scope eng
Checkpoint and rewindA checkpoint saves the whole running machine, memory and processes included, in a second or two on your own hardware; a rewind puts it back, still running.kosa8 rewind sealed
Limits and a stopPer-sandbox CPU and memory sizes, time limits and auto-stop; pause or stop any sandbox. On kosa8 Cloud every plan limit is a hard one.kosa8 sandbox pause --all
AuditEvery state change, brokered request, refusal, tool decision and approval, with actor and time. Hash-chained, HMAC-keyed and Ed25519-signed by the host service, and forwarded to syslog, Splunk HEC or HTTPS.kosa8 audit verify

How the boundary is built is on the security page. Agent identity is described in the agent identity guide.

06How AI agent security maps to the frameworks

The OWASP Top 10 for LLM Applications 2025, OWASP's Top 10 for Agentic Applications for 2026 and MITRE ATLAS each name the risks above. A few of the items that matter most for agents, and where kosa8 stands on each, from kosa8's self-assessed control map:

Itemkosa8
LLM01:2025 Prompt InjectionPartial: contains what an injected instruction can do; does not detect the injection
LLM06:2025 Excessive AgencyAddressed: tools per scope, argument rules, approvals for risky calls, no real credentials in reach
ASI02 Tool Misuse and ExploitationAddressed: argument rules answer allow, deny or ask, and every decision is logged
ASI03 Identity and Privilege AbusePartial: no real credentials in the VM, agent tokens tie each agent to an owner; privileges inside the systems a key reaches are set at the provider
ASI10 Rogue AgentsPartial: contained, recorded and forwarded, and can be paused, stopped or removed; behaviour is not judged
AML.T0055 Unsecured CredentialsAddressed: brokered keys never enter the VM
AML.T0105 Escape to HostAddressed: hardware virtualisation per agent; residual risk is a hypervisor bug

The full map, including NIST AI RMF, the EU AI Act and ISO/IEC 42001, is on the frameworks page. It is self-assessed, not a certification. Every framework, topic by topic: cybersecurity for AI agents.

07What these controls do not cover

  • Prompt injection itself. kosa8 bounds what a hijacked agent can do, not what it reads or believes, and does not detect the injection. It is the isolation layer, not a detection product.
  • Misuse of what you allowed. An allowed host that accepts uploads is a way out for data, and HTTPS bodies to allowed hosts are not inspected. Scope keys at the provider too.
  • A hypervisor escape. A much smaller surface than a shared kernel, not zero.
  • Anything running as you. A process under your account can call the service, and host root can rewrite local state. Forward the audit log off the machine.
  • Hosted Cloud. Each hosted sandbox is its own microVM, but the audit log, evidence export and signed policy are features of the software on your own machines and hosts; hosted Cloud sandboxes do not expose them yet.

kosa8 has no SOC 2 report yet (SOC 2 Type II is in progress, with the report expected in January 2027) and has not had an external penetration test. The Trust Center lists what is in place today. Plans start at $29 a month; see pricing and where kosa8 runs.

08Questions

What is AI agent security?

AI agent security is protecting the systems, data and credentials an AI agent can reach from what the agent does when it is wrong, tricked or misused. Because agents run code, call tools and hold keys, it mainly means isolating each agent, closing its network, keeping keys out of its hands, holding risky actions for a person, and recording every action.

How is agentic AI security different from LLM security?

LLM security is mostly about what a model reads and says: jailbreaks, harmful output, leaked data in replies. Agentic AI security is about what an agent does with tools, code, credentials and the network. Filters on text still help, but the main controls limit what the agent can reach, whatever it was told.

What are the biggest security risks of AI agents?

Prompt injection that turns into tool misuse, excessive agency, credential and API key theft, data exfiltration, supply chain and MCP tool poisoning, rogue or looping agents, destructive actions, and escape from a shared kernel. Each has a control that limits it without needing to detect the attack first.

How do you secure AI agents in production?

Run each agent in its own isolated machine, deny outbound traffic except an allow-list, keep real keys outside the agent, check tool calls and hold risky ones for a named person, pin the tools and components it uses, checkpoint before risky steps, and write every action to a log the agent cannot edit.

Does kosa8 stop prompt injection?

No. kosa8 bounds what a hijacked agent can do, not what it reads. Each agent runs in its own microVM with the network rules, keys, approvals and audit log on the host, so an injected instruction meets a limit on what it can reach rather than a filter on what it says.

Is this page the same as kosa8 for security teams?

No. This page explains AI agent security in general and how kosa8 implements each control. The page for CISOs and security teams is the short buyer's view: what kosa8 contains, how it fits a security programme, and how to book a security review.

Does kosa8 have a SOC 2 report?

Not yet. SOC 2 is in progress; kosa8 has no SOC 2 report and has not had an external penetration test. The Trust Center lists what is in place today, and the control map against OWASP, MITRE ATLAS and NIST is self-assessed.

09Guides and deep dives

10Get started

kosa8 installs with one line on macOS, Linux and Windows (WSL2), or runs hosted on kosa8 Cloud. Want to walk your own agents through this checklist? Book thirty minutes with the people who build kosa8.

Start free Book a security review See pricing

Start free, no card → Pick a plan when you need more. Plans start at $29 a month.