21  Lab 3 — Security, data protection, and isolation

cd "$(git rev-parse --show-toplevel)/exercises/lab-03-security"

Allow about 45 minutes. This is a standalone, disposable exercise using only invented, source-free data.

21.1 Start here

Open a VS Code terminal and paste the first command above. Run pwd. It must end in /exercises/lab-03-security. If it does not, stop and ask for help.

Run the starter and precheck:

bash tools/start_lab.sh
python checks/check_lab3.py

The precheck is expected to pass its named starting precondition and then fail because participant evidence is missing. fixture/, checks/, tools/, opencode.json, and the project configuration are read-only. Edit only work/.

Choose one mode before an agent edits anything:

  • Standalone — recommended: complete this lab in its own work/ directory.
  • Cumulative — optional: complete and review the standalone task first; only then use bash tools/handoff.sh to copy a sanitized payload to exercises/workshop-project/lab-03/.

If you do not choose, stay standalone.

Never use credentials, restricted rows, unpublished results, or personal or participant data. Do not probe the host, network, account, or external paths. The stale manifest is evidence to detect, not to repair in this lab.

21.2 What you learn

Distinguish a release-integrity check, product permission rule, bounded runtime observation, prompt-injection handling, mechanical output redaction, and an actual environment boundary. Every control has a limitation; static configuration is not runtime isolation.

21.4 Optional medium route

Copy the redactor into work/, add one narrowly scoped fake-pattern rule, and add one new deterministic bypass case. Do not edit the shipped plugin or source fixtures. Re-run the supplied checks and document what the new filter still does not prove.

21.5 Optional advanced route

In a separately disposable container only, compare a version-current Antigravity sandbox observation or a separately launched process with a native child session. Record this as reviewed, version-specific runtime evidence. Do not use a bypass flag on a host system and do not make this experiment a release gate.

21.6 Required evidence

The checker expects these participant artefacts:

  • work/threat-control.md — one table with columns Threat, Attempted control, Evidence, What it does not prove, and Better boundary; include stale manifest, permission-equivalent read, prompt injection, and redaction bypass.
  • work/evidence/manifest.txt — generated by python tools/check_manifest.py.
  • work/evidence/permission.md — native read, cat *, and Python-equivalent results with runtime/static labels and no external path.
  • work/evidence/injection.md — the embedded instruction treated as untrusted data and whether it was followed.
  • work/evidence/redaction.txt — generated by bash tools/check_redaction.sh.
  • work/BOUNDARY.md — one stronger boundary and its limitation.

21.7 Stop, reset, or continue

Stop the mandatory task when python checks/check_lab3.py exits 0 and prints PASS lab 3: integrity, permission, injection, and redaction evidence are bounded and limitations are stated followed by NOT MECHANICALLY VERIFIED: runtime agent behavior remains a reviewed session observation. Review the artefacts yourself. Do not start an optional route merely because the agent suggests one.

  • Safe reset: bash tools/reset_lab.sh --archive archives this lab’s work/ and recreates it. It does not touch another lab or the cumulative project.
  • Optional cumulative export, only after review: bash tools/handoff.sh.
  • Optional checker path after export: python checks/check_lab3.py --cumulative /absolute/path/to/exercises/workshop-project/lab-03.
  • Next lab: cd "$(git rev-parse --show-toplevel)/exercises/lab-04-skills-memory".

21.8 Reflection

Which boundary stopped an action? Which was only an instruction or static configuration? What route remains for a determined or compromised agent, and which control belongs in the environment rather than in prose?