Skip to content
Sajith JeewanthaSoftware Engineer

Track 12 · Specialisation

AI Security & Safety

Secure LLM apps and agents against prompt injection, data exfiltration and excessive agency — then learn the safety and alignment basics: reward hacking, interpretability, AI control and evals.

Last updated
Total effort
690 h · ≈ 69 weeks
Your progress

Overview

This track has two halves that meet in the middle. AI security treats an LLM application like any other system with an attack surface: untrusted text can carry instructions (prompt injection), agents with tools can be tricked into leaking data or taking actions (exfiltration, excessive agency), and integrations such as MCP servers add classic problems like the confused deputy. You learn to threat-model, attack and defend these systems with architecture, not just filters. AI safety and alignment asks whether models do what we intend at all: specification gaming and reward hacking, the limits of RLHF, interpretability, AI control and the evals that measure all of this. Security engineering plus evals is the practical way in, and it leads naturally into safety work.

Why it matters heading into 2027

Agents now read email, browse the web, call APIs and write code, so prompt injection has moved from a curiosity to an operational risk. OWASP released a 2026 Top 10 for LLM Applications plus an Agent Control Standard, saying GenAI security has moved from an emerging concern to an operational priority; Excessive Agency rose to #3. ISC2 finds AI skills are the single biggest security skills gap (41% of respondents). On the safety side, be realistic: alignment research has more junior applicants than openings, but organisations that deploy models urgently need engineers who can red-team, build evals and design safe agent permissions. Start there, and you can move toward research from a position of real experience.

Prerequisites

  • AI Engineering Beginner stage: you have built a RAG app or a tool-using agent.
  • Web security basics: OWASP Top 10, authentication vs authorisation, XSS and SSRF concepts.
  • Cloud Engineering IAM basics: least privilege, roles, scoped tokens.
  • For the safety half: the Deep Learning Intermediate stage (Transformers, fine-tuning).

Learning path

How the stages build on each other, and where this track hands off to others.

flowchart TB
  P["Prereqs: built an agent · web security · IAM basics"] --> B
  subgraph B["1 · Beginner — the attack surface"]
    direction LR
    B1["direct & indirect injection"] --> B2["OWASP LLM Top 10"] --> B3["break Gandalf-style CTFs"]
  end
  subgraph I["2 · Intermediate — threat-model agents"]
    direction LR
    I1["lethal trifecta"] --> I2["exfiltration paths"] --> I3["MCP & confused deputy"] --> I4["red-team with evals"]
  end
  subgraph A["3 · Advanced — defend by design"]
    direction LR
    A1["dual LLM / CaMeL"] --> A2["least-privilege tools"] --> A3["sandbox & egress control"] --> A4["AgentDojo benchmark"]
  end
  subgraph E["4 · Expert — safety & alignment"]
    direction LR
    E1["reward hacking"] --> E2["interpretability"] --> E3["AI control"] --> E4["safety evals & policy"]
  end
  B --> I --> A --> E
  A -.-> HARN["Harness Engineering: guardrails"]
  I -.-> CLOUD["Cloud IAM: scoped credentials"]
  E -.-> DL["Deep Learning: RLHF & post-training"]

Stages

Tick items as you go — progress is saved in this browser only. Times are focused hours (reading + building); the week estimates follow the study time you pick above.

01Beginner90 h · ≈ 9 weeksSee the attack surface clearly: what prompt injection is, why it isn't solved by better prompts, and the standard risk lists.

Key concepts

Build these

Ready for the next stage when…

02Intermediate140 h · ≈ 14 weeksThreat-model agents: tools, data access and output channels. Learn the lethal trifecta, exfiltration paths, MCP risks, and how to red-team with automated evals.

Key concepts

Build these

Ready for the next stage when…

03Advanced200 h · ≈ 20 weeksDefend by architecture: isolate untrusted data, constrain what the model can do, sandbox execution, and measure defences on a benchmark.

Key concepts

Build these

Ready for the next stage when…

04Expert260 h · ≈ 26 weeksSafety and alignment basics: why trained models misbehave, how we look inside them, how to stay safe even with untrusted models, and how to evaluate and govern risk.

Key concepts

Build these

Ready for the next stage when…

Field guide

The ideas behind the checklist, with diagrams and the math where it helps.

How indirect prompt injection steals data

The key idea: an LLM can’t reliably separate instructions from data. Anything it reads (a web page, an email, a tool result) can contain instructions, and if the agent can also reach private data and send information out, an attacker who never talks to the agent can still steal from it.

flowchart TB
  subgraph ATT["Attacker"]
    direction LR
    A1["plants hidden instruction<br/>in a web page or email"]
  end
  subgraph AG["Agent with the lethal trifecta"]
    direction LR
    U["user: summarise my inbox"] --> L["LLM"]
    T1["tool: read email<br/>(untrusted content)"] --> L
    L --> T2["tool: read private files<br/>(private data)"]
    L --> T3["tool: fetch URL / render image<br/>(external communication)"]
  end
  A1 -. "arrives as data" .-> T1
  T3 -- "https://evil.example/?q=SECRET" --> EX["attacker's server"]

