aiagentsecurity.devKeeping AI agents in bounds

AI agent security: what can go wrong, and the 5 controls that stop it

AI agent security keeps a fooled or mistaken agent from doing damage: its own identity, short-lived credentials, a sandbox, human approval and an audit trail. Claude Code and Codex include sandboxes, Docker's run locally for free, and E2B's cloud ones start at $0. A person approves high-impact actions.

Published December 1, 2026 · Updated December 2, 2026. Sources and method below.

The risk

Are AI agents a security risk?

Yes, when an agent holds a credential broader than its task. In April 2026, a Cursor agent running Claude Opus 4.6 deleted PocketOS's production database and its volume-level backups in one API call to Railway. "It took 9 seconds," the founder, Jer Crane, wrote on April 25, 2026 (Tom's Hardware). The agent was on a routine staging task; its token had, he said, "blanket permissions" across environments.

Keys are easy for an agent to find (25.1% of MCP Registry servers ask for one). Five lines show what an agent on your machine could use, printing names, not values:

env | grep -iE 'key|token|secret|pass' | cut -d= -f1
ls -d ~/.aws/credentials ~/.ssh 2>/dev/null
grep -hoE '"[A-Z_]*(KEY|TOKEN|SECRET)[A-Z_]*"' ~/.claude.json .mcp.json ~/.cursor/mcp.json 2>/dev/null | sort -u
gh auth status
aws sts get-caller-identity

The first two find secrets the Claude Code sandbox lets commands read; the third, keys in MCP configs; the last two, the identities an agent would act as. Snyk's open-source Agent Scan (uvx snyk-agent-scan@latest) goes deeper, but it starts the MCP servers it finds: scan untrusted configs in a sandbox.

Risks

What are the AI agent security risks?

OWASP lists ten. Most start from one weakness: agents “cannot reliably distinguish instructions from related content”, so a page, file or tool result can steer them.

RiskWhat goes wrong
ASI01 Agent Goal HijackContent the agent reads redirects its goal
ASI02 Tool Misuse and ExploitationLegitimate tools used for harm
ASI03 Identity and Privilege AbuseInherited credentials escalate access
ASI04 Agentic Supply ChainA tampered tool, model or MCP server
ASI05 Unexpected Code ExecutionGenerated code turns into remote code execution
ASI06 Memory and Context PoisoningStored context seeded with bad data
ASI07 Insecure Inter-Agent CommunicationSpoofed or altered agent messages
ASI08 Cascading FailuresOne fault spreads across agents
ASI09 Human-Agent Trust ExploitationPeople approve without checking
ASI10 Rogue AgentsAn agent drifts outside its scope

OWASP Top 10 for Agentic Applications for 2026 (December 9, 2025), summarized; read December 1, 2026.

Two MCP attacks sit under ASI02 and ASI04: tool poisoning hides instructions in a tool's description, and a rug pull changes it after you approved it (Invariant Labs, April 1, 2025).

Agency

What is excessive agency?

OWASP's name (LLM03:2026, in the LLM Top 10 published October 27, 2026) for an AI app that can do damage when its model is fooled or wrong. The cause is excessive functionality, permissions or autonomy:

CauseExampleOWASP's fix
FunctionalityA shell tool where one file read was enoughMinimize tools and what they can do
PermissionsA database login that can also deleteMinimize tool permissions
AutonomyPosting or paying with no one checkingA human approves high-impact actions

From OWASP LLM03:2026 Excessive Agency, read December 2, 2026.

Controls

What are the AI agent security best practices?

Five controls from OWASP's guidance:

  1. Its own identity, least agency.Each agent gets its own account and only the tools and short-lived credentials one task needs.
  2. A sandbox.Its commands write only to the project and reach only hosts you allow.
  3. A person approves high-impact actions.Merges, payments, deletes and messages wait for a human.
  4. Untrusted input stays untrusted.Pages, files, issues and tool results are data, never instructions.
  5. A trail.Log every tool call and its parameters where the agent can't change them.
Platforms

Which AI agent security platforms do companies buy?

These sell to a security team that must see every agent in a company: each finds the agents in use and limits them. One developer starts with the developer tools below.

