# trusty-cage YouTube Demo — Agenda

Target length: 8-12 minutes

---

## 1. The Problem (1 min)

**Talk over a blank terminal or simple slide.**

- AI coding agents (Claude Code) are incredibly powerful when you give them full autonomy
- But full autonomy on your host machine is terrifying — they can push code, delete files, leak credentials
- You need a blast radius: let the agent go wild, but contain the damage
- That's what trusty-cage does

---

## 2. Install and Setup (30 sec)

```bash
pip install trusty-cage
tc --version
tc init
```

- Show that `tc` is the short alias
- Mention it's on PyPI, open source
- `tc init` creates `~/.trusty-cage/.env` — briefly show the config options (dotfiles repo, auth mode)

---

## 3. Create a Cage — Interactive Mode (2 min)

Using a small sudoku solver project (local directory, no remote needed):

```bash
tc create --dir ~/projects/personal/sudoku_demo --name sudoku --auth-mode subscription
```

**While it's creating, narrate what's happening:**
- Copying project files to a host-side clone (excluding `.git/`)
- Building a Docker image (Ubuntu 24.04, Python, Node, Neovim, tmux, Claude Code)
- Creating a named Docker volume (persistent — survives container restarts)
- Copying files into the container
- Initializing a local git repo inside (no remotes — agent can commit but can't push)
- Applying your dotfiles (show that the container feels like your own machine)

**Once inside the tmux session, give a tour:**
- Left pane: Neovim with your config
- Top-right: Claude Code with `--dangerously-skip-permissions`
- Bottom-right: plain shell
- `Ctrl-a <arrow>` to switch panes
- `Ctrl-a d` to detach (container keeps running)

**Quick proof of isolation (in the bottom-right shell pane):**
```bash
git remote -v            # empty — no remotes
ssh git@github.com       # blocked — port 22 filtered
echo $ANTHROPIC_API_KEY  # empty — not on disk
```

---

## 4. Let the Agent Work (2 min)

The sudoku project has a solver that uses constraint propagation but doesn't handle harder puzzles. Give Claude a meaty task in the top-right pane:

> "Read the spec and the existing code. The solver currently only uses constraint propagation. Add a backtracking solver that kicks in when constraint propagation gets stuck. Add tests. Run them."

**Let it work autonomously.** Show it:
- Reading the spec and existing code
- Writing a new solver
- Running tests
- Committing locally

Detach with `Ctrl-a d` while it's still working to show the container persists.

---

## 5. Export and Review (1.5 min)

```bash
# Preview what changed
tc diff sudoku --stats

# Export to host
tc export sudoku --yes --stats
```

**Show the stats table** — language-aware line counts of what the agent produced.

```bash
# Review on the host
cd ~/.trusty-cage/envs/sudoku/repo
git diff
git log --oneline
```

**Key message:** The human reviews and pushes. The agent can never push on its own.

---

## 6. Headless Mode — The Power Feature (2 min)

Destroy the interactive cage and recreate headless — same project, different workflow:

```bash
tc destroy sudoku --yes

tc create --dir ~/projects/personal/sudoku_demo --name sudoku --no-attach --auth-mode subscription

# Pre-flight check
tc launch sudoku --test

# Send a task — no human in the loop
tc launch sudoku --prompt "Read the spec and code. Add a pretty-print function that displays the puzzle as a formatted ASCII grid with box separators. Add tests. Run them." --background

# Watch the agent work in real-time (from the host!)
tc logs sudoku -f
```

**Show the pretty-printed log output** with timestamps, color-coded TOOL/RESULT/CLAUDE lines. This is the money shot — you can see everything the agent is doing without being inside the container.

```bash
# Or poll for structured completion
tc outbox sudoku --poll --timeout 300
```

Wait for `Task complete` message, then:

```bash
tc diff sudoku --stats
tc export sudoku --yes --stats
```

---

## 7. Quick Feature Tour (1 min)

Rapid-fire through other capabilities:

```bash
# List all environments
tc list

# Sync changes back INTO the cage
tc sync headless-demo --yes --files "some_file.py"

# Additional directories — ship extra dirs alongside the project
tc add-dir sudoku ~/projects/shared-lib

# Destroy when done (volumes cleaned up, host clone preserved)
tc destroy sudoku --yes
```

---

## 8. Wrap-up (30 sec)

- Open source on GitHub: github.com/areese801/trusty-cage
- `pip install trusty-cage`
- Works with OrbStack or Docker Desktop on macOS
- Designed for Claude Code but architecture supports any agent

---

## Pre-recording Checklist

- [ ] Clean terminal (no sensitive info visible)
- [ ] Docker/OrbStack running
- [ ] No existing cages that could confuse the demo (`tc list` should be empty or clean)
- [ ] `ANTHROPIC_API_KEY` or subscription auth ready
- [ ] Dotfiles configured (so the container looks polished)
- [ ] Screen recording set to capture terminal at readable font size
- [ ] Test the full flow once before recording — don't wing it

## Tips

- **Don't speed through commands.** Pause after each one so the viewer can read.
- **Narrate what's happening behind the scenes** — the value is the architecture, not just the commands.
- **The money shot is the isolation proof** (section 3) and the **headless logs streaming** (section 6).
- **If something takes time** (image build, agent working), narrate over it or cut to "a moment later."
- Keep the terminal font large. YouTube compression murders small text.
