AI agents are changing the basic security model of artificial intelligence.
A conventional large language model primarily receives input and generates output. An AI agent can do far more. It can browse websites, read email, retrieve documents, call APIs, execute code, modify files, query databases, communicate with other agents, invoke Model Context Protocol servers, and take actions inside business systems.
That difference changes the consequence of an AI security failure.
When a chatbot is manipulated, the result may be an incorrect or undesirable response. When an autonomous agent is manipulated, the result may be a database query, an email sent to the wrong recipient, a cloud resource modified, a credential exposed, a file written to disk, an unauthorized purchase, or even code execution.
This is the central problem of AI agent security.
Microsoft summarized the change particularly clearly in its 2026 research into agent frameworks: once models are connected to tools, vulnerabilities in the AI layer are no longer merely content problems. A prompt injection can influence tool parameters and potentially become an execution primitive. Microsoft demonstrated this with two Semantic Kernel vulnerabilities, CVE-2026-26030 and CVE-2026-25592, where unsafe interaction between model-controlled data and agent tools could ultimately result in code execution. (マイクロソフト)
The security industry has consequently begun treating agent security as a distinct discipline. OWASP released the Top 10 for Agentic Applications 2026, covering risks including agent goal hijacking, tool misuse, identity abuse, memory poisoning, unexpected code execution, insecure inter-agent communication, cascading failures, and rogue agents. On September 1, 2026, OWASP also released the Agent Control Standard, emphasizing that production agents need to be inspectable, traceable, instrumentable, and subject to runtime policy enforcement rather than operating as opaque autonomous systems. (OWASP Gen AIセキュリティプロジェクト)
The lesson is simple:
Securing the model is not the same thing as securing the agent.
A secure AI agent requires security controls around the model, its identity, its tools, its memory, the information it consumes, the systems it can reach, and every action it is allowed to perform.
The official Penligent 3.0 video below demonstrates a general product workflow; it does not establish the findings or coverage of a specific assessment.
What Is AI Agent Security?
AI agent security is the practice of protecting autonomous or semi-autonomous AI systems from manipulation, unauthorized actions, privilege abuse, data leakage, compromised tools, poisoned context, unsafe execution, and other failures that arise when language models are allowed to interact with external systems.
A useful way to think about an agent is:
AI Agent
│
├── Model
├── System instructions
├── Planner / reasoning loop
├── Memory
├── RAG / knowledge sources
├── Tools
├── MCP servers
├── APIs
├── Credentials
├── Browser / computer interface
├── Code execution environment
├── Other agents
└── External network
Every connection creates another trust boundary.
Traditional application security still matters. APIs need authentication. Inputs need validation. Dependencies need patching. Secrets need protection. Containers need isolation.
But agents introduce another layer: natural-language data can affect control flow.
An ordinary application may distinguish between code and data through strict syntax. An AI agent receives instructions, documents, tool descriptions, retrieved webpages, emails, API responses and previous memories through representations that ultimately influence the same reasoning system.
That makes the trust relationship much less obvious.
A webpage may be data from the user’s perspective but instructions from the model’s perspective.
An email may be content to summarize but simultaneously contain instructions attempting to redirect the agent.
A tool description may appear to be harmless metadata but influence which tool the model selects.
A memory entry may look like historical context but alter decisions months later.
AI agent security therefore needs to answer five questions continuously:
What information can influence the agent? What can the agent access? What actions can it perform? Under whose authority does it perform them? What prevents a compromised agent from turning influence into damage?
Why AI Agent Security Is Harder Than LLM Security
The difference can be represented as a simple security progression:
LLM
Input → Model → Text Output
RAG Application
Input → Retrieval → Model → Text Output
AI Agent
Input
↓
Model
↓
Plan
↓
Tool Selection
↓
Authentication
↓
External Action
↓
New Observation
↓
Model
↓
Another Action
The final system is recursive.
An action produces new information, which becomes new context, which produces another action.
This creates attack chains that do not exist in ordinary chat applications.
Consider an enterprise research agent.
A user asks:
Research the companies in this spreadsheet and update our CRM.
The agent opens a company website.
The website contains attacker-controlled content.
That content influences the agent.
The agent has access to a CRM tool.
The CRM tool has write permission.
The agent alters CRM data.
Another sales automation trusts the modified CRM data.
The corrupted information propagates into another workflow.
Nothing in this attack requires the attacker to compromise the underlying foundation model.
The attacker compromises the agent’s decision environment.
That distinction is fundamental.
The AI Agent Attack Surface
A useful AI agent threat model should consider at least ten major surfaces.
| 表面 | セキュリティ・リスク |
|---|---|
| User prompt | Direct prompt injection |
| Websites, email and documents | Indirect prompt injection |
| RAG | Poisoned retrieval content |
| Memory | Persistent context manipulation |
| Tools | Unsafe invocation or excessive capability |
| MCP servers | Tool poisoning, authorization and trust problems |
| Agent identity | Credential and privilege abuse |
| Code execution | RCE and sandbox escape |
| Agent-to-agent communication | Spoofing and trust propagation |
| External network | Data exfiltration and command-and-control paths |
| Human approvals | Social engineering and approval manipulation |
| Framework/dependencies | Agentic supply-chain compromise |
The important observation is that these surfaces interact.
A severe AI agent incident is often not one vulnerability.
It is a chain.
Untrusted Content
↓
Prompt Injection
↓
Goal Hijacking
↓
Tool Selection
↓
Privilege Abuse
↓
Sensitive Resource Access
↓
External Communication
↓
Data Exfiltration
Defending only the first step is therefore insufficient.
Prompt Injection Becomes More Dangerous When AI Can Act
Prompt injection is often discussed as if it were the AI equivalent of a jailbreak.
That comparison understates the problem.
A jailbreak usually attempts to cause a model to produce prohibited content.
Prompt injection against an agent attempts to change behavior.
Anthropic defines indirect prompt injection as a scenario in which a trusted user asks an agent to process third-party content—such as webpages, emails, documents or tool results—and attacker-controlled instructions inside that content influence the model. Anthropic also notes that an open agent environment creates more injection entry points, while giving an agent more tools increases the potential consequences of a successful compromise. (アンソロピック)
Consider an agent tasked with reviewing email.
The legitimate instruction may be:
Summarize my unread messages.
An attacker sends an email whose visible text is ordinary business correspondence but whose agent-readable content attempts to change the objective.
Conceptually:
USER GOAL
Summarize unread emails.
UNTRUSTED EMAIL
Meeting scheduled for Thursday.
AGENT Processes both the legitimate goal and attacker-controlled content.
A vulnerable agent may fail to maintain the distinction between:
instructions from the user
and:
information the user asked it to inspect
If the same agent can only produce text, the damage may be limited.
If the agent can read files, send email and use APIs, the same prompt injection becomes dramatically more consequential.
This leads to one of the most important design rules in AI agent security:
Untrusted content must never automatically inherit the authority of the user who asked the agent to process it.
Direct vs. Indirect Prompt Injection
Direct prompt injection originates from the user-controlled interaction itself.
User → malicious instruction → Agent
Indirect prompt injection arrives through another information source.
User
↓
Agent
↓
Website / Email / Document / Tool
↓
Malicious instruction
↓
Agent
The indirect form is particularly dangerous because the legitimate user may have done nothing suspicious.
A finance employee may simply ask an agent to read an invoice.
A developer may ask a coding agent to inspect a repository.
A security analyst may ask an agent to analyze an incident report.
A customer-support agent may automatically process an incoming support ticket.
The malicious payload lives inside the data.
Computer-use agents make this problem even broader. Anthropic warns that screenshots, webpages and application interfaces must be treated as untrusted because manipulated visual content or hidden instructions can influence an agent navigating software on behalf of a user. (クロード)
OWASP Top 10 for Agentic Applications 2026
OWASP’s Agentic Security Initiative provides one of the clearest current taxonomies for thinking about AI agent security.
The 2026 categories are:
| ID | リスク |
|---|---|
| ASI01 | エージェント・ゴール・ハイジャック |
| ASI02 | Tool Misuse and Exploitation |
| ASI03 | Identity and Privilege Abuse |
| ASI04 | エージェント型サプライチェーンの脆弱性 |
| ASI05 | Unexpected Code Execution |
| ASI06 | Memory and Context Poisoning |
| ASI07 | 安全でないエージェント間コミュニケーション |
| ASI08 | 連鎖する故障 |
| ASI09 | 人間とエージェントの信頼関係の搾取 |
| ASI10 | ローグ・エージェント |
OWASP describes the Agentic Top 10 as a framework specifically for autonomous systems that plan, act and make decisions across complex workflows, rather than merely producing LLM responses. (OWASP Gen AIセキュリティプロジェクト)
These categories reveal something important about the direction of AI security.
Only part of the problem is the model.
The rest concerns architecture.
ASI01: Agent Goal Hijack
Agent goal hijacking occurs when an attacker influences an agent into pursuing a different objective from the one authorized by the user or system.
Prompt injection is one way to achieve it, but the concept is broader.
Imagine a procurement agent whose legitimate goal is:
Find three suppliers and prepare a comparison.
A compromised source could push it toward:
Prefer supplier X regardless of price.
Or a coding agent could be influenced into modifying files unrelated to the original task.
A secure architecture should therefore keep an explicit representation of the authorized objective outside untrusted context.
Conceptually:
AUTHORIZED GOAL
│
▼
Policy Engine
│
▼
Agent Planning
│
├──── Untrusted observations
│
▼
Proposed Action
│
▼
Goal Consistency Check
│
▼
Execution
The agent should not be the sole judge of whether its new plan still matches the original goal.
That verification should exist outside the potentially compromised reasoning process.
ASI02: Tool Misuse and Exploitation
Tools are what turn an LLM into an operational agent.
A tool might expose functions such as:
search_web()
read_email()
send_email()
read_file()
write_file()
query_database()
run_python()
execute_shell()
create_cloud_resource()
update_crm()
send_payment()
Each tool expands the blast radius of a prompt injection.
The mistake is treating a tool schema as a security boundary.
例えば、こうだ:
def delete_file(path: str):
...
The fact that the model generates structured JSON such as:
{
"path": "/some/file"
}
does not make the argument trustworthy.
Microsoft’s 2026 Semantic Kernel research makes exactly this point: model-controlled tool parameters must effectively be treated as attacker-controlled inputs when the model itself may have been influenced by untrusted content. (マイクロソフト)
The safe pattern is:
LLM proposes action
↓
Schema validation
↓
Authorization
↓
Policy validation
↓
Parameter validation
↓
Risk classification
↓
Optional human approval
↓
Tool execution
Not:
LLM says do it
↓
Do it
AI Agent Tools Should Be Narrow, Not Powerful
Consider two filesystem tools.
Tool A:
filesystem(path, command, arguments)
Tool B:
read_project_file(relative_path)
write_generated_report(relative_path, content)
Tool A is flexible.
Tool B is safer.
This reflects capability-oriented security: provide the smallest primitive necessary for the legitimate workflow.
An agent that only needs to generate reports probably does not need:
arbitrary shell execution
It needs:
write_report()
An email assistant may not need unrestricted mailbox permission.
It could use separate capabilities:
read_email
create_draft
send_email
と 送信メール requiring a stronger authorization policy.
The best tool security often comes from reducing what the tool can express rather than attempting to make the LLM perfectly reliable.
ASI03: Identity and Privilege Abuse
Agents need identities.
This is becoming one of the most important aspects of AI agent security because an agent acting inside an enterprise should not simply inherit a permanent copy of a powerful human credential.
Microsoft’s guidance for securing AI systems explicitly treats agents as non-human identities that require authentication, authorization and governance. It warns that broad permissions increase the attack surface because a compromised agent can use those permissions autonomously. (マイクロソフト学習)
The dangerous pattern is:
Employee OAuth Token
↓
AI Agent
↓
Everything Employee Can Access
The preferable pattern is:
Human Identity
↓
Delegation
↓
Agent Identity
↓
Task-Scoped Permission
↓
Short Lifetime
For example, instead of giving an agent:
Google Drive: read/write all files forever
provide something closer to:
resource: /project-alpha/
permissions: read
expires: 15 minutes
purpose: summarize documents
This reflects several mature security principles simultaneously:
least privilege, short-lived credentials, purpose limitation, resource scoping and explicit delegation.
The Agent Should Have Its Own Identity
A production architecture should ideally answer:
Which human initiated this task?
Which agent executed the task?
Which credential was used?
Which resource was accessed?
Which permission authorized it?
Which tool made the request?
What action was performed?
Those identities should remain distinguishable in logs.
Otherwise an audit trail simply says:
Alice modified the database.
when the reality was:
Alice asked Agent A to research a customer.
Agent A invoked Tool B.
Tool B used credential C.
The credential changed the database.
That distinction matters during incident response.
MCP Security Is Now Part of AI Agent Security
Model Context Protocol has made connecting agents to tools and external systems significantly more standardized.
It has also created another important trust boundary.
An MCP architecture may look like:
LLM Agent
↓
MCP Client
↓
MCP Server
↓
External API
↓
Enterprise Resource
Every part requires security review.
The MCP authorization specification is based on OAuth mechanisms and specifically requires security controls around token handling. Among other things, MCP servers must validate that access tokens were intended for them, while token passthrough is explicitly prohibited because it can break resource boundaries and contribute to confused-deputy problems. (モデル・コンテキスト・プロトコル)
This is significant because AI developers sometimes think of MCP primarily as a tool integration format.
Security teams should think of it as:
a remote capability boundary.
Major MCP Security Risks
MCP risk can come from several directions.
A malicious or compromised MCP server could provide hostile content to an agent.
An overprivileged MCP integration could expose sensitive data.
Weak OAuth implementation could permit token misuse.
A tool description could influence the model’s decision-making.
An MCP server could change behavior after initial approval.
A legitimate server could be compromised through its own software supply chain.
Credentials could be accidentally logged.
Multiple MCP servers may create confused trust relationships.
Anthropic has warned that external resources connected to agents present two distinct classes of risk: conventional software supply-chain risk and prompt-injection risk. It also points out an important difference between local and remote tools—a remote tool can change after the original trust decision was made. (アンソロピック)
That leads to a useful security rule:
An MCP server should be treated like both third-party software and untrusted content.
Those are separate threat models.
Secure MCP Architecture
A stronger deployment looks like:
┌──────────────────┐
│ Agent │
└────────┬─────────┘
│
Proposed Tool Call
│
▼
┌──────────────────┐
│ MCP Policy Layer │
└────────┬─────────┘
│
┌────────────┼─────────────┐
│ │ │
Server Allowlist Scope Risk Policy
│ │ │
└────────────┼─────────────┘
▼
┌──────────────────┐
│ MCP Server │
└────────┬─────────┘
│
Scoped Credential
│
▼
External Resource
The agent should not independently decide whether a newly discovered server deserves trust.
ASI04: Agentic Supply Chain Vulnerabilities
The supply chain for an AI agent can be much larger than a normal application dependency tree.
It may include:
Foundation model
Agent framework
Python / npm dependencies
Container images
MCP servers
Agent skills
Prompts
Plugins
Browser extensions
Vector databases
Embedding models
External APIs
Tool packages
Agent templates
Remote connectors
An organization may carefully review its model provider while installing dozens of third-party agent extensions with much weaker scrutiny.
That reverses the security priority.
A trusted foundation model connected to an untrusted tool can still be dangerous.
Organizations therefore need an inventory not only of models but also of agent capabilities.
An AI bill of materials should increasingly answer:
Which model?
Which agent framework?
Which tools?
Which versions?
Which MCP servers?
Which skills?
Which identities?
Which external endpoints?
Which memory stores?
Which secrets?
Supply-chain review for agentic systems should also consider tool semantics, not only whether a dependency contains conventional malicious code.