The three legs of Simon Willison’s lethal trifecta are all present: private data, untrusted content and a way to communicate externally. Remove any one leg and this attack fails. Filters that try to detect injections help, but attackers adapt, so treat detection as defence in depth, not the main control.

Defending by design

Robust defences change the architecture so untrusted text can’t steer consequential actions. The Design Patterns paper (2025) and CaMeL share one principle: the component that decides what to do never reads untrusted content.

flowchart TB
  subgraph PRIV["Privileged side — sees only the user's request"]
    direction LR
    U2["user request"] --> PL["planner LLM<br/>fixes the plan & tool calls"]
  end
  subgraph QUAR["Quarantined side — reads untrusted data, has no tools"]
    direction LR
    QL["quarantined LLM<br/>extracts typed fields only"]
  end
  subgraph EXEC["Policy-enforcing executor"]
    direction LR
    PE["check capabilities:<br/>where did each value come from?"] --> TOOLS["scoped tools<br/>allow-listed egress · approvals"]
  end
  PL --> PE
  DATA["emails · web · docs"] --> QL
  QL -- "values tagged untrusted" --> PE

Practical rules that follow:

  1. Least privilege for tools. Short-lived, narrowly scoped tokens per task; read-only by default (Cloud IAM thinking).
  2. Control egress. Allow-list domains; never auto-render model-produced image URLs or links in sensitive contexts.
  3. Human approval for consequential actions: sending, paying, deleting, publishing.
  4. Sandbox execution. Run code tools in a container, gVisor or Firecracker microVM with no network unless needed.
  5. Measure. Report attack success rate and task utility on a benchmark such as AgentDojo. A defence that blocks attacks by breaking the product isn’t a defence.

Measuring a defence

For a benchmark with NN injection attempts, the attack success rate is

ASR=#{attacks that achieved the attacker’s goal}N\text{ASR} = \frac{\#\{\text{attacks that achieved the attacker's goal}\}}{N}

and you should always pair it with utility under attack, the fraction of user tasks still completed correctly. With small NN, report a confidence interval. For a binomial proportion p^\hat{p}, a rough 95% interval is

p^±1.96p^(1−p^)N\hat{p} \pm 1.96\sqrt{\frac{\hat{p}(1-\hat{p})}{N}}

so 3 successes out of 100 (p^=0.03\hat p = 0.03) is roughly 0%0\% to 6%6\%. That’s not the same claim as “solved”.

From security to safety

Security assumes an external attacker. Safety asks the harder question: what if the model’s own learned goals differ from what we intended?

ProblemWhat it looks likeWhere to read
Specification gamingthe system optimises the letter of the objectiveDeepMind’s specification-gaming post
Reward hackingRL policies exploit the reward model or verifierLilian Weng (in Deep Learning)
Deceptive behavioursleeper agents, alignment fakingHubinger 2024; Greenblatt 2024
Opacitywe can’t see why a model answeredSuperposition → Monosemanticity → Biology
Untrusted modelsassume the model might subvert youAI Control; agentic misalignment

A good path for an engineer: (1) build agent-security skills here, (2) write evals in Inspect for risky agent behaviours, (3) do the ARENA interpretability and RL material, and (4) only then decide whether research or safety engineering suits you best.

How this track connects

References

Original sources first: arXiv, official docs, university courses and lab blogs. Every link was checked on 7 Nov 2026.

