Program 03 · Module 07 of 10
Module 07: Safety, Security and Reliability
Harden agents against misuse and failure. You study prompt injection, permission boundaries, privacy and secure logging, output validation, budgets and rate limits, and human review for high-impact actions, then threat-model and harden an agent.
- Suggested study time
- 8-10 hours
- Prerequisites
- Modules 1 to 6.; Basic understanding of web security concepts such as injection and least privilege.
Sign in to track your progress. Every lesson stays free to read without an account.
Learning outcomes
By the end of this module you will be able to:
- Explain prompt injection and treat tool outputs as untrusted.
- Define permission boundaries and sandboxing for tools.
- Protect sensitive data in prompts, logs and stored memory.
- Validate outputs and enforce policy in code.
- Apply budget, rate and step limits to prevent runaway execution.
Lessons
- 7.1
Prompt Injection and Untrusted Tool Outputs
Learn how text inside messages, web pages and tool results can try to steer an AI agent, and how to contain the damage with layers of defence.
45 min - 7.2
Tool Permission Boundaries and Sandboxing
Give each agent tool the smallest set of actions and resources it needs, deny everything else by default, and run risky work in an isolated place.
40 min - 7.3
Data Privacy, Sensitive Information and Secure Logging
Decide what must never enter a prompt or a log, record enough to investigate problems without storing personal data, and redact what slips through.
40 min - 7.4
Output Validation and Policy Enforcement
Check every model reply in code before anyone sees it or any tool acts on it: right shape, allowed values, safe content and company rules, with a clear plan for when a check fails.
40 min - 7.5
Budget Limits, Rate Limits and Runaway Execution Controls
Stop an AI agent from looping, retrying or being called so often that it burns money and time, using caps on steps, model calls and runs per minute that fail closed with a clear message.
35 min - 7.6
Human Review for High-Impact Actions
Sort agent actions into low, medium and high impact, design review screens people can decide on quickly, use two reviewers for the riskiest actions, and measure whether the review is working.
35 min - 7.7
Practical Lab: Threat-Model and Harden an Agent
Threat-model your support agent, attack it with ten adversarial inputs, add input, output, privacy and budget guards, prove each guard with offline tests and write down the risk that remains.
2 h
About 5 h 55 min of lessons in total.
Practical assignment
Practical Lab: Threat-Model and Harden an Agent
Threat-model the agent from an earlier lab, write at least eight adversarial test inputs, record what breaks and implement fixes. This is the program's safety and security assignment and has its own minimum rubric threshold.
Deliverables
- A threat model listing assets, entry points, threats and mitigations.
- At least eight adversarial inputs with observed results before and after hardening.
- Code changes for permission boundaries, validation and limits.
- A short residual-risk statement.
Validation checklist
Use this to check your assignment before you move on.
Knowledge check
Show the answer and explanation
Answer: B. The defence must be structural: no capability to misuse. A stronger instruction helps a little but a manipulated model can still try.
Show the answer and explanation
Answer: B. You need enough to investigate an incident without storing secrets. Logging everything is the tempting option, but it creates a second data-protection problem.
Show the answer and explanation
Answer: B. Limits contain the cost of failure. They complement the step limit, because one expensive step can cost more than many cheap ones.
PromptFable is independent and is not affiliated with, endorsed by or sponsored by Anthropic, Google, OpenAI or any other vendor. Claude, Gemini, Google AI Studio and other product names are trademarks of their respective owners.