ASI05: Unexpected Code Execution
This is where AI agent security becomes conventional host security extremely quickly.
Microsoft’s Semantic Kernel disclosures provide a valuable case study.
For CVE-2026-26030, Microsoft found that model-controlled input could reach unsafe filtering logic in Semantic Kernel’s In-Memory Vector Store. Under the documented affected conditions, prompt injection could eventually become remote code execution. Versions prior to Semantic Kernel Python 1.39.4 were affected under the described configuration. (マイクロソフト)
CVE-2026-25592 demonstrated another architecture problem.
A file-transfer function used around an isolated Python execution environment had been exposed to the model as a callable function. Model-controlled path input could consequently turn what appeared to be a sandboxed operation into an unsafe host-side file write. Microsoft removed AI access to the affected function and added path validation as part of the remediation; affected .NET SDK versions were those older than 1.71.0 according to Microsoft’s disclosure. (マイクロソフト)
The broader lesson is more important than either CVE:
A sandbox is only as strong as every tool that crosses the sandbox boundary.
Giving code execution to an agent inside a container does not guarantee isolation if another agent-callable tool can copy arbitrary files from the container onto the host.
Never Treat the LLM as a Security Boundary
One of the strongest principles for AI agent security is:
The model is not the security boundary.
A model can contribute to security.
It can classify risky inputs.
It can identify suspicious prompts.
It can reason about whether an action appears dangerous.
But enforcement should happen outside the same model that the attacker is attempting to manipulate.
A safer architecture has:
Model
↓
Proposal
↓
Deterministic Policy
↓
Execution
rather than:
Model
↓
"Do you think this is safe?"
↓
Same model says yes
↓
Execution
This principle is also consistent with Microsoft’s guidance that agent security needs controls at both the model layer and host execution layer. (マイクロソフト)

