Arcjet Learning Center

AI Security Guides

Identity, architecture, and runtime controls for agents that call tools, access data, and take actions.

What these guides cover

AI security protects systems in which models can call tools, access private data, and create real-world side effects. Model safeguards alone cannot determine whether a specific user may refund an invoice, whether retrieved content is trustworthy, or whether a sequence of individually permitted actions is safe. Production controls must preserve user and agent identity, validate untrusted model output, enforce policy immediately before consequential actions, constrain resource use, and record decisions for investigation. These guides focus on enforceable application boundaries: where a control has enough identity, workflow, resource, and business context to stop an unsafe operation before it completes. The result is layered protection tied to real application consequences.

Risks

  • Unauthorized or manipulated tool calls
  • Prompt injection through user or retrieved content
  • Delegated authority used outside the user's intent
  • Sensitive-data exposure and runaway resource use

Control priorities

  • Action-level authorization inside the application
  • Separate user, agent, workload, and client identities
  • Prompt-injection, data, sequence, and budget checks
  • Fail-safe enforcement with attributable audit evidence

Recommended reading order

Start with AI agent runtime security for the threat and control model. Use the architecture guide to choose enforcement points, then open the security guide for the framework you ship: Claude Agent SDK, Claude Managed Agents, Cloudflare Think, CrewAI, Genkit, Google ADK, LangChain, LangGraph, Mastra, OpenAI Agents, Strands Agents, TanStack AI, Vercel AI SDK, or Vercel Eve. Use the agentic identity guide to design delegation, workload identity, token exchange, and action-level authorization. For Claude Code, GitHub Copilot, Cursor, and OpenAI Codex, start with the coding agent security guide.

Guides in this collection

Coding agent security

How do you secure AI coding agents like Claude Code, Copilot, Cursor, and Codex?

One policy for Claude Code, Copilot, Cursor, and Codex — checked before each tool call through managed settings.

Read guide
Coding agent security

How do you secure Claude Code in the enterprise?

Hooks for every Claude Code tool call, prompt, and model switch — deployed through managed settings or MDM.

Read guide
Coding agent security

How do you secure the GitHub Copilot CLI and cloud agent?

To secure GitHub Copilot's agents, install hooks that send each pending tool call to a policy service before the tool runs.

Read guide
Coding agent security

How do you secure Cursor's agent?

Cursor runs hooks as commands, so a policy check needs a small wrapper script on preToolUse and beforeSubmitPrompt with failClosed set.

Read guide
Coding agent security

How do you secure OpenAI Codex?

Codex runs hooks as commands, so a policy check is a wrapper script on PreToolUse, PermissionRequest, and UserPromptSubmit that exits 2 on any failure.

Read guide
Coding agent security

How do you stop a coding agent running destructive commands?

To stop a coding agent running destructive commands, deny them at the hook that the agent fires before each tool call.

Read guide
Coding agent security

How do you stop a coding agent reading .env files and credentials?

To stop a coding agent reading .env files and credentials, deny the read at the hook that the agent fires before each tool call.

Read guide
Coding agent security

How do you restrict which MCP servers a coding agent can use?

To restrict which MCP servers a coding agent can use, check each MCP tool call against an allowlist at the hook that the agent fires before the call runs.

Read guide
Coding agent security

How do you block personal Claude, ChatGPT, Copilot, and Cursor accounts on work laptops?

Personal AI accounts are a common form of shadow AI.

Read guide
AI agent security

How to stop AI agents contacting malicious URLs and domains

Deny the tool call before an AI agent reaches a malicious URL or domain.

Read guide
AI agent security

What is a rogue MCP server and how do you detect one?

A rogue MCP server is one that your agents can call but that your organization hasn't reviewed or can't trust.

Read guide
AI agent security

How to build an egress allowlist for AI agents

An egress allowlist lists the hosts that an agent may contact, and a policy that the agent can't edit enforces it on every tool call.

Read guide
AI agent security

Least privilege for AI agent tool calls

Give each AI agent only the tools, credentials, resources, and execution time its task needs.

Read guide
AI agent security

AI agent security testing: Evaluations and release gates

Test whether an AI agent can cause an unauthorized action or disclosure.

Read guide
AI agent security

AI agent incident response: A practical playbook

Contain an AI agent incident, preserve tool-call evidence, trace downstream effects, and remove persistence.

Read guide
AI agent security

