Zulia Shavaeva← Back to Zulia
Free AI and security guide/Learn

Learn / Agent and agentic system security: tool use, permissions, memory, multi-agent

Agent and agentic system security: tool use, permissions, memory, multi-agent

Securing AI systems that plan, call tools, hold memory, and act semi-autonomously, often through multiple cooperating agents.

Researched on 2026-09-26 with AI assistance. Links and summaries can change; verify details with the original source. Not yet reviewed by a person.

What it is

Agent security covers systems that combine model reasoning with external tool calls, where data returned by a tool can hijack the agent into doing something else. The failure mode is not a bad answer, it is an unwanted action taken with the agent's credentials.48

The core reason agents are hard to secure is that a model cannot reliably tell operator instructions apart from instructions that arrive inside content it reads, because everything ends up as one token sequence, and the system is non-deterministic so a defence that works once may fail next time.8

OWASP treats agentic AI as its own threat-model problem rather than a variant of chatbot risk, and its Agentic Security Initiative published a threat-model-based reference of agentic threats and mitigations in February 2025 as the first of a series.1

The scope now splits into layers: the protocol layer that connects a model to tools, the skills or behaviour layer that decides what those tools actually do in a multi-step workflow, and the memory that carries state between sessions.79

Why postings ask for it

31 of 48 postings (65%) ask for agent and agentic system security, and it is the top-weighted skill for builders and designers: 81% of the 16 AI/Agent Security Engineer roles and 86% of the 7 AI Security Architect roles.P

Red team and research roles ask at 78% of 9 and 75% of 4, which matches work like proving an agent can be driven into a destructive tool call, for example using a debug SQL tool to delete a user record.P5

Demand is much lower in AI Governance / GRC (14% of 7) and Consulting (20% of 5), though NIST is drafting SP 800-53 control overlays with separate single-agent and multi-agent use cases, so the control-mapping side of this skill is arriving for those roles too.P6

Concepts you should be able to explain

If you can say each of these out loud in two minutes, with an example, you are ready for the technical part of an interview on this skill.

Lethal trifecta

An agent becomes a data-theft tool when three things meet in one session: access to private data, exposure to attacker-controlled content, and a way to communicate outward. Any single leg is usually fine; the combination lets an attacker instruct the agent to fetch secrets and send them out. Almost any HTTP-capable tool, including image loading or a clickable link, counts as the exfiltration leg.8

Indirect prompt injection through tool output

The attacker does not talk to the agent directly; they plant instructions in a web page, an issue, an email or a document the agent will read. Vendors have repeatedly shipped and then fixed this class of bug, usually by closing the exfiltration path rather than by making the model obedient only to its operator. Telling the model in its own prompt to ignore injected text is not a dependable control.84

Excessive agency

Agents are often wired to tools that are far broader than the task needs, such as a debug interface that accepts an arbitrary SQL string. Asking the agent to enumerate its own APIs and their arguments is usually enough to find the over-broad one, and then a normal-looking request turns into a destructive write. The fix is scoping the tool, not scolding the model.5

Confused deputy in tool protocols

MCP proxy servers that front a third-party API with one static OAuth client ID, while letting MCP clients register dynamically, can be tricked into handing an authorization code to an attacker's redirect URI because the user's earlier consent cookie suppresses the consent screen. The protocol's own guidance requires per-client consent stored server side, exact redirect_uri matching, and CSRF protection before the third-party flow starts. This is classic delegated-authorization work, not model work.2

Memory poisoning and persistence

Agents built on frameworks that keep mutable state carry corruption forward, so a single poisoned memory write can cause misaligned behaviour, data exfiltration or malicious actions in later sessions. OWASP now runs a dedicated project on guarding persistent agent memory. Treat memory writes as a trust boundary with their own validation and retention rules.9

The skills or behaviour layer

Between the model and the tools sits a layer of skills or manifests that define how multi-step workflows are orchestrated, not just which resources are reachable. OWASP's Agentic Skills Top 10 argues this layer has been under-protected relative to the model and the tool protocol, and maps each risk to the Cloud Security Alliance MAESTRO seven-layer model for agentic systems. The short mental model: the protocol is how the model talks to tools, skills are what those tools actually do.7

Design patterns over filters

Research from ETH Zurich and collaborators proposes design patterns for building agents with provable resistance to prompt injection, by constraining the agent's structure rather than trying to detect malicious text. The patterns trade utility for security in different ways, which is the conversation to have with product teams. Expect to argue about what capability you remove, not which classifier you buy.3

Measuring agent robustness

AgentDojo evaluates agents that use tools over untrusted data across 97 realistic tasks such as email, e-banking and travel booking, with 629 security test cases, and is designed as an extensible environment rather than a fixed test suite. Its results show current models fail many tasks even with no attacker present, and published injection attacks break some security properties but not all. So report utility and attack success side by side, and re-run as attacks evolve.4

