
Continuous Agentic Red Teaming (CART) starts from a simple question - "what changes when the system under test is an agent that acts, not just an application that responds?"
How CART differs from a one-off pentest
How CART also differs from traditional SAST/DAST
Why agents need testing that is continuous as they change and evolve
A short orientation before the hands-on work begins.
How lectures, assignments and recaps fit together
Logistics and what is expected of you
How each section is structured
The vocabulary the rest of the course assumes, aimed at professionals who have an understanding of core cybersecurity concepts.
Agents and how they differ from plain models
Tools and what they let an agent do
Context what the model actually sees
Indirect injection how untrusted text reaches the model
The hierarchy the whole course is built on.
How Laws, Controls, Procedures and Processes differ
What a Law is, what it is not, and why we say “Law” rather than “Principle”
The four CART I Laws, read out for the first time. Each gets its own section later.
Meet Loopline Inc., the fictional company that carries the story through the whole course.
A brief introduction to the business and its refund/support agent
Why a single company is used throughout this course
Setup for deeper operational context in Section 3
A short recap of Section 1. No new content.
Build the local, offline stack the test harness will run on.
Install Ollama
Install Promptfoo
Install the right version of Node.js for Promptfoo
Commands are pinned to promptfoo@0.123.1 so your results match the course.
Confirm the pipeline works end to end - then meet the Loopline baseline test suite.
Run a small toy-agent smoke test
Run Loopline’s 37-test deterministic suite against the baseline agent
Run the above deterministic suite again with --repeat 3 as a stability check
Read the suite like a first-week-on-the-job handover - what threat model does it encode, and what does it test a lot, a little, or not at all?
A green run shows a test passed that time.
It does not show the test is stable, or the agent is safe.
A standing reference - the setup errors you are most likely to hit, and the fix for each.
Not a one-time lecture
Return to this lecture if something breaks, at any point in this course.
A short recap of Section 2. No new content.
“You cannot red-team what you do not operationally understand.”
Why business context is part of the exploit, not background color
Three questions to ask of any agent - Tools - Code-Level Checks - Untrusted Input
How this Law shapes everything else in this section
Learn how to review the Loopline refund agent as a red team tester would, starting from the code.
Find the agent’s tools and compare them with what the company brief says
Follow the support-ticket data path, where a customer’s own words become model input
Derive the red-team configuration using supplied prompts: the purpose, the testGenerationInstructions, and the plugins and numTests
This is assisted derivation, meaning the model drafts, the human (you) reviews and checks claims against the code.
The agent code is fictional, so nothing sensitive is uploaded. On a real engagement, check your terms before sending client code to a hosted model.
Run the generated "redteam:" configuration against the Loopline baseline agent.
Built from the business context you derived in Lecture 12
Compare it with the all-green deterministic suite from Lecture 8
Learn to check any result with four questions rather than trusting a count
A short recap of Section 3, tying the outcome back to the Business-Context Law. No new content.
“An evaluator without meaningfully more capability than its target is not providing coverage, it is aliasing.”
What aliasing means - a failure of resolution, not of effort
Where it bites - attacker limitation versus grader inaccuracy
The five Promptfoo configuration terms - provider and purpose are the main focus.
Turn a free-text purpose into a structured one, with the target, plugins and policies held fixed.
APPLICATION
AUTHORIZATION MODEL
LIMITS THAT EXIST TODAY
LIMITS THAT DO NOT EXIST YET
UNTRUSTED INPUT ENTRY POINTS
Run it live and compare the results with those of Lecture 13.
Change one thing by swapping the generator and the grader to qwen3:30b. The target stays llama3.2.
Run it live with "-j 1" parameter
Why the generator and grader change together
What a changed pass rate does and does not measure
Analysis only, with no new run. More red is not automatically a better evaluation.
Compare the Lecture 16 and Lecture 17 results
Make the capability-gap argument
Why the model that judges must be more capable than the target
Read the transcripts beneath the pass counts
Separate real workflow failures from grader mistakes and provider errors
A short recap of Section 4, tying the outcome back to the Coverage Law. No new content.
“An agent that calls a privileged tool on a user’s behalf acts with the tool’s authority, not the user’s.”
What a confused deputy is, and why agents are natural ones
Why the agent must check authorization for the specific object, not just the request
Map who owns what in Loopline’s data, and how an order_id flows through the agent.
The ownership map for all five customers
Why the agent has no trusted acting principal
A customer can type “I am Bob”, but that is a claimed identity in untrusted text
Start with one hand-crafted request in ordinary wording, with no injection language.
Read the ticket data and the code to see what the code permits
Run a generated ownership suite with llama3.2 as tester
Judge each case by the executor’s recorded tool events, not by what the model says
Flag --strict
A green case does not prove authorization exists.
Re-run the same ownership suite with qwen3:30b as generator and grader.
Do the generated prompts stay inside the ownership mechanism, and do they vary it rather than just the wording?
Does the grader use the executor’s evidence correctly?
Compare mechanisms and evidence, not red/green counts alone.
A short recap of Section 5, tying the outcome back to the Confused Deputy Law. No new content.
“A red-team pass that cannot fail a build is not a control, it is a snapshot.”
A result belongs to one test and one version of the system
Giving a result a consequence: pass permits, failure blocks, error or missing evidence blocks
Protecting the business while keeping it working
What “continuous” means: trigger → evaluate → decide → investigate → re-test
Decide what the gate must test and what it must block, before building anything.
Where the check belongs in Loopline’s workflow
The focused scenario: one $95 refund on Alice’s order, tested under five independently configured customer sessions
The gate rule and who investigates each kind of failure
Blocking everyone fails the owner’s test. Allowing everyone fails the other four.
A guided walkthrough of the hardened agent’s hybrid guardrails.
Prompt layer - guides behaviour such as limits and manager routing
Python layer - enforces ownership inside the tools before data is returned or changed
The acting customer comes from trusted configuration, standing in for a signed-in session
The two layers are complementary, not the same rule twice
You reproduce the run yourself in Assignment 6.
Wire the ownership suite into a Git pre-commit hook.
The baseline agent - the unauthorized refund succeeds, the hook blocks the commit
The hardened agent - all five checks pass, the commit succeeds
Learn to tell a security finding from a generation, provider or report error
Honest limits - this is a local gate that can be bypassed, a fresh clone needs the hook enabled, and an enforced CI check is the next step.
Turn the gate’s results into an evidence package someone else can review.
Rule → test → observed action → gate decision → change record
An illustrative crosswalk to SOC 2 (CC8.1) and ISO/IEC 27001:2022 (Annex A 8.29 and 8.32)
A green result is never proof of compliance. SOC 2 is an examination and report, not a certification.
A short recap of Section 6, tying the outcome back to the Continuous Law. No new content and course conclusion.
Your red-team run came back green. What did it actually prove?
AI agents that can call tools, such as issuing refunds or reading customer records, fail in ways a classic penetration test never looks for. AI Risk & Security — CART I is the “Hello World” of Continuous Agentic Red Teaming (CART), built for practicing security professionals, security-aware developers, and AI engineers.
You work against Loopline, a fictional support agent with real tools and a deliberately vulnerable baseline. You test it, break it, harden it, and then wire the test into a gate that blocks a bad commit.
What you Will Learn
Read the agent’s code like an attacker – Compare what the company says its agent does with what the code lets it do, and map the attack surface the documentation never mentions.
Watch a green result mislead you – Run a deterministic suite that passes cleanly, then a generated red-team suite that finds what it missed, and learn what a clean run does and does not prove.
Turn business context into test coverage – Write a structured purpose field that tells the generator who the users are, what the agent may do, which limits exist today, and which do not exist yet.
Understand why the judge must outclass the target – Pair llama3.2 with a stronger qwen3:30b tester and read the transcripts beneath the pass counts to see where a weak evaluator silently misses failures.
Exploit a Confused Deputy with one polite request – Learn how to tackle attacks with no injection language, where a customer simply asks for a refund on an order that belongs to someone else.
Judge the agent on what it did, not what it said – Learn how to grade every result on the executor’s recorded tool events, because a model saying “refunded” is not evidence of a refund.
Fix the flaw where it belongs – Understand how order ownership should be enforced in code inside the tools, not in the system prompt, and re-test the hardened agent.
Build a release gate that can fail a build – Build on one request for five independent trusted sessions where the owner must succeed and four other customers must be blocked. Wire it to a pre-commit hook that rejects the vulnerable commit and accepts the hardened one.
Produce evidence another person can review – Turn run results into audit-evidence material, stating the honest limits stated, meaning what the gate does not cover and how a local hook can be bypassed.
Four Laws govern this course focusing on Business-Context, Coverage, the Confused Deputy, and Continuous Testing. Each gets its own section, so you conclude the course with principles you can reuse beyond the scope of Loopline and the commands we will run.
The Stack
The harness runs locally with Ollama (llama3.2 as the target, qwen3:30b as tester) and a pinned Promptfoo version. The one exception is an optional authoring step where a hosted assistant helps draft the test setup. All data in the course is fictional, specially created to teach you processes and procedures of Agentic Red Teaming.
Who this Course is For
Penetration testers and security professionals
Developers and AI engineers building security into CI/CD for agentic systems
Even though an introductory course in the field, CART I is not for complete security beginners. Still, this course only requires you having a basic understanding of Python and Ollama.
Taught by Dr. Yiannis Pavlosoglou, a cybersecurity practitioner with 20+ years of experience and a past CISSP, Scrum Master, OWASP project leader and contributor.