Best AI security solution for healthcare and regulated industries

The best AI security for healthcare inspects PHI and PII in your process so the raw body never leaves to be classified.

Read guide
AI agent security

Best AI security solution for fintech

The useful fintech control inspects financial PII in-process, gates the transfer or refund at the tool boundary, and records who did what for the audit.

Read guide
AI agent security

What's the best AI security provider for enterprises?

The best AI security provider for enterprises depends on the layer: identity, gateway, guardrails, observability, or in-code enforcement.

Read guide
AI agent security

Eve agent security is three jobs

Eve agent security is three jobs: screen the channel, gate tools and connections, and treat hooks as observe-only.

Read guide
AI agent security

How to secure a Mastra agent

Wiring recipe for Mastra: screen with guardProcessor, wrap createTool, and deny MCP with guardHooks.

Read guide
AI agent security

Claude Agent SDK security

Wiring recipe for Claude Agent SDK: screen prompts on UserPromptSubmit and deny tools at PreToolUse.

Read guide
AI agent security

Human approval is not a security policy

A human click is a hold, not a remote allow or deny. Eve user-approval, Mastra requireApproval, and Claude canUseTool park a call.

Read guide
AI agent security

canUseTool is not a policy gate

Claude's canUseTool looks like a gate. allowedTools, allow rules, and bypassPermissions / acceptEdits skip it. A Bash or Write in allowedTools never.

Read guide
AI agent security

Mastra guardrails vs an action gate

Mastra guardrails classify messages. An action gate decides whether this tool runs. A clean prompt-injection score can still open a pull request that pastes.

Read guide
AI agent security

The lethal trifecta for AI agents

Private data, untrusted content, and external communication in one agent let an attacker steal data through content the agent already reads.

Read guide
AI agent security

How do I secure a RAG application?

Similarity retrieval finds on-topic chunks, not safe ones. Screen retrieved content before it enters the model context.

Read guide
AI agent security

Application-Native vs Remote Security Policies: A Technical Guide

Application-native, code-authored rules give engineers context, review, and tests.

Read guide
AI agent security

AI Agent Security Architecture: In-Code vs Proxy vs Gateway vs Security Agent

Compare in-code, proxy, AI gateway, and security-agent controls by visibility, enforcement, and context.

Read guide
Agentic identity

AI Agent Identity and On-Behalf-Of Authorization

On-behalf-of authorization lets an AI agent retain its own identity while exercising limited authority delegated by a user.

Read guide
AI agent security

What Is AI Agent Runtime Security?

AI agent runtime security enforces policy while an agent is interpreting input, calling tools, accessing data, and taking actions.

Read guide
AI agent security

Runtime Security for LLM Applications: Prompt Injection, Data Exfiltration, Unsafe Actions

Prompt injection, data exfiltration, and unsafe tool use — the three runtime failure modes for LLM apps.

Read guide
AI agent security

Prompt injection protection for LangChain, LlamaIndex, and Vercel AI SDK apps

Screen the user message before the model, and screen tool or retriever output before it re-enters context.

Read guide
AI agent security

Keeping Security Inspection Local So Data Stays in Your Environment

Most security tooling has to receive your traffic to inspect it.

Read guide
AI agent security

How to Enforce Runtime Controls on AI Agents Accessing Enterprise Systems

When agents touch CRMs, warehouses, and internal APIs, the control has to run at each action.

Read guide
AI agent security

How to Prevent Data Exfiltration Through AI Agents

Stop agents leaking sensitive data without sending that data to a third-party scanner.

Read guide
AI agent security

How to detect and redact PII in LLM inputs and outputs

Scan the prompt before the provider sees it and the completion before it renders — inbound, outbound, and streaming boundaries.

Read guide
AI agent security

PII detection at runtime: gateway, sidecar, or in-process

Runtime PII detection ships in three shapes, and they differ on where the text goes to get classified and which paths they can see.

Read guide
AI agent security

How to prevent PII leakage from AI agents

Between the message and the answer, an agent calls tools, reads results back into context, writes to memory, and hands off to other agents.

Read guide
AI agent security

How to redact sensitive data before sending it to OpenAI or Anthropic

Middleware around OpenAI and Anthropic clients: reversible redaction, streaming chunks, tool arguments, and why provider filters run too late.

Read guide
AI agent security

How to prevent LLMs surfacing confidential employee or customer data

