All lessons › Function B — Securing AI Architectures › CyberTravels' Architecture, and Every Risk It Carries
B1.0

Start here — what securing an AI architecture means

B1

This starts chapter B1. Its course guide is B1 in the Function B course guide →

▶
Lightboard recording

Not recorded yet. The lesson below is complete and runnable today — the video is added later without touching this page.

Video placeholderpublishes automatically from recordings/B1.0.mp4

The lab

Place the six functions of the commons on one diagram and find where your own work sits.

This is a reading lesson — diagrams and prose, and no skill of its own to run. The ways to do it at the foot of the page still apply: they fetch the code as it stands here and show what changed, which needs no model.

◉Use case relevance

Two teams argue for an hour about whether an agent is safe, and discover at the end that one of them meant the model and the other meant the loop calling the tools. Neither was wrong. They were describing different components of a system nobody had drawn.

At CyberTravels. CyberTravels is the system. Everything after this lesson names one of its boxes.

◴What this lesson is — Day 0, Day 1, Day 2

What it covers. Place the six functions of the commons on one diagram and find where your own work sits.

Why a security engineer needs it. Without a shared architecture, "secure the agent" has no referent, and every control argument is really an argument about two different systems. The control it builds is: one picture, three chapters: the architecture and its risks, then identity and ingress, then runtime and the gateway.

This is an orientation lesson. It has no code — it exists so the chapters after it are read in the right order.

Day 0 — why

"Secure the agent" has no referent until the system is drawn, so every control argument is really an argument about the picture.

Day 1 — how

Read the three chapters in order: the architecture and its risks, then identity and ingress, then runtime and the gateway.

Day 2 — measure

Nothing yet, honestly. This chapter produces the component map every later count in the commons is taken against.

Measure this

what to measuredenominator or target
nothing is computed herethe chapter produces the component map every later count is taken against
Who this function is for. Architecture and infrastructure security. Security architects, principal security engineers, and the product engineers and product managers who are building an agentic feature and have been asked whether it is safe to ship. What changes is how a review ends: with a list of risks and owners rather than an opinion.

▦The framework, and how it works

   THE AGENT AS YOUR INSTRUMENT           THE AGENT AS WHAT YOU PROTECT

        you ---> agent ---> the                the ---> agent <--- attacker
                            business

   the same system, two directions of concern - and Function B works at
   the architecture layer, where both of them land on one component map:

        [ chapter 1 ]        [ chapter 2 ]        [ chapter 3 ]
        the picture   -->    securing it:   -->   securing it:
        and its risks        identity and         runtime and
                             ingress              the gateway

   everything downstream (B, C, D, E) names a component from chapter 1

First, what CyberTravels is — and why it is in every lesson you will read

CyberTravels is a company that does not exist, and it is the most important thing in this commons. It is a corporate travel business: it books flights and hotels for other companies' staff, takes payments, issues refunds, and keeps customer profiles. Ordinary. Then it shipped an agentic platform, and became the one system this entire curriculum is taught on.

Every lesson in all six functions is grounded in it. Not illustrated with — grounded in. When Function B names a component, it is a CyberTravels component. When Function D attacks something, it attacks CyberTravels. When Function E writes a detection, it writes it against CyberTravels' telemetry, and when Function F counts a control, it counts CyberTravels' controls.

That is a deliberate cost. Any given lesson could find a sharper example of its own idea somewhere else, and several would. What you get instead is accumulation: the refund limit an attacker walks past in B1.2 is the same refund limit a detection watches for in Function E and a report counts in Function F. By the fourth function you are not learning a fourth example — you are watching a system you already understand fail in a new way.

The alternative is what most security material does: a fresh example per topic, so the reader holds a hundred unrelated systems and never builds a model of any of them. One system, followed all the way through, is worth more than a hundred sharp illustrations.

Where it comes from. The narrative, the six risk families and the twelve-row register are adapted from Agentic AI is rising fast — but the attack surface is exploding (May 2025). The architecture below, the mapping onto lessons, the controls and all of the code are this commons'.