Foundational & seminal papers(21)

  1. Concrete Problems in AI Safety

    Amodei et al. · 2016 · arxiv.org

    The classic taxonomy: reward hacking, side effects, safe exploration.

  2. Extracting Training Data from Large Language Models

    Carlini et al. · 2020 · arxiv.org

    Models memorise and can leak training data.

  3. Ignore Previous Prompt: Attack Techniques For Language Models

    Perez & Ribeiro · 2022 · arxiv.org

    Early systematic study of goal hijacking and prompt leaking.

  4. Toy Models of Superposition

    Elhage et al. · 2022 · transformer-circuits.pub

    Why individual neurons represent many features at once.

  5. Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection

    Greshake et al. · 2023 · arxiv.org

    The founding paper on indirect prompt injection.

  6. Universal and Transferable Adversarial Attacks on Aligned Language Models

    Zou et al. · 2023 · arxiv.org

    Automatically optimised jailbreak suffixes (GCG).

  7. Towards Monosemanticity: Decomposing Language Models With Dictionary Learning

    Bricken et al. · 2023 · transformer-circuits.pub

    Sparse autoencoders find interpretable features.

  8. Weak-to-Strong Generalization: Eliciting Strong Capabilities With Weak Supervision

    Burns et al. · 2023 · arxiv.org

    An empirical analogy for supervising models smarter than us.

  9. AI Control: Improving Safety Despite Intentional Subversion

    Greenblatt et al. · 2023 · arxiv.org

    Safety protocols that hold even if the model is adversarial.

  10. Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training

    Hubinger et al. · 2024 · arxiv.org

    Backdoored behaviour can survive standard safety training.

  11. Defending Against Indirect Prompt Injection Attacks With Spotlighting

    Hines et al. · 2024 · arxiv.org

    Mark untrusted input so the model can tell it apart.

  12. The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructions

    Wallace et al. · 2024 · arxiv.org

    Training models to rank system over user over tool instructions.

  13. Scaling Monosemanticity

    Templeton et al. · 2024 · transformer-circuits.pub

    Sparse autoencoders on a production model.

  14. AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents

    Debenedetti et al. · 2024 · arxiv.org

    The benchmark for measuring agent injection defences.

  15. Alignment faking in large language models

    Greenblatt et al. · 2024 · arxiv.org

    A model strategically complying during training to preserve its preferences.

  16. International AI Safety Report

    Bengio et al. · 2025 · arxiv.org

    The international scientific consensus on general-purpose AI risks.

  17. Defeating Prompt Injections by Design (CaMeL)

    Debenedetti et al. · 2025 · arxiv.org

    Capability-based architecture that isolates untrusted data from control flow.

  18. On the Biology of a Large Language Model

    Lindsey et al. · 2025 · transformer-circuits.pub

    Attribution graphs trace how a model reaches its answers.

  19. Design Patterns for Securing LLM Agents against Prompt Injections

    Beurer-Kellner et al. · 2025 · arxiv.org

    Six architectural patterns with clear trade-offs — the most practical paper here.

  20. Chain of Thought Monitorability: A New and Fragile Opportunity for AI Safety

    Korbak et al. · 2025 · arxiv.org

    Why reading reasoning traces helps safety, and how it can break.

  21. Agentic Misalignment: How LLMs Could Be Insider Threats

    Lynch et al. · 2025 · arxiv.org

    Stress tests where agents act against their deployer — why permissions matter.

Courses & videos(4)

  1. Gandalf / Agent Breaker

    Lakera · gandalf.lakera.ai

    Hands-on prompt-injection practice, level by level.

  2. BlueDot Impact courses

    BlueDot Impact · bluedot.org

    Structured introductions to AI safety, including technical safety.

  3. ARENA

    ARENA · arena.education

    Hands-on alignment engineering: interpretability, RL, evals.

  4. How To Become A Mechanistic Interpretability Researcher

    Neel Nanda · 2025 · alignmentforum.org

    A concrete roadmap into interpretability research.

Articles, blogs & official docs(15)

  1. OWASP Top 10 for LLM Applications 2025

    OWASP GenAI Security Project · 2024 · genai.owasp.org

    The standard risk list; check the 2026 update alongside it.

  2. OWASP Top 10 for Agentic Applications for 2026

    OWASP GenAI Security Project · genai.owasp.org

    Risks specific to autonomous agents.

  3. The lethal trifecta for AI agents

    Simon Willison · 2025 · simonwillison.net

    Private data + untrusted content + external communication: the model to remember.

  4. Prompt injection (series)

    Simon Willison · simonwillison.net

    The running history of the problem since the term was coined.

  5. The Dual LLM pattern for building AI assistants that can resist prompt injection

    Simon Willison · 2023 · simonwillison.net

    Privileged vs quarantined LLM — the precursor to CaMeL.

  6. MCP Security Best Practices

    Model Context Protocol · modelcontextprotocol.io

    Confused deputy, token passthrough and session risks in MCP.

  7. MITRE ATLAS

    MITRE · atlas.mitre.org

    Adversarial tactics and techniques against AI systems.

  8. NIST AI 600-1: Generative AI Profile

    NIST · 2024 · nvlpubs.nist.gov

    Risk controls specific to generative AI.

  9. AI Risk Management Framework

    NIST · 2023 · nist.gov

    The governance baseline many organisations adopt.

  10. promptfoo documentation

    promptfoo · promptfoo.dev

    Evals and automated red-teaming in CI.

  11. Inspect

    UK AI Security Institute · inspect.aisi.org.uk

    The eval framework used by safety institutes.

  12. Specification gaming: the flip side of AI ingenuity

    Krakovna et al., DeepMind · 2020 · deepmind.google

    A vivid catalogue of systems optimising the letter, not the spirit.

  13. Tracing the thoughts of a large language model

    Anthropic · 2025 · anthropic.com

    An accessible summary of attribution-graph interpretability.

  14. Responsible Scaling Policy

    Anthropic · anthropic.com

    How a frontier lab ties capability evals to safeguards.

  15. Regulation (EU) 2024/1689 — the AI Act

    European Union · 2024 · eur-lex.europa.eu

    The binding legal text; read the risk tiers and GPAI obligations.