Module 9 – Security, Guardrails, Evaluations, and Observability

Learning outcomes

Defend agent systems against prompt injection, data leakage, excessive agency, unsafe tools, and silent quality regression.

Threats

  • Direct and indirect prompt injection
  • Tool argument manipulation and confused-deputy attacks
  • Secret or personal-data leakage through prompts, logs, traces, and retrieval
  • Excessive permissions and unreviewed side effects
  • Poisoned knowledge sources, insecure output handling, and supply-chain risk

Defence in depth

  • Least privilege, sandboxing, network restrictions, and scoped credentials
  • Input, tool-input, and output guardrails
  • Human approval at consequential boundaries
  • Structured outputs and deterministic validation
  • Trace model turns, tool calls, approvals, errors, latency, and token usage while excluding sensitive data
  • Run regression evaluations on every prompt, model, tool, or workflow change

Lab 9

Red-team your agent with malicious web content, hidden instructions, malformed tool arguments, data-exfiltration requests, and runaway loops. Record failures, add controls, and rerun the same evaluation set.