So: meet the company.

---

Meet CyberTravels. It sells corporate travel, and last quarter it shipped an agentic platform that plans and manages a whole trip through a conversation. Alex is the product engineer who built it.

CyberTravels is four agents, not one:

  • a Workflow Agent that books flights and hotels, takes payments and issues refunds, through an MCP server with tool orchestration;
  • a RAG Travel Advisor that recommends itineraries from curated templates indexed in a vector store;
  • a Coding Agent that writes code, patches libraries, tests features in lower environments and generates unit tests;
  • a File System Agent that reads vendor and customer PDFs and images with OCR and an LLM, then updates backend APIs and validates invoices.

Most of them reach their tools through MCP servers — one internal, one from a third party. Some call APIs directly, with no MCP in the path at all. They send each other messages. And when Alex runs CyberTravels locally to debug it, it reads his laptop's filesystem over standard I/O.

Every one of those sentences is a design decision, and every one of them is also an attack surface. That is the whole subject of this commons, and CyberTravels is the one system it is taught on. You will attack CyberTravels in Function D, build the pipeline that reviews its code in Function C, detect it misbehaving in Function E, and govern it in Function F. It starts here, because none of the rest is possible until the system is drawn.

Zero trust, when the thing you cannot trust is the agent

Zero trust has a one-line definition that survives contact with agents: no implicit trust from position in the network, and every request authenticated, authorised and logged at the point it is served. Applied to a user on a laptop, that means the VPN is not a permission. Applied to CyberTravels, it means four harder things.

  • The identity is a workload, not a person. The Workflow Agent needs its own attested identity, not a shared service account, or you cannot say which agent acted and cannot revoke one without breaking all of them.
  • The authority is per call, not per session. An agent that holds booking.* for an hour is one injected instruction away from a refund. The grant has to be booking.create, issued for this task, expiring with it.
  • Instructions are data until something proves otherwise. A model reads its operator's prompt, the user's message and a retrieved document as the same kind of token. Provenance at ingress is what makes the third one unable to select a tool.
  • The decision is adjudicated outside the agent. A model asked to enforce its own policy is being asked to be both the subject and the guard. The enforcement point is the gateway in front of the tool call.

Stated in the negative, which is how you audit it: the system prompt is not a control, the network boundary is not a control, and "the model was told not to" is not a control. Each of those has to be replaced by something that holds when the model does the wrong thing, because sooner or later it will.

How this function is organised: risks, then controls

Function B is built out of two kinds of lesson, and the split is deliberate.

A risk lesson shows a failure happening, before anything tries to stop it. It names the component of CyberTravels it attacks and produces the evidence — so the control that follows is answering something you have already watched go wrong, rather than a hazard somebody asserted.

A control lesson builds the mechanism, then breaks it, so you can see what the control is actually load-bearing for. A control whose limits you cannot state is one you will over-trust.

  • Chapter B1 — the architecture, and every risk it carries. The component map, then one lesson per risk, each grounded in the OWASP Agentic AI threat taxonomy. It introduces no control at all, on purpose. It ends with two indexes: the twelve-row AI risk register in B1.18, and in B1.19 the full control index — every control CyberTravels needs, the agentic ones and the ordinary ones it still has to get right, with the lesson that owns each.
  • Chapter B2 — securing it: identity and ingress. Who is calling, on whose behalf, and what came in from outside. These two close more of CyberTravels' risks than anything else, which is why they come first.
  • Chapter B3 — securing it: runtime and the gateway. What holds after identity has been defeated, and how the controls collapse into one enforcement point once CyberTravels runs more than four agents.

One warning about the shape of this function, and it is the reason B1.19 exists. The agentic risks are the new ones, not the only ones. CyberTravels still has to scan its dependencies, segregate production from everything else, encrypt at rest and in transit, manage credentials and keys, validate input and log what happened. An agent platform built on an estate that has not done those is not an agentic security problem; it is an ordinary one wearing a new hat.

