Agentic AI Security: Complete Guide to AI Agent Attacks, Risks and Defence

Agentic AI Security: Complete Guide to AI Agent Attacks, Risks and Defence
✨ AI Summary

⏱️ 60 min · Intermediate · 2 hands-on labs

You have been asked to review an AI agent before it goes live. It reads support tickets, searches a knowledge base, calls a few tools through MCP and can send email. Nobody can tell you what it is allowed to do if a ticket contains something hostile. That is the situation this guide is built for.

Together we will build a clear picture of what an agent is and how it differs from a chatbot. I will show you how to draw its architecture, mark the trust boundaries and walk a threat model across the major risks. Then you will watch an indirect tool call injection work against the SecurityElites lab agent, TaskBot, so the risk stops being abstract.

After that we put controls in place: least privilege, per-agent identity, approval gates and runtime monitoring. You finish with a checklist you can use before any agent touches real data. Everything hands-on runs against your own machine or the named lab, never against systems you do not own.

🎯 What You Will Be Able to Do

Explain what agentic AI is and how it differs from a chatbot
Draw an agent architecture and mark its trust boundaries
Walk through a threat model covering the major agent risks
Reproduce an indirect tool call injection against a lab agent
Apply least-privilege, identity, approval and runtime controls to an agent
Use a security checklist to review an agent before deployment

✅ Before You Start

  • Basic understanding of how LLMs and prompts work
  • Familiarity with web APIs and HTTP
  • Comfort reading short Python or JSON snippets

What Agentic AI Means and Key Terms

I want to start with a clear picture of what we are protecting, because agentic ai security only makes sense once you know what an agent is. A chatbot answers a question and stops. An agent is given a goal and keeps going. One survey-style definition describes an agentic AI system as an LLM-driven entity that runs multi-step tasks through a planning loop, calls external tools, reads and writes persistent memory, and coordinates with peer agents, with little or no human intervention between steps.

Plain generative AI produces text, images or code for a person to read. An agent takes that output and acts on it: it sends the email, runs the script, opens the ticket. I want you to notice that shift from words to actions, because it is why the risk changes. A bad answer from a chatbot is an embarrassment. A bad action from an agent can change a real system.

This is the pillar page of a series on ai agent security. I will give you the whole map here and point you to deeper pages as each subtopic comes up. If you want the short, data-focused view first, I suggest you read what the OWASP agentic lists mean for your data.

📖 Words I just used

Planning loopThe repeating cycle where the agent decides what to do next, does it, and looks at the result.
ToolA function the agent can call, such as a web fetch, a file read, an email send or a code runner.
MemoryInformation the agent keeps between steps or sessions, from the context window to vector stores.
MCPModel Context Protocol, a standard way for agents to connect to tool servers.
Goal hijackAn attacker redirects the agent from the user's goal to the attacker's goal, usually through text the agent reads.
Excessive agencyThe agent has more tools, permissions or autonomy than its task needs.
Blast radiusHow much damage follows when one part of the agent fails or is taken over.

🧠 Quick check

What most clearly separates an agent from a chatbot?

How Autonomous Agents Work: The Planning Loop

Let me walk you through the loop at the whiteboard. Every agent, however fancy the framework, repeats four moves: perceive, plan, act, observe. I will show you what each one does and where an attacker gets a foothold.

🧭 The four moves of the loop

Step 1 — PerceiveThe agent collects input: the user's request, retrieved documents, web pages, tool outputs. Exposure: any of this text can contain instructions written by an attacker, and the model cannot reliably tell data from commands.
Step 2 — PlanThe model decides the next step toward the goal. Exposure: if poisoned input shapes the plan, the goal itself has been hijacked.
Step 3 — ActThe agent calls a tool with arguments it chose. Exposure: this is where words become real effects, so over-broad tools and weak argument checks hurt most.
Step 4 — ObserveThe tool result returns to the model and feeds the next turn. Exposure: the result is new untrusted input, so the loop can keep feeding itself bad content.

I want you to look closely at tool calling. The model does not run anything itself. It emits a structured request, such as a tool name and arguments, and surrounding code executes it. That surrounding code is where I put your controls, because the model's own judgement is the thing under attack.

Agents also keep several kinds of memory, and I will name them so you can spot them. Short-term context lives in the context window. Long-term knowledge sits in vector stores reached through RAG, which means retrieval augmented generation. Episodic memory carries across sessions, and parametric memory lives in model weights or adapters. Each is a place where poisoned content can persist beyond one conversation.