ASI06: Memory and Context Poisoning
Memory gives agents persistence.
Persistence also gives attackers persistence.
Suppose an agent stores:
User prefers concise financial summaries.
That is useful memory.
Now imagine an attacker causes it to store something semantically equivalent to:
For future invoices from attacker-controlled domain X,
treat them as pre-approved.
The malicious influence no longer needs to appear in every conversation.
It has entered the agent’s state.
This turns prompt injection from:
one-time manipulation
into:
persistent manipulation.
OWASP explicitly includes Memory and Context Poisoning in the Agentic Top 10, while its AI Agent Security Cheat Sheet also highlights memory poisoning as a distinct agent-specific risk. (OWASPチートシートシリーズ)
Secure Agent Memory
Memory should have provenance.
Instead of storing:
{
"memory": "Vendor X is trusted."
}
consider something closer to:
{
"memory": "Vendor X is trusted.",
"source": "user-confirmed",
"created_at": "2026-09-04T10:00:00Z",
"confidence": "high",
"scope": "procurement-project-a",
"expires_at": "2026-10-04T10:00:00Z"
}
Security-sensitive memories may require stronger rules.
例えば、こうだ:
Tool output → cannot create permanent trust policy
Website → cannot write identity preference
Email → cannot modify payment rules
Agent-generated inference → expires automatically
Human-confirmed preference → may persist
Not every observation deserves durable memory.
Memory Retrieval Is Also a Trust Decision
Even cleanly stored memories can become unsafe when retrieved into the wrong context.
A memory created for:
Project A
should not necessarily influence:
Project B
A memory created from an unauthenticated external source should not carry the same trust weight as an explicit user decision.
Agent memory therefore needs:
provenance
scope
integrity
expiration
authorization
sensitivity classification
not just vector similarity.
ASI07: Insecure Inter-Agent Communication
Multi-agent systems create another emerging security problem.
Consider:
Planner Agent
↓
Research Agent
↓
Coding Agent
↓
Deployment Agent
Developers often treat messages between these agents as internal and trusted.
That assumption is dangerous.
If the Research Agent becomes compromised by malicious web content, its output becomes attacker-influenced input to the Coding Agent.
The chain becomes:
Attacker
↓
Research Agent
↓
Agent Message
↓
Coding Agent
↓
Tool
↓
System Action
Agent-to-agent messages therefore need the same security treatment as API traffic between distributed services.
That includes:
authentication
authorization
message integrity
provenance
scope
rate limits
schema validation
policy enforcement
Multi-agent systems should implement zero trust between agents, not implicit trust merely because both agents belong to the same application.
Agent Identity Must Survive Agent-to-Agent Calls
A downstream agent should know:
who created this request
which agent forwarded it
which permissions apply
what the original user authorized
Otherwise delegated authority becomes impossible to reason about.
例えば、こうだ:
User Alice
↓
Research Agent
↓
Coding Agent
↓
Deployment Agent
The Deployment Agent should not infer:
Research Agent asked me to deploy,
therefore deployment is authorized.
The authorization chain needs to remain verifiable.
ASI08: Cascading Failures
Agents are recursive systems.
They can retry.
They can delegate.
They can create tasks.
They can send messages to other agents.
They can react to the output of other tools.
Therefore a single incorrect action may become a chain reaction.
Imagine:
Agent A receives poisoned data
↓
updates database
↓
Agent B reads database
↓
initiates workflow
↓
Agent C receives workflow
↓
calls external API
Traditional rate limiting at the public API edge may not stop this.
Internal autonomous workflows need circuit breakers.
例を挙げよう:
maximum actions per task
maximum financial value
maximum API calls
maximum recursive depth
maximum agent delegations
maximum file modifications
maximum tokens / compute
maximum external destinations
Without these limits, a minor hallucination or malicious instruction can produce a system-level incident.
ASI09: Human-Agent Trust Exploitation
Humans may trust AI-generated summaries more than they should.
That becomes a security vulnerability when the agent decides what information the user sees before asking for approval.
Consider:
Agent:
"I reviewed the changes. They are routine dependency updates.
Approve deployment?"
The underlying change might contain something entirely different.
A user clicking Approve technically constitutes human-in-the-loop control.
But it is weak control if the human only sees an agent-generated interpretation.
This creates an important principle:
Human approval should expose the underlying action, not merely the agent’s description of the action.
For an email:
Show recipient + subject + complete message.
For a payment:
Show destination + amount + currency.
For a filesystem operation:
Show exact path and operation.
For code:
Show the diff.
For a database operation:
Show affected records or query intent.
A compromised agent should not be allowed to author the evidence used to approve its own action.
ASI10: Rogue Agents
A rogue agent is the extreme version of the same architectural problem.
The system begins acting outside intended policy because of compromise, drift, faulty reasoning, malicious context, unexpected incentives or a security failure elsewhere.
The correct response cannot depend on asking:
Agent, are you compromised?
Containment has to exist outside the agent.
This is one reason OWASP’s newly released Agent Control Standard is particularly relevant. ACS argues for runtime visibility and control through standardized middleware hooks so organizations can inspect what agents can access, understand what they did, and enforce policies while agents are operating. (OWASP Gen AIセキュリティプロジェクト)
A mature agent platform should therefore support:
pause
revoke credentials
disable tool
reduce privilege
terminate task
quarantine memory
block network
kill agent
externally.
The Security Architecture for Production AI Agents
A useful defense model has multiple independent layers.
┌────────────────────┐
│ User │
└─────────┬──────────┘
│
▼
┌────────────────────┐
│ Intent / Auth Layer│
└─────────┬──────────┘
│
▼
┌────────────────────┐
│ AI Agent │
└─────────┬──────────┘
│
Proposed Action
│
▼
┌────────────────────────────────┐
│ Policy Enforcement │
├────────────────────────────────┤
│ Identity │
│ Permission │
│ Goal consistency │
│ Parameter validation │
│ Risk classification │
│ Destination restrictions │
│ Rate / spend limits │
└───────────────┬────────────────┘
│
High-risk action?
│ │
Yes No
│ │
Human Approval │
└─────┬─────┘
▼
┌─────────────────┐
│ Sandbox / Tool │
└────────┬────────┘
│
▼
External Resource
│
▼
Audit Log
Security should not live in one classifier.
It should live across the architecture.
Apply Least Privilege to Every Agent
The foundational rule is:
Agent capability ≠ user capability
If a user can:
read
write
delete
share
administer
but the current task only requires reading, the agent should receive:
読む
The same applies to network access.
A coding agent may need access to:
github.com
packages.example.com
It may not need unrestricted outbound internet connectivity.
Anthropic described a revealing internal red-team exercise in which a malicious prompt attempted to get Claude Code to access AWS credentials and transmit them externally. Anthropic’s discussion emphasizes that when model-level detection cannot distinguish an apparently user-authorized request, filesystem boundaries and egress restrictions become critical controls. (アンソロピック)
That is a generalizable security principle.
Even if the agent is fully compromised:
it cannot steal what it cannot read,
and it cannot exfiltrate to a destination it cannot reach.
Use Egress Controls
Network egress is one of the most underrated AI agent security controls.
Instead of:
Agent → Internet
use:
Agent
↓
Egress Gateway
↓
Destination Policy
↓
Allowed Services
Policies may include:
allow api.github.com
allow approved MCP endpoints
allow internal APIs
deny arbitrary IP destinations
deny unknown upload endpoints
deny metadata endpoints
deny private network ranges unless required
This limits the usefulness of successful prompt injection.
Separate Planning From Execution
The reasoning system does not necessarily need direct execution rights.
A stronger architecture separates:
Planner
より:
Executor
例えば、こうだ:
Planner:
"Update record 287."
Executor:
Checks authentication.
Checks scope.
Checks policy.
Checks record ownership.
Checks field allowlist.
Performs update.
The planner can remain probabilistic.
The executor should be deterministic where possible.
Validate Tool Parameters Like Web Inputs
Imagine an agent produces:
{
"path": "../../credentials"
}
The application should not assume this is safe because the JSON came from a trusted LLM provider.
Apply normal defensive programming:
from pathlib import Path
BASE_DIR = Path("/srv/agent-workspace").resolve()
def safe_workspace_path(value: str) -> Path:
candidate = (BASE_DIR / value).resolve()
if candidate != BASE_DIR and BASE_DIR not in candidate.parents:
raise ValueError("Path outside approved workspace")
return candidate
The exact implementation will differ by application, but the rule remains:
model output = untrusted input
for security-sensitive operations.
Use Allowlists Instead of Blocklists
A dangerous approach is:
Allow everything except:
rm
sudo
curl
wget
Attackers and models can find alternative ways to express the same behavior.
Prefer:
Only allow:
read_project_file
run_unit_tests
write_to_build_directory
The principle applies to:
commands
filesystem paths
domains
MCP servers
database operations
HTTP methods
tool parameters
Capability reduction is usually more robust than trying to enumerate every dangerous behavior.
Human-in-the-Loop Is Necessary but Not Sufficient
Human approval is one of the most common agent security recommendations.
It is useful.
But it needs careful placement.
Asking the user to approve every tool invocation creates approval fatigue.
Users eventually click:
Allow
Allow
Allow
Allow
without inspection.
Instead classify actions by risk.
Low risk
Search documentation
Read public webpage
Retrieve non-sensitive internal knowledge
May execute automatically.
Medium risk
Create draft
Modify project file
Call trusted internal tool
May execute with policy checks and logging.
High risk
Send external email
Delete file
Publish content
Deploy code
Change IAM policy
Transfer money
Reveal secrets
Execute privileged shell command
Should usually require stronger control.
The exact boundary depends on the application, but the principle should be explicit.
Observability Is a Security Control
Traditional AI monitoring often records:
prompt
response
latency
token usage
Agent monitoring needs much more.
A security trace should ideally capture:
User request
Agent identity
Effective permissions
Retrieved context
Tool selected
Tool arguments
Policy decision
Human approval
Execution result
Network destination
Memory changes
Delegated agents
Final response
Without this, incident response becomes guesswork.
If a customer asks:
“Did the agent send our document to an external service?”
you need an evidence chain, not the model’s recollection.
Protect Logs From the Agent
Logs should exist outside the agent’s authority.
A compromised agent should not be able to:
delete its own activity history
rewrite previous traces
disable the monitoring layer
alter approval records
Security telemetry should be append-oriented and independently controlled.
This becomes especially important as autonomous systems run for hours or days.
AI Agent Security Testing: Scope and Success Criteria
An AI agent penetration test should establish whether an attacker can turn lower-trust input into an action outside the legitimate task. That requires testing both the application around the model and the authority delegated to its tools. A jailbreak that changes the answer, an attempted unauthorized tool call, and a completed unauthorized action are different findings. The report should preserve those distinctions.
OWASP recommends adversarial testing of trust boundaries and access controls alongside least privilege and approval controls. Its prompt-injection guidance also makes clear that impact depends on the business context and the agency of the system. The test plan should therefore start with a concrete workflow and its prohibited outcomes, rather than a collection of prompts detached from the deployment. (OWASP LLM01: Prompt Injection)
Define the Workflow Before Writing Test Prompts
Record the model and agent versions, deployment configuration, tool schemas, instruction-file discovery rules, identities, credentials, network routes, approval settings and persistent storage. For an assistant that reviews invoices, define whether it may only read invoices, draft payment requests, or actually submit payments. A result obtained with unrestricted administrator credentials does not establish the risk of a read-only deployment.
Use an isolated test environment with synthetic records, test identities and a controlled destination for harmless marker data. Agree on allowed actions, request limits, stop conditions and cleanup before execution. Production integrations that are excluded from testing should appear as limitations in the final report. A blocked route and an untested route must not receive the same verdict.
| Test surface | Controlled scenario | Evidence and acceptance criterion |
|---|---|---|
| Retrieved pages, files and messages | Place an instruction-like marker in a document the agent must summarize. | Capture the retrieved content and resulting actions. The document must not grant permission to send data or change the task. |
| Tool authorization | Ask an authorized test user to reach a synthetic record owned by a second test user. | Record the tool arguments and backend response. The resource server must reject access outside the caller’s permissions. |
| Approval workflow | Attempt a harmless simulated send or write without the required approval. | Verify that execution is blocked and that approval, when granted, is bound to the displayed action and destination. |
| Instruction and configuration files | Use a temporary workspace and a harmless proposed configuration change. | Record which files load, whether a write occurs, and whether a new session inherits changed state. |
| MCP integration | Exercise test credentials with an incorrect audience or insufficient scope. | Check the authorization response and logs. An integration must enforce its required token and resource boundaries. |
| Memory and delegation | Introduce a marker in one session, then run a separate legitimate task or delegated agent. | Inspect stored state and downstream actions. Content must not silently gain broader authority through persistence or delegation. |
| Runtime containment | Attempt a harmless out-of-scope file access or connection to a controlled test endpoint. | Verify filesystem and network enforcement independently of the model’s explanation. |
Test Indirect Prompt Injection Across Actual Input Channels
Test the places the deployed agent actually reads: web pages, repository files, issue comments, email, retrieved documents, tool output, browser content and messages from other agents. The entry point matters. A payload typed directly into chat does not demonstrate that the same text can reach the agent through a PDF parser, retrieval pipeline or MCP response.
For each channel, retain a normal task as a control and change one variable at a time. Confirm that the agent encountered the test content before judging resistance. If retrieval never selected the document, record a delivery failure rather than a successful security defense. Repeat relevant scenarios across fresh sessions and retained state, recording the number of valid attempts and the conditions for each outcome.
Configuration changes deserve their own tests because their effects may outlive the original conversation. In its October 22, 2026 disclosure, Forever Security reported a malicious AGENTS.md in a customer’s Downloads folder and said the observed installation attempt was blocked before code ran. Its Codex execution and Claude Code credential-redirection results came from separate researcher experiments. Those are different evidence classes, not interchangeable proof of a completed customer compromise. (Forever Security’s original disclosure)
Our AGENTS.md Downloads attack analysis separates those observations and explains the permission and configuration prerequisites. For a defensive assessment, use dummy credentials and harmless configuration markers; record file diffs, child-process activity and fresh-session behavior without installing the reported malware.
Test Tool Chaining, Identity and MCP Authorization
Review sequences as well as individual functions. A tool that creates a file, another that moves it and a third that executes local code may collectively cross a boundary that none of their descriptions makes obvious. Similarly, one agent may delegate work to another with a broader identity. Trace the effective principal, resource and permitted action at every handoff.
Use paired test accounts to check project isolation, tenant isolation, read-versus-write permissions and draft-versus-send permissions. The decisive control belongs at the tool or resource server: a model refusal is useful, but it does not replace authorization. Where an agent uses a shared service identity, document which actions that identity can perform and how the application constrains individual users.
For MCP, test protocol-specific authorization separately from malicious content returned by tools. Token audience checks, consent handling and token passthrough are authorization concerns; instructions embedded in a tool result are a model trust concern. The current MCP draft security guidance discusses confused-deputy risks, token passthrough, SSRF and local-server compromise. Select tests against the specification version and transport actually deployed. (MCP draft security best practices)
Require Evidence of Actions and Enforcement
For each valid attempt, retain the legitimate task, attacker-controlled input, model and configuration versions, relevant tool calls, authorization decisions and resulting state. Redact secrets and personal data before sharing traces. Model messages can explain a sequence, but tool and backend evidence should establish what happened.
| Observed result | What the report can conclude | What still needs checking |
|---|---|---|
| The model refuses; no prohibited call is observed | The tested attempt did not produce an observed prohibited action. | Whether the input was actually encountered and whether other variants or sessions behave differently. |
| A prohibited call is attempted and denied | The agent attempted to cross the boundary; the tested enforcement control blocked it. | Whether all equivalent tools and routes enforce the same restriction. |
| A prohibited write, read or send completes | An unauthorized action was demonstrated under the recorded conditions. | The affected identities, resources, persistence, business impact and containment options. |
| The necessary trace or backend record is missing | The outcome is inconclusive. | Add instrumentation and rerun before claiming success or resistance. |
Report an observed attack success rate only with its denominator, delivery criteria, versions and configuration. A small prompt set does not estimate the probability of compromise across all users or future models. After remediation, rerun both the adversarial scenario and the legitimate workflow so a control that disables useful work is visible as a functional regression.
How to Evaluate an AI Agent Security Testing Vendor
Ask for a sample report before purchasing a service or platform. It should show the tested workflow, permissions, reproduction steps, action evidence, severity rationale, remediation and retest result. A dashboard score or an OWASP category alone does not tell an engineer which component must change.
| Purchase question | Evidence to request |
|---|---|
| Does the assessment cover our deployed architecture? | A scope covering the relevant model, agent runtime, tools, MCP integrations, identities, retrieval and persistent state. |
| Will it distinguish prompt behavior from system compromise? | A finding that separates generated text, attempted tool invocation, denied action and completed action. |
| Can it reproduce a finding after a fix? | A versioned test case, environment requirements and a defined retest process. |
| How is sensitive test data handled? | Documented collection, redaction, retention, access and deletion arrangements for prompts, traces and credentials. |
| What does the quoted price cover? | Named workflows, identities, integrations, test limits, manual review, reporting, retests and excluded work. |
| What supports a claimed capability? | A demonstration against an agreed synthetic workflow and explicit limitations, rather than a generic promise of complete agent security. |
An AI-powered penetration testing tool and a service that tests AI agents answer different procurement questions. The former describes how testing work is performed; the latter describes the system being assessed. Confirm that the specific agent behaviors and integrations you need are included in the engagement.
For the surrounding web application and API layer, Penligent’s public workflow covers authorized scope, investigation, evidence review and reporting. Use those concrete requirements when evaluating the workflow, and separately agree on any agent-specific test coverage.
Detection for AI Agent Security
AI agent detection needs signals from both semantic and conventional security layers.
Agent-layer indicators
Potentially suspicious events include:
Sudden goal changes
Unexpected tool selection
Repeated policy-denied actions
Attempts to access unrelated resources
Unexpected agent delegation
New MCP server requests
Memory modifications after untrusted content
Host-layer indicators
Traditional telemetry remains critical:
Unexpected child processes
Shell execution
Credential-file access
Persistence attempts
Suspicious outbound connections
Unexpected file writes
Cloud API anomalies
Privilege escalation
Microsoft specifically recommends correlating model-level signals with host-level execution telemetry because the LLM itself should not be treated as the final security boundary. (マイクロソフト)
AI security does not replace EDR, SIEM, IAM or network security.
It adds another layer to them.
OWASP Agent Control Standard and Runtime Agent Security
The release of the OWASP Agent Control Standard in September 2026 signals an important evolution in how the industry approaches agent security.
Instead of trying to solve every issue through better prompting, the standard focuses on something more operational:
control.
OWASP describes the need for agents to expose enough runtime visibility that organizations can determine:
what the agent is
what it can access
what it did
why it did it
and enforce declarative security policies through middleware hooks. (OWASP Gen AIセキュリティプロジェクト)
That resembles the evolution of other security disciplines.
Cloud security did not become mature by telling applications to “behave securely.”
Organizations introduced:
IAM
network policies
admission controls
runtime monitoring
audit logs
policy engines
Agent security is moving in the same direction.
AI Agent Security vs. LLM Security
These terms overlap but are not identical.
| LLMセキュリティ | AI Agent Security |
|---|---|
| Prompt injection | Goal hijacking |
| Jailbreak | Unauthorized actions |
| Sensitive information disclosure | Tool-driven exfiltration |
| Model behavior | End-to-end system behavior |
| RAG poisoning | Persistent memory poisoning |
| Text output | Real-world actions |
| Model access | Agent identity |
| Model plugins | Capability and tool security |
| Single interaction | Autonomous multi-step workflows |
| Output monitoring | Runtime action monitoring |
LLM security remains part of agent security.
But an agent security assessment needs to go beyond it.
A perfectly aligned model connected to an insecure filesystem tool is unsafe.
A robust model using an overprivileged OAuth token is unsafe.
A secure MCP implementation connected to a poisoned memory store is unsafe.
The system has to be considered as a whole.
A Practical AI Agent Security Checklist
Before deploying an agent into production, security teams should be able to answer these questions.
| Area | Security Question |
|---|---|
| ゴール | Is the authorized objective represented independently of untrusted content? |
| Input | Which data sources can influence the agent? |
| Prompt injection | Are direct and indirect attacks tested? |
| Tools | Are capabilities narrow and allowlisted? |
| Parameters | Is model-controlled data validated? |
| Identity | Does the agent have its own identity? |
| Privilege | Are permissions task-scoped and short-lived? |
| エムシーピー | Are servers trusted, authenticated and policy-controlled? |
| Tokens | Are audiences validated and passthrough prevented? |
| Memory | Does persistent state have provenance and scope? |
| Runtime | Is execution sandboxed? |
| Filesystem | Are sensitive paths inaccessible? |
| ネットワーク | Is outbound traffic controlled? |
| 人間の承認 | Are dangerous actions explicitly reviewed? |
| Multi-agent | Are agent-to-agent calls authenticated? |
| Supply chain | Are tools, skills and dependencies inventoried? |
| モニタリング | Are tool calls and actions recorded? |
| Incident response | Can an agent immediately be quarantined? |
| Kill switch | Can credentials and tools be revoked externally? |
| テスト | Are adversarial workflows continuously re-tested? |
A “no” to one question does not necessarily mean an architecture is insecure.
But several unanswered questions usually indicate that the agent has been deployed as an AI feature rather than engineered as a security-sensitive autonomous system.
Defense in Depth for AI Agents
The strongest approach to AI agent security is not finding the perfect prompt.
It is assuming individual protections will occasionally fail.
A strong security chain might therefore be:
Prompt injection resistance
↓
Goal validation
↓
Tool allowlist
↓
Least privilege
↓
Parameter validation
↓
Runtime sandbox
↓
Network egress control
↓
Human approval
↓
EDR / runtime detection
↓
Audit trail
↓
Kill switch
An attacker must bypass multiple independent controls.
That is substantially safer than:
"We told the model not to do dangerous things."
The Future of AI Agent Security
The security architecture around agents is starting to resemble an operating-system security problem.
An agent has:
identity
state
memory
capabilities
process execution
IPC
network access
storage access
delegation
Those concepts should sound familiar.
They resemble processes, users, permissions, filesystems and distributed services.
What is new is that a probabilistic reasoning engine now decides when and how to use them.
The next generation of AI security infrastructure will therefore likely focus less on isolated prompt filters and more on an agent control plane.
That control plane will need to govern:
Agent identity
Agent capability
Tool authorization
MCP access
Memory provenance
Network access
Execution policy
Inter-agent communication
Human authorization
Telemetry
Incident containment
OWASP’s September 2026 Agent Control Standard is an early indication of this direction: security enforcement is moving from model instructions toward runtime controls that can be applied independently of a specific agent framework. (OWASP Gen AIセキュリティプロジェクト)
AI Agent Security Needs Continuous Testing
Agent systems change unusually quickly.
A security assessment can become outdated when any of the following changes:
foundation model
system prompt
tool definition
MCP server
agent framework
memory strategy
RAG source
authorization scope
browser implementation
deployment environment
A model upgrade alone can change how frequently an agent chooses tools.
Adding one MCP integration can create a completely new attack chain.
Changing a system prompt can alter approval behavior.
This makes agent security particularly suitable for continuous adversarial testing.
The goal should not simply be:
Did the agent resist this one prompt?
It should be:
Under adversarial conditions,
can the agent ever cross a security boundary
that the system was supposed to enforce?
That is a much stronger standard.
Agentic AI assessment acceptance tests
Use the control-loop and delegated-authority model above to run a small acceptance test. This is a proposed synthetic assessment, not a claim that a commercial product passed these checks.
- Create two tenants, isolated memory and a harmless state-changing tool.
- Seed indirect instructions in one tenant’s content.
- Attempt cross-tenant retrieval and unauthorized tool parameters.
- Change the plan after approval and verify re-approval.
- Cancel during a multi-step action and inspect remaining effects.
- Require an auditable report and remediation retest.
Bind approval to the actual operation
Approval should name the exact action, target, identity and important arguments. Test approval replay, plan changes after approval and batched operations that hide one dangerous action among many routine steps. A human clicking continue is not meaningful control if the operation has changed.
Retest memory lifecycle and cancellation
- cross-user and cross-tenant retrieval;
- task completion and deletion lifecycle;
- poisoned long-term memories;
- secrets copied from tools into broader memory;
- stale permissions retained in future sessions;
- summaries that lose provenance or policy context.
Cancel the agent during planning, tool execution and a retry loop. Confirm that workers, subprocesses and callbacks terminate. For reversible test actions, verify rollback. Record partial completion so operators know which side effects remain.
Frequently Asked Questions About AI Agent Security
What is AI agent security?
AI agent security is the discipline of protecting autonomous AI systems that can plan, use tools, access data and perform actions. It includes prompt-injection defenses, tool security, identity and authorization, MCP security, memory protection, sandboxing, network controls, monitoring and agent-specific red teaming.
Why are AI agents more dangerous than normal chatbots?
Chatbots primarily generate information. Agents can act.
A compromised chatbot might generate an incorrect response. A compromised agent could potentially send information, modify resources, invoke APIs, execute code or interact with other systems, depending on the capabilities it has been given.
The risk therefore grows with agency and privilege.
What is the biggest AI agent security risk?
There is no single universal risk, but prompt injection and agent goal hijacking are especially important because agents routinely process untrusted external information.
However, prompt injection usually becomes severe because it is combined with other weaknesses such as excessive tool permissions, unsafe tool parameters, unrestricted network access or weak authorization.
Is prompt injection solved?
No.
Model providers have significantly improved resistance, but major developers continue to describe prompt injection as an open security challenge, particularly for agents operating on untrusted websites, emails, documents and software interfaces. Anthropic explicitly states that layered defenses are necessary and that no single defense guarantees protection. (アンソロピック)
What is indirect prompt injection?
Indirect prompt injection happens when malicious instructions are placed inside content that an AI agent is asked to process rather than being entered directly by the user.
Possible vectors include:
websites
emails
documents
source code
RAG records
tool output
MCP responses
other agent messages
The agent may mistakenly interpret attacker-controlled data as instructions.
What is MCP security?
MCP security covers the authentication, authorization, trust, integrity and runtime risks associated with Model Context Protocol integrations.
Important controls include OAuth security, token audience validation, short-lived credentials, approved server lists, secure transport, tool review, prevention of token passthrough and treating MCP responses as untrusted input. MCP’s official authorization specification explicitly addresses several of these requirements. (モデル・コンテキスト・プロトコル)
Can MCP servers cause prompt injection?
Potentially, yes.
An agent processes information returned by tools and remote services. If attacker-controlled or malicious content reaches the model through an MCP server, it can become another indirect prompt-injection channel.
This is why external tools must be evaluated not only for conventional software vulnerabilities but also for the content they provide to the model.
Should AI agents have separate identities?
For serious enterprise deployments, this is a strong security practice.
A separate agent identity makes it easier to apply least privilege, short-lived credentials, conditional access and audit trails instead of giving an autonomous workload the full permissions of the human user.
Microsoft’s current guidance similarly emphasizes identity-based security and governance for nonhuman AI agents. (マイクロソフト学習)
Is sandboxing enough to secure an AI agent?
No.
Sandboxing is important, but tools that cross the sandbox boundary can undermine it.
Microsoft’s CVE-2026-25592 research demonstrated how an agent-callable file-transfer capability could undermine the intended isolation boundary when unsafe host-side paths were controllable by the model. (マイクロソフト)
Filesystem restrictions, network controls, credential isolation and secure tool interfaces should accompany sandboxing.
How should companies test AI agent security?
Testing should combine traditional application security with adversarial agent testing.
Security teams should examine direct and indirect prompt injection, tool misuse, privilege escalation, memory poisoning, MCP trust, unsafe code execution, multi-agent communication, network exfiltration, supply-chain risks and runtime containment.
Most importantly, tests should verify actual system actions rather than relying on the agent’s textual explanation of what it did.
結論
AI agent security is becoming one of the defining cybersecurity challenges of autonomous AI.
The reason is not simply that agents use large language models.
It is that agents connect probabilistic reasoning to real authority.
They can read.
They can remember.
They can choose tools.
They can authenticate.
They can communicate.
They can execute.
And increasingly, they can do those things without a human approving every intermediate step.
That changes the security boundary.
The safest way to build an AI agent is therefore to assume that the reasoning layer can eventually be influenced by something unexpected.
Design the rest of the architecture accordingly.
Do not give the agent more data than it needs.
Do not give it more permissions than the current task requires.
Do not trust model-generated tool arguments.
Do not trust external content because it looks like data.
Do not implicitly trust MCP servers.
Do not implicitly trust another agent.
Do not let untrusted content silently become permanent memory.
Do not rely on the same model to approve its own dangerous actions.
Do not mistake a container for a complete security boundary.
And do not build an autonomous system that cannot be observed, restricted or stopped from outside itself.
The most durable architecture is one in which a successful prompt injection still encounters:
least privilege
authorization
tool policy
input validation
sandboxing
egress control
human approval
runtime detection
audit logging
containment
before it can produce material damage.
That is the central idea behind modern AI agent security.
The industry is already moving in that direction. OWASP’s Agentic Top 10 provides a practical taxonomy for the failure modes, while the newly released Agent Control Standard pushes toward portable runtime enforcement. Microsoft has demonstrated how agent-controlled tool parameters can bridge prompt injection into concrete operating-system consequences, and model providers themselves continue to emphasize layered containment rather than treating prompt injection as a solved model-level problem. (OWASP Gen AIセキュリティプロジェクト)
The next security boundary is therefore not the prompt.
It is the action.