Use fictional data and authorised sandboxes. Remove employer details and secrets from any portfolio write-up. Time estimates exclude setup. Check model and cloud costs before running tests, set spending limits, and delete lab resources afterwards.

Three exercises

In order of difficulty. Free tools. Keep what you build; it is evidence.

1Turn an over-scoped tool into a destructive actionabout 1.5 h

You can demonstrate, with steps, how an agent with one broad tool leads to data loss, and state the scoping fix.5

  1. Open the PortSwigger excessive agency lab and use its live chat.
  2. Ask the agent which APIs it can call, then which arguments each takes.
  3. Note the debug interface that accepts a whole SQL statement.
  4. Read a record, then perform the destructive write that solves the lab.
  5. Write three sentences on which tool contract change would have blocked it.

Tools: PortSwigger Web Security Academy account, browser

2Trifecta and consent review of an MCP-connected agentabout 3 h

You can produce a one-page review that says which tool combinations allow data theft and whether the authorization flow is a confused deputy.82

  1. List every tool your agent or IDE assistant can call, from its config files, recording tool and server names only and keeping tokens and keys out of the write-up.
  2. Tag each tool as private-data access, untrusted-content intake, or outbound communication.
  3. Mark every session where all three tags appear together and name the exfiltration path.
  4. For any proxy server, check per-client consent, exact redirect_uri matching and CSRF protection.
  5. Recommend one capability removal per trifecta rather than a prompt-level warning.

Tools: text editor, spreadsheet, your existing MCP client config

3Run an injection benchmark and report utility against attack successabout 6 h

You can show a table of task completion and attack success for one agent configuration, and defend the numbers.43

  1. Install AgentDojo from the code released with the paper and run a task suite with no attack.
  2. Record baseline task completion so you know the agent's honest failure rate.
  3. Re-run with the bundled injection attacks and record attack success per security test case.
  4. Enable one defence paradigm, re-run, and note what utility you lost.
  5. Write up which security properties still broke and what you would test next.

Tools: Python, AgentDojo, a local model runtime or a free API tier

Practice questions

Written from the concepts above, not collected from a named employer. Open one, answer it out loud, then tick the points you covered; the score stays in this browser.

What is the lethal trifecta and how would you use it to triage an agent deployment?Lethal trifecta

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

Why is 'tell the model to ignore injected instructions' not an adequate defence?Indirect prompt injection through tool output

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

An agent has a debug tool that takes a raw SQL string. Walk me through the attack and the fix.Excessive agency

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

Describe a confused deputy problem in an MCP proxy server and the required protections.Confused deputy in tool protocols

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

How does persistent memory change the blast radius of a single successful injection?Memory poisoning and persistence

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

What is the difference between securing the tool protocol layer and the skills layer?The skills or behaviour layer

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

You are asked to prove an agent is 'safe against prompt injection'. What would you actually measure?Measuring agent robustness

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

A product team wants an agent with broad access and asks you for controls. How do you structure the answer?Design patterns over filters

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

Sources

Every numbered claim above links here. P = the platform's own coding of 48 job postings.

  1. Agentic AI: Threats and Mitigations OWASP GenAI Security Project, Agentic Security Initiative
  2. MCP Security Best Practices Model Context Protocol
  3. Design Patterns for Securing LLM Agents against Prompt Injections arXiv
  4. AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents arXiv
  5. Lab: Exploiting LLM APIs with excessive agency PortSwigger Web Security Academy
  6. SP 800-53 Control Overlays for Securing AI Systems (COSAiS) NIST Computer Security Resource Center
  7. OWASP Agentic Skills Top 10 (AST10), version 1.0-2026 OWASP Foundation
  8. The lethal trifecta for AI agents: private data, untrusted content, and external communication Simon Willison
  9. OWASP Agent Memory Guard (project page, read from search result summary only) OWASP Foundation

Resources

Free first. Levels: intro means no prior knowledge of this skill; working means you can apply it on a project; advanced means research depth or specialist tooling.

Level Format

Gaps the research could not fill with a good free source: No free, self-hosted vulnerable multi-agent range or agentic CTF found today: GitHub searches for vulnerable MCP or agent labs returned only scanners, so all hands-on items are hosted single-agent labs.; No second free structured course dedicated to agent security with stated hours; PortSwigger's learning path is the only free curriculum confirmed.; Costs, durations and prerequisites are unconfirmed across the index: the tool budget ran out before any provider page could be fetched.; No ENISA, UK NCSC or ISO document specific to agentic systems surfaced; the closest governance material is the in-progress NIST COSAiS overlays and NIST Cyber AI Profile workshop slides.; Nothing found on agent-to-agent protocol security (for example A2A) from a standards body, and no free source on identity and non-human credential management for fleets of agents.; No free detection and monitoring guidance for SOC teams: no source found on what agent trajectory telemetry to log or alert on.