Phase 7 · Agentic AI, RAG Security + Red Teaming · Lesson 1 of 4
Article
·
25 min
·
+10 pts
Everything so far assumed a model that answers. An agent is different: it is given a goal, and it plans, calls tools, observes the results, and calls more tools in a loop until it decides it is done — largely without a human in the loop for each step. That autonomy is the whole value and the whole danger. Every risk from the earlier modules still applies, but now a successful prompt injection doesn't just produce bad text — it produces bad actions, chained. This lesson is the agentic threat model and the controls that contain it.
If you remember one term, make it this. Excessive agency is when an agent has more capability, permission, or autonomy than the task requires — so when something goes wrong (an injection, a misread instruction, a hallucinated plan), the blast radius is large. OWASP calls it out specifically for agentic systems. It has three faces:
Every other agentic threat is basically a way to trigger excessive agency:
'Clean up some unused files' — the agent interpreting that a little too literally
The way to reason about agentic security is to put controls on the loop itself: at the point it chooses a tool, at the point it acts, and at the boundary of how long it may run.
The agent loop — and where the controls go
Read the loop as an attacker: the dangerous edge is Observe → Plan, where tool output (which may be attacker-controlled, exactly the indirect injection from module 7.2) feeds the next decision. Controls sit at three points — which tool (sandboxing, scope), whether to act (human gate for high-risk), and how long (loop and cost limits).
Agents reach the world through tools, increasingly via MCP (the Model Context Protocol) — a standard way to expose tools and data to models. MCP is powerful precisely because it makes connecting tools easy, which means the security burden moves to how you scope them:
The containment mindset
You will not prevent every injection or bad plan, so design for containment: assume the agent will at some point try to do the wrong thing, and make sure it can't do serious harm when it does. Least-privilege tools, a human gate on high-risk actions, and hard loop/cost limits turn a compromised agent from a disaster into a logged, bounded, recoverable event. Autonomy is safe only in proportion to how tightly the actions are scoped.
Agentic security produces a specific evidence set: the agent's tool inventory with each tool's scope, the sandboxing configuration, the human-approval workflow and its audit log for high-risk actions, and the loop/cost limits. "The agent operates within least privilege and human oversight" becomes a reviewable design with artifacts. The next lesson adds the retrieval side — RAG access controls — and how red teaming tests all of it before an attacker does.