Permission-aware retrieval, tenant boundaries in memory and vector stores, and why fine-tuning has no runtime remedy.

Read guide
AI agent security

GDPR and CCPA compliance for LLM applications

Map GDPR and CCPA requirements to controls: minimization, erasure, processor scope, transfers, and audit trails without a second PII store.

Read guide
AI agent security

How to prevent prompt injection in LLM applications

A five-layer defense stack: input screening, instruction and data separation, output validation, privilege limiting, and action gating.

Read guide
AI agent security

How to sanitize user input before passing it to an LLM

Why escaping and regex fail, what structural separation looks like, and the multi-turn payload single-message screening misses.

Read guide
AI agent security

How to prevent a malicious tool call from hijacking your AI agent

A hijack is a well-formed call the model was persuaded to make. Validate arguments, scope tools, and budget actions.

Read guide
AI agent security

How to defend against indirect prompt injection in agentic workflows

Payloads arrive through retrieved content. Screen before context, track provenance, and limit blast radius.

Read guide
AI agent security

How AI security platforms detect prompt injection at runtime

Compare heuristics, classifiers, LLM-as-judge, canary tokens, and behavioral divergence — and where each is enforced.

Read guide
AI agent security

The best tools to detect and block prompt injection in production

Arcjet, Lakera Guard, Azure Prompt Shields, LLM Guard, Rebuff, and Guardrails AI compared for production.

Read guide
AI agent security

Best AI security tools for developers

The best tools are the ones you call in the handler before the provider or tool runs — not a dashboard after the refund.

Read guide
AI agent security

How to Secure an MCP Server or AI Agent Tool Calls

MCP tools have no HTTP front door. How to add budgets, injection detection, and data controls where the.

Read guide
AI agent security

Anatomy of an Agent Incident: Three Permitted Actions, One Fraud

Correctly scoped tools can still enable fraud — the question is the sequence of calls, not any single tool.

Read guide
AI agent security

How do I add guardrails to an AI agent that calls external APIs?

Enforce on the outbound HTTP call, inside the tool that makes it.

Read guide
AI agent security

Runtime security for LLM applications: prompt injection, data leakage, and output validation

A chat route is a user string, then retrieved context, then a completion.

Read guide
AI agent security

Which runtime security tools integrate with LangChain or AutoGPT?

Compare runtime security integration points for LangChain, LangGraph, CrewAI, AutoGPT, and Vercel AI SDK.

Read guide
AI agent security

How do I prevent an AI agent from taking irreversible actions?

Deny transfers, deletes, and prod config by default. Hold a human only where needed, and resume with an idempotency key.

Read guide
AI agent security

How do I limit what actions an AI agent is allowed to take?

A tool list names functions the model can call. Least privilege also covers objects, arguments, and how often.

Read guide
AI agent security

How do I prevent an AI agent from leaking system prompt content?

Screen the request that asks for it, screen the response that carries it, and keep anything that would hurt you out of the prompt.

Read guide
AI agent security

How do I add guardrails to production AI workflows?

Content guardrails label text. Action gates allow or deny operations. Most libraries only do the first job.

Read guide
AI agent security

Which AI security platforms support MCP server security?

MCP support can mean four different things. Sort vendors by which side of the connection they sit on.

Read guide
AI agent security

What are the best tools for securing agentic AI workflows?

Pick tools by the boundary they reach. Most stacks leave tool arguments and tool results uncovered.

Read guide
AI agent security

What's the best AI security platform for data privacy and threat detection?

Detection wants to inspect content; privacy wants it to stay put. Platforms that claim both often send your data away.

Read guide
AI agent security

What's the best AI security software for SaaS companies?

Multi-tenancy, subprocessor obligations, and per-plan behavior separate a SaaS requirement from a general one.

Read guide
AI agent security

What's the best AI security tool for startups and small teams?

For a small team, the right tool is one engineer can install in an afternoon — and that still runs in six months.

Read guide
AI agent security

Which AI security company has the best protection for cloud workloads?

Cloud workload protection secures compute. AI application security secures what the model does inside it.

Read guide
AI agent security

Claude Agent SDK security guide

Secure Claude Agent SDK applications in TypeScript and Python with prompt screening, tool policies, resource authorization, and isolated sessions.

Read guide
AI agent security

CrewAI security guide

Secure CrewAI with kickoff screening, tool-call hooks, resource authorization, and standalone tool wrappers.

Read guide