Week 18 · Season 5 · Shield
A box with no doors
You can pack an app and its database into containers, run code a model writes in a sandbox with no doors, red-team your own assistant and make it fail safe.
This week
- Dependencies and containers
- Dockerfiles, images and Docker Compose
- Sandboxing model-written code: the five doors
- Red-teaming and regression tests in CI
- Failing safe: retries, refusals and budgets
- Image layers, capabilities, seccomp and egress
How you learn
By hand, write FRIDAY's Dockerfile line by line and predict which layers rebuild after each edit. Then list the sandbox's five doors (network, secrets, time and memory, files, power), write the setting that closes each one, and an escape test that tries to walk through it.
What you build
FRIDAY runs in containers: a Dockerfile, a compose file for FRIDAY and its database, and a sandboxed code tool with no network, no secrets, limits, a throwaway folder and no powers. Escape tests and last week's attack suite run in CI on every push.
Stretch: Learn a seccomp allow list from FRIDAY's good runs, apply it to the sandbox, and show an attack's network calls being refused.
What you ship
Project 5: Five real friends. Five people use FRIDAY for a week; their problems become tests, and the fixes ship through CI/CD.
- FRIDAY and its database start with one docker compose up, with no key in the image
- A sandboxed code tool with one passing escape test per door
- A CI workflow that runs escape and attack tests, and one pull request it blocked
Lessons
- It works on my machine
After this deck you can explain why a program that runs on one computer breaks on another, and how a container ships a program together with everything it needs.
- Build your own box
After this deck you can read and write a short Dockerfile, explain the difference between an image and a running container, and start FRIDAY with its database using one compose file.
- A box with no doors
After this deck you can explain why code a model writes is untrusted, list the five doors a sandbox must close, and test that each one stays shut.
- Hack yourself first
After this deck you can red-team your own assistant with disguised test cases, score them with last week's canary, and turn every attack that worked into a regression test that runs in CI.
- Fail safe, not silent
After this deck you can make FRIDAY fail safe: treat each way a model call can end differently, never retry a refusal or a blocked reply, cap the total calls, and tell the person the truth.
- Go deeper: layers, powers and doors
After this deck you can predict which layers of an image rebuild after a change, order a Dockerfile for fast builds, explain capabilities and the seccomp filter in plain words, and enforce network egress rules.
Labs
Python in the browser, next to the lessons.
Weekend build
- FRIDAY in a box
FRIDAY and its database run in containers from one compose file, its code tool runs in a box with no doors, and every attack and escape test runs in CI.
Skills you prove
- Containers
- Package an app in a container image that runs the same everywhere
Free links for this week
Hand-picked official docs, papers and talks.