Finally, agents coordinate. In a multi-agent setup one agent delegates to another and trusts what comes back. A compromised peer can therefore pass bad instructions along with a friendly tone, and a single failure can cascade.

💡 Tip: When you review any agent, I want you to draw the loop and write beside each arrow what untrusted data enters there. The gaps you find are your first findings.

Agent Architecture and Trust Boundaries

Here is the idea I want you to hold on to: agent safety is mainly an architectural property, not a prompt property. One architecture chapter argues that separating perception, memory, planning, tool routing, execution, verification and oversight confines faults to defined boundaries and limits blast radius. If everything sits in one blob, one bad input reaches everything.

🗺️ A practical agent architecture with trust boundaries
  1. Perception (untrusted inputs)
  2. Memory (stores and retrieval)
  3. Planning (the model)
  4. Tool routing and policy check
  5. Execution (sandbox)
  6. Verification
  7. Human oversight

I read the diagram left to right as a request travels, and I suggest you do the same. Perception brings in text. Memory supplies context. Planning proposes an action. Tool routing is the checkpoint: it decides whether the proposed call is allowed. Execution runs it in a sandbox. Verification checks the result, and oversight lets a person approve risky steps.

Now the boundary. In a single-agent trust-boundary model, retrieval backends, external storage and tools or APIs sit outside, or only partly inside, the protected boundary. That means you must treat whatever comes from them as untrusted, even though your agent depends on it. I never enforce rules in the model itself, so the policy check and approval gate must live in ordinary code around it.

The same chapter recommends read-only-by-default tools, with actuation allowed only for narrow, reversible operations and per-call policy checks. I like this advice because a tool that can only read cannot be turned into a weapon nearly as easily as one that can write, send or delete.

⚠️ Watch out: Do not rely on a system prompt line such as 'never do X' as a boundary. It is an instruction inside the very channel an attacker can write to. I always enforce limits in code outside the model.

For a full treatment of how to design this, I point you to the framework page on what agent security must cover in 2026.


Mapping the Agent Attack Surface

Before you defend anything, list every door. I do this as a plain inventory, one line per entry point, and then I ask who controls the content at each. For the method in more depth, the Day 12 capstone on how to threat model a company agent walks the whole exercise.

☑️ Entry points to inventory for every agent

Retrieved content is the most common route. A documented 2025 to 2026 incident involved a prompt-injected issue title and crafted comments that got a Gemini CLI Action to expose a full API key. The attacker never touched the agent directly. They wrote text where the agent would read it.

Tool descriptions are easy to overlook. The model reads them to decide what to call, so a changed description can steer behaviour. I suggest you pin and diff tool definitions, so tool poisoning shows up as a change you can see.

MCP servers add a supply chain you did not write. The protocol itself lacks built-in authentication and authorisation, so each deployment must add it. Credentials and code execution then decide how bad a compromise gets, since they set what an attacker can reach once the agent obeys.

💡 Tip: I rank entry points by two questions: can an outsider write to it, and what can the agent do immediately after reading it. Where both answers are bad, fix that first.

🧠 Quick check

Which entry point lets an attacker steer an agent without ever contacting it directly?

Agent Tools and Permissions: Deciding What Each Tool May Do

I want to stop here and give tools their own section, because tools are where an agent's words turn into real effects. The attack surface list told you where hostile text gets in. Permissions decide how much harm that text can do once it arrives. Every tool you give an agent is a decision about authority, so I treat each one like a new account I am about to create.

Start with the tool inventory. For each tool, I write down four things: what it can read, what it can change, whose credentials it runs under, and what happens if the model calls it with arguments an attacker chose. If you cannot answer all four, the tool is not ready to be connected.

🗺️ How a tool call should pass through permission checks
  1. Model proposes a call
  2. Is the tool visible for this step
  3. Do the arguments pass validation
  4. Does policy allow this identity
  5. Approval gate for risky actions
  6. Execute in sandbox and log

Read that flow left to right. The model only proposes. Code outside the model does every check after that. If any check lives only in the system prompt, it is a suggestion and not a control, because injected text can talk the model out of it.

🧭 Set permissions for one tool