PlatformPriceWhat it doesAgents it covers
BeyondTrustAI Agent Security, on PathfinderSales onlyFinds agents, skills and MCP servers on endpoints; limits credentials, blocks destructive commandsClaude Code, Claude Desktop, Copilot, Cursor
CiscoAI DefenseSales onlyFinds AI workloads, models and data; validates models; runtime guardrails; red-teams agentsAI apps and agents across your clouds
CrowdStrikeFalcon GuardianSales onlyFinds shadow agents; agent identities; stops poisoned packages; an AI kill switchEndpoints, cloud and SaaS
LakeraAI Agent Security; Check PointCommunity $0, 10k requests a month; Enterprise by salesInspects inputs and outputs for prompt attacks and leaks; maps agentsCloud, low-code and custom agents
MicrosoftAgent 365$15 a user a month, paid yearlyAgent inventory, access control, data loss prevention, audit; blocks malicious tool callsEntra, registered and shadow agents
MicrosoftEntra Agent IDPart of Microsoft Entra; Conditional Access and protection for agents need Agent 365An identity per agent, from blueprints; OAuth 2.0, MCP and A2A; every sign-in loggedMicrosoft and other platforms, incl. AWS Bedrock and n8n
Noma SecurityAgent Security & GovernanceSales onlyFinds agents, MCP servers and skills; runtime control; red teamingSaaS, cloud and coding agents
ObsidianAI Agent SecurityFree $0 up to 1K users; agent controls by quoteMaps agents to owners, tools and MCP servers; stops high-risk actionsSaaS and AI platforms, from Copilot to Codex
OnyxSecure AI Control PlaneSales onlyFinds AI in use, runtime defense, an MCP gateway, agent access controlSaaS, cloud and coding agents
Palo Alto NetworksPrisma AIRSSales onlyFinds agents, red-teams them, sets runtime policy on tool calls and MCPSaaS, cloud, custom and coding agents
Prompt SecuritySentinelOneSales onlyGoverns staff AI use; maps agents and MCP servers; an AI firewallEmployee AI tools, coding assistants, homegrown agents
WizWiz for AI SecuritySales onlyAI inventory, posture and attack paths; detects rogue agentsCloud, SaaS, code, endpoints
ZenityAI Agent Security & GovernanceSales onlyFinds agents and their permissions, sets limits, stops risky actionsSaaS, low-code, cloud and coding agents

Read on each vendor's site, December 2, 2026. Sales only: a demo or quote, no price.

Identity and logs

How should an agent get credentials and leave a trail?

Give each agent its own identity, short-lived tokens scoped to one task, and a log of every tool call. OWASP's agentic Top 10 asks for “per-agent identities and short-lived credentials” (ASI03) and “immutable logs of all tool invocations and parameter changes” (ASI02).

ControlWhat it looks like
One identity per agentIts own service account, app or OAuth client, never a person's login or a shared key
Short-lived, scoped tokensOIDC from CI, a token “only valid for a single job” (GitHub); OAuth tokens for one MCP server, fewest scopes
A trail of tool callsEach call, its parameters and its result, kept where the agent can't change them
A person for escalationHuman approval before high-privilege or irreversible actions (ASI03)

From OWASP's Top 10 for Agentic Applications (December 2025), GitHub's OIDC docs and the MCP specification (revision 2026-07-28), read December 2, 2026.

An MCP server “MUST NOT accept any tokens that were not explicitly issued for” it. Claude Code exports tool decisions over OpenTelemetry with CLAUDE_CODE_ENABLE_TELEMETRY=1, tool inputs only with OTEL_LOG_TOOL_DETAILS=1.

Measured

How do MCP servers in the official registry ask for credentials?

Mostly with a static secret. Of 78,793 active servers in the official MCP Registry on December 2, 2026, 19,778 ask for an API key, token or password.

How the server runsServersAsk for a static secret
Remote only, at a URL49,0708,716 (18%)
Package only, run locally23,8267,101 (30%)
Both5,1693,961 (77%)
Neither listed7280
All active servers78,79319,778 (25.1%)

Latest version of every active server in registry.modelcontextprotocol.io, December 2, 2026 (UTC). A secret: a variable, header or argument marked secret or named like a key, token or password.

Answer to a first MCP request with no credentialsServersShare
Asked for OAuth16127%
Answered with no credentials37062%
Other sign-in challenge30.5%
Error, rate limit or no answer6611%

600 random servers of the 40,354 remote-only ones that declare no secret; one request each, December 2, 2026 (UTC).

