# AI agent security

> Canonical: https://skillalmanac.com/glossary/ai-agent-security | Last verified: 2026-11-25 | Index status: index-eligible

AI agent security is the practice of limiting what an AI agent can read, reach and do, to reduce the likelihood and impact of harm from a mistaken, manipulated or compromised model acting through its tools and permissions.

Also called: agent security, securing AI agents, agentic security, AI agents security.

## In plain language

An AI agent does not just answer questions. It reads files, runs commands and calls other systems for you. Securing one means deciding in advance what it may touch, which actions need your approval, and what happens if it is tricked by text it reads. Think of hiring a helpful temp who can be fooled by a forged note: you do not rely on the temp to spot every forgery, you limit which doors the temp has keys to. The main limitation is that no setting makes an agent immune. Controls reduce the damage, and a person still has to review high-impact actions. The risk grows with the access you grant, because an agent with access to email, code or credentials can misuse all three.

## Technical definition

OWASP's LLM06:2025 entry on excessive agency names three root causes for damaging actions by LLM systems that can call tools: excessive functionality, excessive permissions and excessive autonomy. Its mitigations include minimising the tools offered, preferring granular tools over open-ended ones such as general shell access, giving downstream identities least-privilege access, requiring human approval for high-impact actions, and enforcing authorization in the downstream systems instead of relying on the model to decide. OWASP's Agentic Security Initiative publishes a threat-model-based reference for agentic threats and mitigations. Claude Code documents permission modes and configurable Bash sandboxing with filesystem and network isolation. Network-command approvals depend on mode and rules; the manual-mode examples are not guarantees for every session.

## How it shows up when you use agents

In Claude Code, Codex or Cursor, agent security is the set of choices behind every approval prompt. Each time the agent wants to run a command, edit a file or reach a network address, a permission setting decides whether it asks you or proceeds. Claude Code documents permission modes, optional configured Bash sandboxing with filesystem and network isolation, and network-command approval behavior that depends on the mode and rules, including manual-mode examples.

One important attack example is [prompt injection](/glossary/prompt-injection): text the agent reads, such as a web page or a file, that tries to redirect it. IBM says no one has found a foolproof way to address these attacks, so the practical response is to limit the damage. OWASP's recommendations point the same way: fewer tools, narrower permissions, human approval for high-impact actions, and checks in the systems the agent calls.

What breaks when this is misunderstood: people approve every prompt without reading, grant a broad shell when a narrow tool would do, or connect an [MCP server](/glossary/mcp-server) they have not reviewed. Next action: list what your agent can reach, remove what the task does not need, and keep a person in the loop for anything hard to undo. The guide [Autonomous AI agents: risks and guardrails](/learn/autonomous-ai-agents-risks-and-guardrails) walks through this, and [LLM security](/glossary/llm-security) covers the wider field.

## Common confusions

- **AI agent security versus AI safety.** Agent security is about stopping misuse, manipulation and damaging actions by a system with tool access. AI safety is the broader field, which also covers the behaviour of models themselves.
- **Agent security versus model security.** A safer model helps, but OWASP recommends enforcing authorization in the downstream systems instead of relying on the model to decide what is allowed.
- **Sandbox versus permission prompt.** A prompt asks you. A sandbox restricts what a command can reach at the operating-system level. Claude Code's documentation notes that an approved Bash command can still write anywhere your account can unless sandboxing is on.
- **Myth: a protected agent is safe from every attack.** Claude Code's security page says no system is completely immune to all attacks.

## Worked examples in this catalogue

### [Autonomous AI Agents: Risks and Guardrails](https://skillalmanac.com/learn/autonomous-ai-agents-risks-and-guardrails)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A guide to what goes wrong when an agent acts unattended, with a worked example of an overnight run and the limits, approvals and stopping rules that contain it. It draws on OWASP's excessive agency category.

Why it exercises the concept: It names the same three root causes as the OWASP entry cited here and turns them into controls you can set before you leave an agent running.

### [coding-agent-guardrails](https://skillalmanac.com/skills/skill-almanac/coding-agent-guardrails)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A pre-action checklist for coding agents plus a read-only audit of a repository's guardrail setup.

Why it exercises the concept: It inspects local repository configuration and diff evidence. This is an advisory check, not verification of remote or CI enforcement or a guarantee that every limit is active.

### [skill-safety-audit](https://skillalmanac.com/skills/skill-almanac/skill-safety-audit)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A scan of a third-party agent skill folder that returns a JSON risk table with evidence lines before you install it.

Why it exercises the concept: A skill an agent loads is part of what it can be made to do. Auditing it before install is one agent security control.

### [Claude Code](https://skillalmanac.com/tools/claude-code)

```
/permissions
```

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Claude Code's security page recommends auditing settings with /permissions. It describes permission modes, configurable Bash sandboxing and network approvals whose behavior depends on the active mode and rules.

Why it exercises the concept: Claude Code is an agent with real access to files and a shell, and its documentation shows where those limits are set.

## Related terms

- [AI agent](https://skillalmanac.com/glossary/ai-agent.md)
- [LLM security](https://skillalmanac.com/glossary/llm-security.md)
- [Prompt injection](https://skillalmanac.com/glossary/prompt-injection.md)
- [Guardrails](https://skillalmanac.com/glossary/guardrails.md)
- [Human in the loop (HITL)](https://skillalmanac.com/glossary/human-in-the-loop.md)
- [Sandbox](https://skillalmanac.com/glossary/sandbox.md)

## Sources

- [LLM06:2025 Excessive Agency](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/), OWASP GenAI Security Project (accessed 2026-11-24)
- [Agentic AI - Threats and Mitigations](https://genai.owasp.org/resource/agentic-ai-threats-and-mitigations/), OWASP Agentic Security Initiative (accessed 2026-11-24)
- [Security](https://code.claude.com/docs/en/security), Anthropic (Claude Code Docs) (accessed 2026-11-24)
- [What is a prompt injection attack?](https://www.ibm.com/think/topics/prompt-injection), IBM (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