Step 1 — Start from read-onlyGive the agent the read version of a tool first, such as search or fetch. Add a write or send version only when the task truly needs it. You should end up with a short list of read tools and a much shorter list of actuating ones.
Step 2 — Scope the tool to the stepExpose a tool only during the steps that use it. A ticket summary step has no reason to see an email-send tool. If the tool is not visible, a hijacked plan cannot call it.
Step 3 — Validate arguments in codeCheck recipients, paths, URLs and sizes against an allow list before the call runs. For example, an email tool should only accept addresses on your own domain unless a person approves otherwise.
Step 4 — Use a separate identityRun the tool under a credential made for that agent, short-lived and limited to the one system it touches. Then a stolen or abused token reaches only that system.
Step 5 — Gate the irreversibleSending, deleting, paying and publishing need human approval enforced by the runtime. The prompt shown to the approver must display the real action and arguments, not a model summary.
Step 6 — Log every callRecord the tool, arguments, identity and result. You will need this to compare actual behaviour with expected behaviour and to investigate after an incident.

MCP servers deserve the same treatment. A tool server is a third party, or at least another team, handing your agent new capabilities and new descriptions to read. Review it, pin its tool definitions so a silent change shows up as a diff, and add authentication yourself if it ships without. My guide to vetting packages and tool servers before agents use them walks that review step by step.

🚫 Common mistake: Connecting a tool with full account rights because the narrow version takes longer to configure. When the agent is hijacked, the attacker inherits everything that tool could do, not just what the task needed.

🧠 Quick check

A summarising agent only ever needs to read documents. What is the best permission setup for its email tool?
🧪 HANDS-ON LAB · INTERMEDIATE · 25 MIN · SECURITYELITES LAB
Whose Instruction Was That? — Set Tool Rules That Stop a Hijack

This lab is the best place to practise the permission decisions we just covered, because you write the rules and then watch real traces replay against them.

What to try
▸ Start by listing which tools the normal task actually needs, and allow only those.
▸ Add argument limits to any tool that can send or write something.
▸ Replay the traces and note which calls your rules block.
▸ Loosen one rule on purpose and see which hijack step comes back.

What to notice: Which layer stopped the hijack: tool choice, arguments or approval Whether your rules broke the normal task while blocking the attack

I wrap each tool call in a small logger so the tool, arguments, identity and result are recorded for later comparison.

LOG EVERY TOOL CALL
save as audit_log.py and run: python3 audit_log.py
cat > audit_log.py <<'EOF' import json, time def logged(identity, tool, args, fn): result = fn(**args) rec = {'ts': time.time(), 'identity': identity, 'tool': tool, 'args': args, 'result': str(result)[:80]} open('tool_calls.jsonl', 'a').write(json.dumps(rec) + '\n') return result logged('summary-agent', 'read_doc', {'name': 'faq.txt'}, lambda name: 'ok') EOF
python3 audit_log.py
cat tool_calls.jsonl
{"ts": 1760000000.0, "identity": "summary-agent", "tool": "read_doc", "args": {"name": "faq.txt"}, "result": "ok"}

One JSON line per call appears in tool_calls.jsonl, with the identity, tool, arguments and result.

I pin a hash of each tool definition locally so that a silent change to a tool description shows up as a visible diff.

PIN AND DIFF TOOL DEFINITIONS
tools.json is your own exported list of tool names, descriptions and schemas
sha256sum tools.json > tools.json.sha256
later, before each agent run, verify nothing changed
sha256sum -c tools.json.sha256
tools.json: OK
if a description was edited you will see FAILED, then inspect the change
diff <(git show HEAD:tools.json) tools.json

You should see OK while definitions are unchanged. After any edit you should see FAILED and a diff showing the exact changed lines.


Threat Model and Major Risks

A threat model is a structured answer to what can go wrong and where. For agents, two references help me. The OWASP Top 10 for Agentic Applications 2026, published on December 9, 2025, names the risks. The MAESTRO framework from the Cloud Security Alliance organises them by layer. I give you the overview here and leave depth to the supporting pages.

📖 Words I just used

ASI01 Agent Goal HijackAttacker text redirects what the agent is trying to do.
ASI02 Tool Misuse and ExploitationLegitimate tools are used in harmful ways.
ASI03 Identity and Privilege AbuseAgent credentials or rights are abused or over-broad.
ASI04 Agentic Supply Chain VulnerabilitiesPoisoned or vulnerable packages, tools and servers.
ASI05 Unexpected Code ExecutionThe agent runs code nobody intended.
ASI06 Memory and Context PoisoningCorrupted memory gives the agent lasting false beliefs.
ASI07 Insecure Inter-Agent CommunicationAgents trust messages from peers without verification.
ASI08 Cascading FailuresOne fault spreads through connected agents.

