Block IX · Agents that work on their own · Lesson 52
Agent security: so no one can trick them
You'll get to know the most common attacks, such as instructions hidden in websites and emails, poisoned MCP servers or exposed keys, and how to protect yourself with isolated environments, minimal permissions and human approval.
- 11 min
- 9 animated slides
- 4-question quiz
- Narrated in 6 languages
What you'll see in this lesson
- Why an agent is easier to trick
An agent reads third-party content and also acts: if someone slips it an order, it can carry it out with your permissions.
- Prompt injection: direct and indirect
Someone slips an order into what the agent reads: in the chat (direct) or hidden in a website, an email or a PDF (indirect).
- There's no final patch: limit the damage
The model can't reliably tell an order from data, so the real defense is limiting what it can do if it falls for one.
- Poisoned MCP servers
The model reads and obeys the description of each MCP tool, so a malicious server can hide orders there.
- Exposed keys: the most expensive mistake
A key in the code, in a .env pushed to GitHub or inside the agent's context ends up, sooner or later, in the wrong hands.
- Isolated environment: let it work inside a box
A sandbox limits which files the agent sees and which domains it connects to, even if it gets tricked.
- Minimal permissions: only what's essential
Give the agent just what its task needs: OWASP calls giving it more «excessive agency» (LLM03).
- Human approval and logs
Anything that can't be undone is approved by a person, and every action the agent takes is logged.
- Summary: agents that don't get fooled
Design as if the agent will be tricked: if it falls for something, it shouldn't be able to do serious harm.
Tools and concepts
- Prompt injection
- Sandbox
- OWASP MCP Top 10
Sign in with your Google account to access this lesson and the whole course.