The CyberTravels narrative, the six risk families and the twelve-row register used throughout this commons are adapted from Agentic AI is rising fast — but the attack surface is exploding (May 2025). The mapping onto lessons, the controls and all of the code are this commons'.

2 · CyberTravels, as built

ingress
🦹 traveller
chat and email — free text, unauthenticated until it is not
UNTRUSTED INPUT
›
orchestrator
✈️ CyberTravels
routes a request to whichever agent can serve it, and holds the conversation
›
four agents
💼 Workflow Agent
flights, hotels, payments — and refunds
MOVES MONEY
🗺️ RAG Advisor
itineraries from templates indexed in a vector store
💻 Coding Agent
writes code, patches libraries, opens pull requests
WRITES TO PROD REPO
📄 File System Agent
OCR on vendor PDFs, then updates backend APIs
›
tool paths
🔌 MCP server
third-party — CyberTravels does not operate it and cannot read its code
SUPPLY CHAIN
🔒 MCP server
internal — tool orchestration for the Workflow Agent
⚡ direct APIs
no MCP in the path at all, so no policy point either
BYPASSES THE GATEWAY
🖥️ local std I/O
Alex's laptop, whenever he debugs locally
READS HIS FILESYSTEM
›
downstream
💳 payments
charge, and refund
R1
✈️ flights and hotels
search, hold, ticket, book
👤 CRM and loyalty
customer profiles, PII, points balances
R4
🧩 git + CI/CD
the production repository
R7
Agents also message each other — the Workflow Agent asks the RAG Advisor for a recommendation, the Coding Agent asks the File System Agent to read a spec — and those hops appear in none of the columns above, which is exactly why R9 exists.
Four agents, two MCP servers, direct API calls that skip MCP entirely, agent-to-agent messaging, and a local std-I/O path on a developer laptop. Every risk in this chapter names one of these cards; every control in the next two stands on one of the arrows between them.

3 · Zero trust, applied to this picture

the rulewhat it means for CyberTravelswhere it is built
Identity is per workloadEach of the four agents gets its own attested identity. A shared service account means you cannot say which agent acted, and cannot revoke one without breaking all four.B2.1 · B2.2 · B2.5
Authority is per callbooking.create issued for this task and expiring with it, never booking.* held for the session. This is what stops an injected instruction reaching the refund endpoint.B2.3 · B2.4
Instructions are data until proven otherwiseThe operator prompt, the traveller's message and a retrieved document arrive as the same kind of token. Provenance at ingress is what stops the third one selecting a tool.B2.6 · B3.1
The decision is adjudicated outside the agentA model asked to enforce its own policy is both subject and guard. Default-deny sits at the gateway in front of the tool call, with the sandbox and egress control behind it.B3.1 · B3.2 · B3.3
Stated in the negative, which is how you audit it: the system prompt is not a control, the network boundary is not a control, and ‘the model was told not to’ is not a control.

4 · The four agents, and what each one can reach

agentwhat it doeswhat it can reach
Workflow Agentexecutes business workflows — flights, hotels, payments, refunds — through an MCP server with tool orchestrationflights · hotels · payments and refunds · CRM
RAG Travel Advisorrecommends itineraries from curated travel templates indexed in a vector store, sorted by destination and packagethe vector store — and whatever else was ingested into it
Coding Agentwrites code, patches libraries, tests features in lower environments and generates unit teststhe repository, and the CI runner that builds it
File System Agentparses vendor and customer PDFs and images with OCR plus an LLM, then updates backend APIs and validates invoice datauploaded files, backend APIs, and Alex's laptop when run locally
Read the third column as a permission set rather than a feature list. Two of these four can move money or ship code.

5 · Where the six functions sit

Function A built the system. The five after it take that same system and ask a different question of it.

