Track 06 · Security & risk reviewLesson 09 of 10
Secrets, dependencies and network isolation
No hardcoded keys, pinned dependencies, and agents fenced off the network.
- Lesson library · reference
- 35 min read
- 60 min hands-on
- Pro
What you'll be able to do
01- Map the full supply chain of an agent system: packages, containers, model weights, hosted model versions, MCP servers, skills, prompts and CI actions.
- Explain why pickle-based model files execute code on load, and choose safe formats and loading settings.
- Produce an SBOM that includes AI components (CycloneDX ML-BOM or SPDX 3 AI and Dataset profiles), and verify signatures and provenance before deploy.
- Design secrets handling for an agent: vault-issued, injected at runtime, never in prompts, configs, repos or images, scanned for, and rotated.
- Implement network isolation for agent runtimes and sandboxes: default-deny egress, an owned allow-list, private endpoints, and evidence that blocked traffic is logged.
- Defend these controls in a security review with artefacts rather than assurances.
Before you start
- MCP: connecting agents to the customer's systems: what an MCP server is and how clients connect to it.
- Tools with scoped, auditable access: where tool credentials live and how they are scoped.
- Subagents, skills and code mode: skills as packaged instructions and code.
- Fan-out and sandboxed parallel work: sandboxes for model-written code.
- Defending against prompt injection: tool poisoning and rug pulls, which this file treats as supply-chain events.
- Agent credentials, from issue to revoke: agent identities and short-lived credentials.
- Assumed background: you have used a lockfile, built a container image and read a CI log.
The short version
An agent system is assembled from parts other people made: Python and npm packages, base images, open-weight models and tokenisers, a hosted model behind an API, MCP servers, skills, guardrail models, CI actions. Each part can be swapped, tampered with or simply changed under you. Supply-chain security means you know exactly which parts you ship (pinned versions, hashes, an SBOM that includes models and datasets), you can prove where they came from (signatures and provenance), and you refuse to load formats that run code on open (pickle) unless you have scanned and signed them. Secrets live in a vault, reach the runtime as short-lived values, and never appear in prompts, config files, repositories, images or logs; scanners check for them at commit, in CI and in images. The network is the last line: agent runtimes and sandboxes get no ambient internet, only a default-deny egress policy with an owned allow-list, private endpoints to model providers and systems of record, and logs of what was blocked. The security team will ask for the scan output, the SBOM, the lockfile and an egress test. Have them ready before they ask.
Key takeaways:
- The agent supply chain includes models, MCP servers, skills and prompts, not just packages. Inventory all of them.
- Pin everything by version and hash. A version tag can be republished; a hash cannot.
- Pickle files are programs. Prefer safetensors; never load untrusted pickles; scan and sign any exception.
- A secret in a prompt is a secret in your logs, your traces and possibly the model's next reply.
- Default-deny egress turns a successful prompt injection from a data breach into a blocked-connection alert.
Pro lesson
The rest of this lesson is in Pro.
The mental model, worked example, field note, failure table, exercise and self-check, with the voice tutor.
- Every stage and specialisation, in full
- Every lab and every role project
- Halden weeks 2–10, on your record
- Every drill, live in the playground
- All solutions, plus the server judge
- Lab Assistant and every Teach with AI