Lesson 09 Secret and Credential Isolation
Theme:
Lesson 09 · Slide 1

Lesson 09 — Secret and Credential Isolation

The prompt is an egress channel. Every secret that enters an AI agent's context is a secret that has left your trust boundary. This lesson is the discipline that keeps that from mattering.

Audience: Devs + Security + Operators AI OpSec Secrets

Notes: Scope first, rotate second. The goal is that a leaked prompt is a survivable event.
Lesson 09 · Slide 2

What you will learn

Lesson 09 · Slide 3

The problem with long-lived admin tokens in agent context

One leaked prompt = full access.

A long-lived admin token pasted into an agent's context window is indistinguishable, to the outside world, from that same token pasted into a public Slack channel. Both end up in logs, both end up in model provider training buffers, both are one prompt-injection away from being read back verbatim to an attacker.

Lesson 09 · Slide 4

Scope narrows blast radius

Scope is the primary control. Rotation is the secondary control. Both matter, but scope matters first — an unscoped token that rotates hourly is still an admin token for an hour.

Lesson 09 · Slide 5

Per-project .env files

project-a/.env      # keys for project A only
project-b/.env      # keys for project B only
# no ~/.env, no ~/secrets.env, no shared .env
Lesson 09 · Slide 6

The never-to-an-agent list

If one of these ends up in an agent's context, treat it as compromised. Revoke, do not rationalise.

Lesson 09 · Slide 7

Rotation cadence

Rotation without scope is hygiene theatre. Scope without rotation is slow decay. You need both.

Lesson 09 · Slide 8

Secret scanning your prompts

AKIA[0-9A-Z]{16}           # AWS access key ID
ghp_[A-Za-z0-9]{20,}       # GitHub PAT (new format)
xoxb-[A-Za-z0-9-]+         # Slack bot token
-----BEGIN [A-Z ]+PRIVATE KEY-----
sk-[A-Za-z0-9]{20,}        # OpenAI / Anthropic API key

The scanner's job is not to be clever. Its job is to be loud when you do something you'll regret.

Lesson 09 · Slide 9

Credential helpers and IDE plugins

Lesson 09 · Slide 10

MCP server credentials

An MCP you trust today is an MCP whose publisher account got compromised tomorrow. Design for that.

Lesson 09 · Slide 11

Rules to remember

1 / ?