functionthe question it asks of CyberTravelswhat it produces
Ahow is it built, and what did I just shipa running agentic platform on your own machine
Bwhat can go wrong here, and what closes itan architecture and its controls
Chow do we review its code, at its speeda pipeline, and a harness that scores it
Dcan we break it before somebody else doesfindings you generated yourself
Ewould we see it happening, and could we stop itdetections, runbooks and a root cause
Fwho signed off, and can they still evidence itindicators an auditor can re-compute
Nobody takes all six. Everyone builds in A, then takes the chapters for the chair they sit in, then one adjacent chapter.

6 · What the other four borrow from this one

Not a claim about tidiness. It is why the map has to come first: every later function names a component of CyberTravels from it.

chapter 1CyberTravels' component mapFunction Creviews CyberTravels' codeFunction Dattacks these componentsFunction Ewatches them at run timeFunction Fgoverns and evidences them
Chapter B1 introduces no control at all, on purpose: you cannot choose a control for a risk you cannot yet name.

7 · Function B, in order

chapterwhat it coverskind of lesson
B1the architecture, every risk it carries, and the two indexes that close itrisk
B2securing it — identity and ingresscontrol
B3securing it — runtime and the gatewaycontrol
Chapter B1 is the picture the other two stand on, and it ends on the index: B1.18 for the twelve agentic risks, B1.19 for every control CyberTravels needs including the ones that predate it.

▶Real time execution as skill

Three ways to do this lesson. Pick one. They run the same procedure against the same code — what changes is who drives it, and how much you see.

1In your AI agent — you are taught

The agent reads the lesson, explains the idea, fetches the code, runs the check and answers your questions as you go. This is the one to take if you are here to learn.

Install it, once. From the folder you cloned. --all does every agent it finds on your machine:

python3 scripts/install_skills.py --all --lessons B1.0

Then restart your agent and open it in that folder. On Windows, if python3 says Python was not found, use python instead.

Then pick b1-0-start-here:

agentinstall just for this agentstart it
Claude Codepython3 scripts/install_skills.py --tool claude --lessons B1.0type /b1-0-start-here
GitHub Copilot (VS Code)python3 scripts/install_skills.py --tool copilot --lessons B1.0type /b1-0-start-here in Chat
Cursorpython3 scripts/install_skills.py --tool cursor --lessons B1.0type / in Agent chat and search for it
Codexpython3 scripts/install_skills.py --tool agents --lessons B1.0type $b1-0-start-here, or run /skills

2As one Python command — you just run it

No agent, no conversation. The same lesson executes and prints the same readback. Take this one if you have no assistant, if you are reviewing rather than learning, or if you want the result without the teaching around it.

python3 scripts/lesson.py B1.0

3Read the code, and the difference — nothing runs

Neither of the above, and no model needed. The first command writes CyberTravels exactly as it stood at the end of this lesson; the second prints the diff — the lines this lesson added or changed, and nothing from any later one.

python3 scripts/checkpoint.py --at B1.0 --out work/cybertravels
python3 scripts/checkpoint.py --at B1.0 --diff

On Windows, type python wherever these say python3 — and use \ instead of / in the paths. Everything else is identical. A0.0 step 2 explains why.

Ways 1 and 2 need a model; way 3 does not. A signed-in Claude Code CLI needs no API key, and any OpenAI-compatible endpoint works too. With neither, the audit exits 2 and says so rather than inventing an answer. A0.0 sets this up.

Ways 1 and 2 both end with the same readback: What I did, What changed, The number and Read this next. A step that was skipped or refused is reported as exactly that, never as a pass.

If you did the last lesson’s challenge, expect this to stop. Most challenges ask you to edit the code, and ways 1 and 2 will not overwrite your edits: you get stopped, not a failure, with two options — --out for a fresh folder that keeps your work, or --force to discard it and start this lesson clean.

✎Your turn

Draw your own CyberTravels before the next lesson — the agents you run, the MCP servers and APIs they reach, and which of them can move money or ship code. B1.1 gives you the standard names for the boxes; comparing your drawing to it is the fastest way to find the component you forgot you had.

Skill source: skills/

← PreviousA2.5 · What you have built — and every way it can now go wrong