The list continues with human-agent trust exploitation and rogue agents, so I ask you to read the full set in the OWASP material before you rely on my summary. MAESTRO maps indirect prompt injection across three layers: planning-layer goal hijack, memory-layer poisoning and action-layer tool misuse. One input, three places it can hurt you.

These risks are not theoretical. Microsoft researchers found two critical Semantic Kernel vulnerabilities, CVE-2026-25592 and CVE-2026-26030, and showed a prompt injection becoming host-level remote code execution, with one prompt launching calc.exe on the machine running the agent. Once a model is wired to tools, prompt injection can become a code execution primitive.

MCP has taken heavy fire. Researchers disclosed over 40 CVEs against MCP implementations between January and April 2026, and about 43% were shell or exec injection flaws. The NSA's AI Security Center published its first formal MCP guidance in May 2026, warning that adoption has outpaced the protocol's security model.

NIST red-team research found that novel attack techniques hijacked agent tasks 81% of the time, against 11% for the strongest previously known baseline attacks. I read that gap as a reason to assume hijack attempts will sometimes succeed and to limit what a hijacked agent can do. For attacker and defender tooling, I point you to how red teaming agents are used on both sides, and for supply chain checks, vetting packages and tool servers before agents use them.

🚫 Common mistake: Assuming serious AI incidents always arrive with a CVE. OWASP's Q1 2026 exploit round-up found only one of eight major AI incidents had one. The rest came from misconfiguration, excessive agency, supply-chain failure or prompt injection.

Worked Demo: Hijacking an Agent Through a Tool Call

I want you to see a hijack happen, because reading about indirect prompt injection is not the same as watching a document talk an agent into an action nobody approved. We will use the SecurityElites lab agent, TaskBot, which summarises documents and has tools it can call. Everything here runs inside the lab. Do not try it on any real agent or service you do not own.

The idea is simple. The user asks for a summary. The agent reads a document, and the document contains text written as an instruction. The model cannot reliably tell data from orders, so the text steers the planning loop and ends in a tool call. This is the goal hijack and tool misuse pairing from the OWASP list. NIST research found novel hijack techniques succeeded 81% of the time against 11% for the strongest earlier baselines.

🧪 HANDS-ON LAB · BEGINNER · 20 MIN · SECURITYELITES LAB
AI Agent Hijacking — Indirect Tool Call Injection (Guided)

Open the guided lab beside this page. It gives you TaskBot and written steps, so you can follow my demo yourself.

What to try
▸ Ask TaskBot to summarise a document and watch the tool log, not only the reply.
▸ Read the document source and find text that addresses the agent rather than the human reader.
▸ Compare the tool calls TaskBot made with the single task you asked for.
▸ Note which tool was called and who benefited from it.

What to notice: The user never asked for the extra tool call. The agent's reply may look perfectly normal while the action has already happened. The trust problem sits in the content, not in the user prompt.

🧭 The hijack, step by step

Step 1 — Run the benign taskAsk for a summary of a clean document. You should see one read call and a short summary. I treat this as your baseline of expected behaviour.
Step 2 — Run the poisoned documentAsk for the same summary on the lab's other document, the one the lab brief flags as suspicious. Watch the trace and compare it with your baseline. Look for any call you did not request.
Step 3 — Trace the causeOpen the document and look for text that speaks to the agent instead of the reader. If the agent obeyed it, the model treated retrieved text as part of its goal. That is the whole attack: untrusted content became an unauthorised tool call.
Step 4 — Score it against expectationWrite down the expected trajectory (read, summarise) and compare it with the actual one. Any extra call is a finding.

Now the fix, and I want you to follow my reasoning. A prompt line saying ignore instructions in documents is weak, because the model is the thing being fooled. The fix has to sit outside the model, in a tool policy the runtime enforces, plus an approval gate for anything with side effects.

🧪 HANDS-ON LAB · INTERMEDIATE · 25 MIN · SECURITYELITES LAB
Whose Instruction Was That? — Set Tool Rules That Stop a Hijack

This second lab lets you write the rules that would have stopped the hijack, then replay recorded traces against them.