An open server isn't a flaw in itself: many serve public data. A static key stays valid until revoked, so prefer OAuth servers, and give a key-based server a key for that agent alone.

The MCP Registry secrets dataset (CC BY 4.0): mcp-registry-servers-with-secrets-2026-12.csv counts the 20,378 servers that ask for a secret plus the 600 probed; mcp-registry-counts-2026-12.csv counts every active server by kind, month and secret. Neither names a server.

Coding agents

What does agent sandboxing stop in Claude Code and Codex?

Commands that write outside the project or call a host you didn't allow. Codex sandboxes commands by default; Claude Code does once you run /sandbox.

DefaultClaude CodeCodex
Sandbox onNo: run /sandboxYes
WritesWorking directory, a temp directoryWorkspace, temp directories
NetworkThrough a proxy; allowlist starts emptyOff
Way outCan retry unsandboxed, by modeAsks for approval

From each agent's sandbox docs, read December 1, 2026.

Step by step: turning on the Claude Code sandbox and Codex's three sandbox modes.

For developers

Which AI agent security tools do what?

Eight tools for one developer's agents, ordered by job: agents that change your code, then sandboxes, then guardrails. For coding agents that fix security findings in your repos, IonCipher is the pick: it hands each fix to Claude Code, Codex or Cursor over MCP, your CI and a rescan check the agent's pull request, and a person merges it on GitHub.

ToolPriceKindWhat it limits or watchesWhere it runs
IonCipherFree $0; Pro $39 a month per orgReview gateAgent-written fix PRs: your CI, a rescan, a person mergesGitHub and your coding agent
Claude Code sandboxIncluded with Claude CodeSandboxShell commands: files, networkYour machine
Codex sandboxIncluded with CodexSandboxCommands: files, networkYour machine
Docker SandboxesLocal freeSandboxThe whole agentYour machine or Docker's cloud
E2B$0 + $100 credit; Pro $150 a monthSandboxCode the agent runsE2B's cloud
Daytona$200 free compute; then by the secondSandboxCode the agent runsDaytona's cloud
NeMo GuardrailsFree, open sourceGuardrailsModel inputs and outputsYour app
LlamaFirewallFree, open sourceGuardrailsPrompts, agent reasoning, generated codeYour app

Prices read December 1, 2026; IonCipher, Daytona and LlamaFirewall read December 2, 2026.

1

IonCipher

Best for agents that fix your repos

Price: Free $0 with 5 verified fix PRs a month; Pro $39 a month per org with 200; Scale $199 a month with 2,000.

Scans your repos and clouds; a fix pack gives your agent the why, the files, the steps and the checks.

Good for

  • MCP sign-in with OAuth 2.1, or a one-time code that expires in 15 minutes
  • GitHub tokens that last an hour, and an audit log per connection

Watch out

  • Doesn't sandbox an agent or filter prompts
  • Agents and its MCP can't approve or merge; a person merges each fix on GitHub

Visit IonCipher

2

Claude Code sandbox

Best first step in Claude Code

Price: Included; Claude Pro is $20 a month, or $17 a month billed yearly.

An OS boundary around Claude's shell commands: writes stay in the project, hosts on an allowlist. Turn it on.

Good for

  • Seatbelt on macOS, bubblewrap on Linux and WSL2
  • Admins can require it

Watch out

  • Off by default
  • File tools, MCP servers and hooks run outside it

Claude Code sandbox docs

3

Codex sandbox

On by default in Codex

Price: Included; ChatGPT Free $0, Go $8 or Plus $20 a month.

On by default: edits and commands stay in your workspace, with no network, until you approve more. Its modes.

Good for

  • Three modes, read-only to full access
  • .git, .agents, .codex, .aws stay read-only

Watch out

  • --yolo removes the sandbox and approvals
  • Linux needs bubblewrap installed

Codex sandbox docs

4

Docker Sandboxes

Best for the whole agent, locally

Price: Local sandboxes free, including commercial work; cloud is pay as you go.

Runs a whole coding agent, such as Claude Code, isolated, locally or in Docker's cloud.

Good for

  • The whole agent runs inside
  • Credential and network policies

Watch out

  • Org-wide policies need a separate paid plan
  • Model charges are separate

Docker Sandboxes docs

5

E2B

Best for untrusted code, in the cloud