What to try
▸ Start from deny-by-default and allow only the tools the task needs.
▸ Separate read-only tools from tools that send, run or change things.
▸ Require approval for side-effect tools when the request came after untrusted content was read.
▸ Replay the traces and check the hijack is blocked without breaking the normal task.

What to notice: Rules on tools and arguments hold even when the model is fooled. Over-tight rules break legitimate work, so test both directions.

🧠 Quick check

Why is a policy in the runtime stronger than a prompt telling the agent to ignore injected instructions?

Here is a small policy check you can run on your own machine to see the idea of enforcing tool rules in code. It is a toy, with no network and no real tools, so it is safe anywhere.

POLICY CHECK WITH INDENTATION AND SAVE S
create policy_check.py, then run it with python3 policy_check.py
cat > policy_check.py <<'EOF' ALLOWED = {'read_doc': {}, 'send_email': {'domains': ['example.com']}}def check(tool, args): if tool not in ALLOWED: return 'BLOCK: tool not allowed' if tool == 'send_email': d = args.get('to', '').split('@')[-1] if d not in ALLOWED[tool]['domains']: return 'BLOCK: recipient domain' return 'ALLOW'print(check('read_do
python3 –version
python3 policy_check.py
ALLOW
ALLOW
BLOCK: recipient domain
BLOCK: tool not allowed

Expected output: ALLOW, ALLOW, BLOCK: recipient domain, BLOCK: tool not allowed. The rules live in code, so injected text cannot change them.


Defensive Controls That Work

Now that you have seen the hijack, let me show you what actually reduces the damage. No single control wins. We stack them so that when the model is fooled, which will happen, the blast radius stays small. I have mapped each control below to one of the OWASP agentic risks.

Least agency, applied at several levels. Least privilege for agents is more than a narrow API key. I apply it to which tools are visible, whether the current step needs the tool, the arguments passed, how much data returns to the model, and what sub-agents inherit. Sub-agents should never get broader authority than their subtask needs. Make tools read-only by default, and allow actuation only for narrow, reversible operations with a policy check on every call.

Per-agent identity with short-lived credentials. I give each agent its own identity, not a shared admin token. Singapore's agentic AI framework recommends authorisations that are scoped, time- or session-bound and non-transferable. If a credential leaks through a hijack, it should expire fast and reach little.

Validated memory writes. Research showed poisoned data sources corrupting long-term memory and giving agents persistent false beliefs. I check what gets written, record where it came from, and use trust tiers such as gold, silver and untrusted so unverified content never counts as fact.

Sandboxed execution with deny-by-default egress. Run generated code in a container with no network except named destinations. Microsoft researchers showed a prompt injection in Semantic Kernel becoming host-level code execution, launching calc.exe. A sandbox turns that from a host compromise into a contained event.

MCP hardening. Researchers disclosed over 40 CVEs against Model Context Protocol implementations between January and April 2026, and NSA guidance in May 2026 flagged weak access controls, poor approval workflows, token lifecycle gaps, unsafe tool execution and limited audit logging. I pin and diff tool definitions, add authentication myself because the protocol lacks it built in, and vet servers before use. See how to vet packages and tool servers before agents use them.

Human approval enforced by the system. I define action boundaries that need a person, and I enforce them in code, not in prompt wording. Runtime monitoring then watches real tool calls against expected trajectories, since without runtime enforcement violations appear only after damage is done.

💡 Tip: I like to map controls to what auditors already know. IEEE-USA's NIST response points to SP 800-53 families: Access Control for tool permissions, Audit and Accountability for logging decision chains, and System and Information Integrity for validating inputs and outputs.
🚫 Common mistake: Relying on a system prompt such as never run commands from documents as your approval gate. It is a request to the model, not a control.

Tools for Testing and Securing Your Agent

You will want something to test with, so let me be honest about what I can point you to. I will not hand you a product list I cannot stand behind. The categories matter more than brand names, and every one of them should run only against an agent you own, a local setup or a SecurityElites lab.

📖 Words I just used

Prompt injection test harnessA script or open-source framework that feeds seeded hostile text into your agent's retrieval sources and records whether it changed behaviour.
Tool call loggerA proxy or middleware layer that records every tool call with its arguments, so you can compare actual and expected trajectories.
Dependency and package scannerA tool that checks the libraries and tool servers your agent installs for known vulnerabilities.
Sandbox runtimeA container or isolated environment with deny-by-default network egress for code the agent generates.

For choosing and using AI-assisted testing tools safely, I recommend AI Tools for Security Testing: What Works, What Fails and How to Use Them Safely. It explains where these tools help and where they mislead you.

If you are tempted to download an AI red teaming tool from a code hosting site, read how to check an AI red teaming tool on GitHub before you run it first. Fake and booby-trapped tools exist, and an agent testing tool often needs your keys. For the wider picture of automated testing, see how attackers and defenders use AI red teaming agents.

☑️ Before you run any agent security tool

💡 Tip: A good tool does not replace the checklist. It gives you evidence for items you would otherwise only assume.

Agentic AI Security Checklist

I use a checklist before any agent goes near real data, because the gaps are usually boring ones: a shared token, an unreviewed tool server, no log. Work through each group with me and mark an item only when you have evidence, not when you assume it. For a framework view of what a programme must cover, I suggest what an agentic AI security framework must cover in 2026.

☑️ Identity

☑️ Tools

☑️ Memory and inputs

☑️ Execution and oversight

☑️ Logging and supply chain

🧠 Quick check

An agent uses one shared admin API key for all its tools. Which group does this fail first?

This pillar page gives you the whole map. The supporting articles go deep on each part, and I will keep adding links here as each one is published. I treat this section as your reading order. Start with the lists, then the architecture, then the individual attacks.

For the standards view, I begin with what the OWASP agentic lists mean for your data. It explains the ten risks, from goal hijack and tool misuse to cascading failures, in plain terms. The upcoming articles on the OWASP Top 10 for Agentic Applications, agent architecture and attack surface mapping build on this.

For threat modelling, I recommend the capstone where you threat model a company agent. It pairs well with the planned threat modelling article and the MAESTRO layers.

The attack-focused articles in this cluster cover goal hijacking, memory poisoning, tool misuse, privilege escalation and insecure agent communication. The defence-focused ones cover agent identity, runtime protection, rogue agent detection, the full security checklist and incident response.

For supply chain, I want you to read vetting packages and tool servers before agents use them. For testing, see how attackers and defenders use AI red teaming agents and how to check a red teaming tool on GitHub before you run it.

💡 Tip: If you are new, I suggest this order: OWASP lists, architecture, then one attack article, then the matching defence article. Pair every attack you learn with its control.

Practice in the Lab, Sources and Review Process

Reading only gets you so far, so I want you to go back to the two labs from the demo and do them properly. Run the guided hijack first, then the tool policy lab, and try to make your rules block the hijack without breaking the normal task. Keep your practice inside the labs and your own machine.

🧪 HANDS-ON LAB · INTERMEDIATE · 25 MIN · SECURITYELITES LAB
Whose Instruction Was That? — Set Tool Rules That Stop a Hijack

Finish with the policy lab, since writing rules that survive a replay is the skill that transfers to real agents.

What to try
▸ Write your rules, replay the traces and note which calls were blocked.
▸ Loosen one rule and see which hijack step returns.
▸ Explain in one sentence why each allowed tool is needed.

What to notice: Which control stopped the hijack: tool choice, arguments or approval. How much of the protection came from deny-by-default.

Primary sources. I drew this guide from the OWASP Top 10 for Agentic Applications 2026, published on 9 December 2025, and from NIST CAISI's Request for Information on AI agent security and its AI Agent Standards Initiative of February 2026. I also used Singapore IMDA's Model AI Governance Framework for Agentic AI, NSA AI Security Center MCP guidance from May 2026, and Cloud Security Alliance research including the MAESTRO threat modelling framework. Microsoft's Semantic Kernel research and OX Security's MCP disclosure supplied the incident detail.

Author and review process. I wrote this guide as Mr Elite. I check each claim against the sources above, and I mean the page to be reviewed by a second technical reader before publishing. Agentic standards and CVEs move quickly, so I ask you to check the sources for updates before relying on any figure.

⚠️ Watch out: Never point injection tests or scanners at agents, MCP servers or services you do not own or have written permission to test.

Your Checklist

☑️ Pre-deployment agent review

🚫 Mistakes I See Most Often

Relying on a system prompt line such as 'never do X' or 'ignore instructions in documents' as the security boundary.Spot it by asking whether code outside the model enforces the rule. If not, move the limit into a tool policy, argument validation or an approval gate that the runtime applies.
Giving the agent one shared admin token and broad tool access because it is quicker to set up.Give each agent its own identity with scoped, short-lived credentials. Trim visible tools, arguments and returned data to what the current step needs, and prefer read-only tools.
Connecting third-party MCP servers or tool definitions without review, pinning or logging.Vet each server before use, pin and diff tool definitions so poisoning shows up as a change, add authentication yourself, and log every tool call so you can check them against expected behaviour.

What I Want You to Remember

An agent turns model output into real actions through a planning loop and tools, which is why its failures cost more than a chatbot's.
Agent safety is mainly an architectural property, so enforce limits in code outside the model and not in a system prompt line.
Anything arriving from retrieval, tools, MCP servers or peer agents sits outside the trust boundary and must be treated as untrusted.
Indirect prompt injection can steer planning, poison memory and misuse tools from a single input, so assume hijack attempts will sometimes succeed.
Stack controls so a fooled model still has a small blast radius: least agency, short-lived identity, sandboxing, enforced approval and runtime monitoring.
Mark a checklist item only when you hold evidence, because the usual gaps are boring ones such as a shared token or missing logs.

🧠 Check Your Understanding

What mainly separates an agent from a plain generative AI chatbot?
Where should a rule like 'never send data to unknown addresses' be enforced?
How should you treat content returned by a retrieval backend or MCP tool?

❓ Questions People Ask

What is agentic AI and how is it different from a chatbot or generative AI?
Agentic AI is a model-driven system that pursues a goal through a planning loop, calls tools, uses memory and sometimes coordinates with other agents. Generative AI produces text, images or code for a person to read, and a chatbot answers and stops. An agent takes that output and acts on it, with little human involvement between steps.
What are the biggest security risks of AI agents?
The main ones are goal hijack through prompt injection, tool misuse, identity and privilege abuse, supply chain weaknesses, unexpected code execution and memory poisoning. Insecure agent-to-agent communication and cascading failures add to the list. Most come from untrusted content steering an agent that holds too much authority.
What is the OWASP Top 10 for Agentic Applications?
It is a ten-item risk list published on 9 December 2025, covering ASI01 Agent Goal Hijack through to rogue agents. Items include tool misuse, identity abuse, supply chain, code execution, memory poisoning and human-agent trust exploitation. Use it as the vocabulary for your threat model.
How does prompt injection lead to agent goal hijacking and tool misuse?
The model cannot reliably tell data from instructions, so text in a document, issue or web page can steer the planning loop. The agent then calls tools in ways nobody approved, such as sending data out or running commands. One injected input can hit planning, memory and action layers.
How do you secure MCP servers and tool connections for AI agents?
Add authentication and authorisation yourself, since the protocol does not provide them. Vet each server, pin and diff tool definitions, use scoped short-lived tokens, require approval for risky actions and log every call. Researchers disclosed over 40 MCP CVEs between January and April 2026, so review matters.
What are trust boundaries in an AI agent architecture?
A trust boundary is the line between what you control and what you must treat as untrusted. For agents, retrieval backends, external storage, tools and APIs sit outside or only partly inside it. Data crossing that line needs validation and policy checks before the agent acts on it.
When should a human approve an AI agent's actions?
Require approval for actions that are hard to reverse, touch sensitive data, spend money or send content outside your organisation. Define these action boundaries in advance and enforce them in code. A prompt that says 'ask first' is not an approval gate.
🚀 Where to go next: Read the OWASP agentic risk articles next, then pick one attack article and pair it with its matching defence article. After that, run the two labs again and try to block the hijack without breaking normal tasks.

🧩 Every Tutorial in the Agentic AI Security series

📚 Keep Learning on SecurityElites

Written by Mr Elite. Reviewed by Mr Elite, last reviewed on .

ME
Mr Elite
Owner, SecurityElites
I teach AI red teaming and ethical hacking through hands-on labs at SecurityElites.
⚡
Join free to earn XP for reading this article Track your progress, build streaks and compete on the leaderboard.
Join Free
Lokesh N. Singh aka Mr Elite
Lokesh N. Singh aka Mr Elite
Founder, Securityelites · AI Red Team Educator
Founder of Securityelites and creator of the SE-ARTCP credential. Working penetration tester focused on AI red team, prompt injection research, and LLM security education.
About Lokesh ->

2 Comments

Leave a Comment