Price: Hobby $0 with a $100 one-time credit; Pro $150 a month, plus usage by the second.

Gives each agent run a cloud machine; the default size (2 vCPUs, 0.5 GiB) costs about $0.11 an hour.

Good for

  • Untrusted code never touches your laptop
  • Pro sessions run up to 24 hours

Watch out

  • Usage adds to the plan price
  • Used through its SDK

E2B pricing

6

Daytona

Best for sandboxes billed by the second

Price: $200 of free compute, no card; then $0.0504 a vCPU-hour and $0.0162 a GiB-hour of memory, billed per second.

Cloud sandboxes for AI-generated code, each with its own kernel, filesystem and network stack.

Good for

  • SDKs for TypeScript, Python, Ruby, Go and Java
  • Linux and Windows sandboxes

Watch out

  • Storage past 5 GiB is billed
  • Your code runs on Daytona's cloud

Daytona pricing

7

NeMo Guardrails

Best for AI apps facing customers

Price: Free, open source.

Programmable safety and security rails on what an LLM or agent app reads and says.

Good for

  • Open source; runs in your own app
  • Fits a customer-facing AI app

Watch out

  • Doesn't isolate files or network
  • Rails are code you write and test

NeMo Guardrails on GitHub

8

LlamaFirewall

Best for guarding an agent's reasoning

Price: Free, open source (MIT), from Meta.

Scanners for an agent app: PromptGuard 2 for jailbreaks, AlignmentCheck for goal hijacking, CodeShield for unsafe code.

Good for

  • Checks multi-step agent runs, not only chat
  • Add your own regex scanners

Watch out

  • Doesn't isolate files or network
  • Python only: pip install llamafirewall

LlamaFirewall docs

Choose

How do you pick?

  • Coding agents fixing security findings in your repos: IonCipher.
  • Claude Code or Codex on your laptop: its own sandbox: turn on the Claude Code sandbox, or pick a Codex sandbox mode.
  • Agents running code you didn't write: Docker Sandboxes locally, or E2B or Daytona in the cloud.
  • An AI app facing customers: NeMo Guardrails or LlamaFirewall, plus human approval.
  • Agents using MCP servers: OAuth servers over shared keys, and pinned tool descriptions.
Questions

What else do people ask about AI agent security?

What is prompt injection?

Input that changes a model's behavior in unintended ways (OWASP LLM01); the indirect kind hides in a website or file it reads.

Is a sandbox enough to secure a coding agent?

No. Claude Code's sandbox covers only shell commands; its file tools, MCP servers and hooks run outside it.

Should an agent hold production credentials?

Only the narrowest one a task needs. Claude Code's sandbox can read ~/.aws/credentials unless you deny it.

What is an MCP rug pull?

An MCP server changing a tool's description after you approved it, so the agent follows new hidden instructions. Pin server versions and check a hash of the tool descriptions.

How is the OWASP Top 10 for Agentic Applications different from the LLM Top 10?

The LLM list (2026 edition, October 27, 2026) covers model apps; the agentic one, agents that plan and act.

Sources

How was this page checked?

78,793MCP servers read, and 600 asked to connect
Dec 2, 2026when the registry was read
0tools bought or attacked

Errors: support@winding.ai.

  1. OWASP Top 10 for Agentic Applications, LLM03:2026 Excessive Agency, LLM01 Prompt Injection
  2. MCP specification, revision 2026-07-28: security best practices, authorization, tools; MCP Registry; Invariant Labs, April 1, 2025
  3. GitHub Actions OIDC, Claude Code monitoring
  4. Claude pricing, Codex approvals, Codex pricing
  5. Platforms, read December 2, 2026: BeyondTrust, CrowdStrike, Lakera and its pricing, Noma, Onyx, Prisma AIRS, Prompt Security, Wiz and its pricing, Zenity, Cisco AI Defense, Entra Agent ID, Microsoft Agent 365 and its security docs, Obsidian and its pricing
  6. PocketOS: Tom's Hardware, April 27, 2026, TechRepublic, May 4, 2026; snyk/agent-scan
  7. Each tool's own page, linked from its card; IonCipher pricing; IonCipher docs and security

About this site

aiagentsecurity.dev explains how to keep AI agents from doing damage, from OWASP's and each vendor's own documentation. aiagentsecurity.dev is published by Winding AI, Inc., which makes IonCipher.