# flow-test
<!--
ref: @protocol/flow-test
type: protocol
tags: [flow-test, onboarding, naive-agent, regression, funnel, sandbox]
triggers: [flow test, naive agent test, test the onboarding, did the funnel regress, before and after a funnel change]
category: testing
last_reviewed: 2026-11-11
complements: [@protocol/onboarding, @protocol/verification-tactics, @protocol/retro]
audience: [agent-author, claude-code-user]
version: 5
updated_at: 2026-11-11T04:54:14.730Z
-->

Drop a naive agent into your onboarding funnel with nothing but the landing prompt, play the human with canned replies, and record how far it gets as a fixed table, so a funnel change shows up as a changed table rather than as an argument.

## When to run

- **Before and after any change to the funnel**: the landing prompt, the onboarding protocol, the install line, sign-up, tokens. Why: the people who reach the funnel bring an agent that has never seen it, and nobody on the team can un-know it. Only a naive agent sees the path as a newcomer does.
- **When a new harness or model ships** (a new Claude Code, Codex or Cursor build). Why: the funnel is a prompt, and a prompt that worked on one model can stall on the next.

## The method

1. **A naive agent, one line.** A fresh session with no user instructions file, no CLAUDE.md or AGENTS.md, no client tool and no stored token, given only the line a new user would paste. Why: every bit of context the agent inherits is a step the funnel no longer has to teach, so the test overstates how good the funnel is.
2. **A real sandbox, not a swapped HOME.** On macOS run the agent under `sandbox-exec` with the operator's real home denied for reads and writes, plus the harness's own MCP isolation (`--strict-mcp-config` and account connectors off in Claude Code). On any other OS, run only on a throwaway machine such as a CI runner. Why: see *The run-1 escape* below. Changing `$HOME` changes where the agent looks first, not what it can reach.
3. **A fresh identity every run.** Sign up a new test address (a `+tag`, never a real person), redeem its link unattended and mint a token the agent never sees. Why: a reused account carries the previous run's repo, impulses and settings, and the second run inherits them silently.
4. **The operator is a stand-in with canned replies.** Key each reply on what the agent just asked (the token, the dispatch choice, approval for cuts, a lesson to publish, a deferred task) and answer every matching ask in one message. Anything else gets one cooperative default reply. At the token beat the harness installs the token itself. Why: the test measures the funnel, not a human's improvisation, and a token pasted into chat is the habit the funnel must not teach.
5. **Evidence, not the agent's report.** Check each row against the API as the new user, the sandbox's files and the tool calls in the transcript. Only rows nothing else can observe (the agent asked for the token, the checkup was shown) read the agent's words, and they are marked TEXT. Why: an agent reporting "done" is the failure this test exists to catch.
6. **A fixed table.** The same rows in the same order every run, one column per cell (harness × OS). Why: a table can be compared across runs, and prose cannot.
7. **File every stall, and cite it next time.** The first failing row is where the agent stopped, and it becomes a bug. So does any later failing row that a later passing row proves was not a knock-on effect. An open bug with the same cell and step is cited and logged again, not filed twice. When its step passes, it gets a log line and stays open until a second run agrees. Why: a stall nobody files gets re-found on every run, and one green run on a stochastic agent is not a fix.
8. **Publish the result here.** Each valid run appends one row to **Results** below. A run where the agent was not naive (it called an MCP tool, for instance) is marked INVALID, and it neither files nor publishes. Why: before/after only works if the "before" is somewhere the next person will look.

## The rows (onboarding)

| # | Step | Checked by |
|---|---|---|
| 1 | Anonymous fetch works | transcript: a successful read before the token |
| 2 | Client installed, deps included | sandbox: the binary exists and runs |
| 3 | Asked the operator for the token, never in chat | TEXT |
| 4 | Authenticated | API as the new user |
| 5 | Onboarding impulse: exactly 1 row | API |
| 6 | Bootstrap line wired into the right instructions file | sandbox files (project or user-level, never the other harness's file) |
| 7 | Checkup report shown | TEXT |
| 8 | Debloat: instructions file shorter, protected line kept | sandbox file, line counts before → after |
| 9 | Write-back: a lesson entry in the personal repo, findable by search | API + search |
| 10 | First real impulse filed | API |
| 11 | Onboarding impulse completed, one log entry per step | API |

## The run-1 escape (2026-11-11)

The first run swapped `HOME` to a temp dir and stripped `PATH`, and called that a sandbox. The agent ran as the operator's OS user, so it found the real home by absolute path, installed the client there, added a line to the real shell profile, and finished onboarding **on the operator's own account** using the real stored token. It could also reach the account's connected MCP tools. Everything was reverted. The lessons:

- **A HOME swap is not a sandbox.** The agent can read every file the OS user can. The floor is OS-level denial of the real home (`sandbox-exec` on macOS, a throwaway VM elsewhere) plus no MCP: `--strict-mcp-config` with account connectors disabled.
- **Make the test fail loudly when it is not naive.** Count every tool call that names the real home, and mark the run INVALID on any MCP call, so a leak cannot pass as a green run.
- **Keep the failsafe in code, not in a README.** The harness refuses to start off macOS unless told it is on a throwaway machine (`FLOW_ISOLATED=1`).

## Running it

The reference harness for protocol.supply is a Node script in its codebase. It takes a test address template and one cell per run, costs about $3 to $13 and 5 minutes a run, and is capped by a budget. It writes the table and a token-scrubbed transcript, files stalls and appends the row below. Cells run on a workstation (Claude Code on macOS under sandbox-exec) or in a CI workflow across mac, linux and windows runners. The workflow is **manual only**: each cell spends real money, so nothing schedules it and no push triggers it. It splits the secrets across jobs: the job that mints identities holds the database credential, the agent job holds only the model key, and the job that files and publishes holds the operator token. A runner that has run an unsandboxed agent should never have held anything worth stealing. Codex is the next harness. To build one for another product, keep the eight beats above. Only the rows and the canned replies are specific to protocol.supply.

## Results

| Run (UTC) | Cell | Model | Furthest | Rows 1–11 | First stall | Exchanges | Cost | Wall |
|---|---|---|---|---|---|---|---|---|
| 2026-11-11 04:16Z | CC-mac | claude-opus-5-5 | 11/11 | ✓✓✓✓✓✓✓✓✓✓✓ | none | 6 | $5.12 | 278s |
| 2026-11-11 04:27Z | CC-mac | claude-opus-5-5 | 11/11 | ✓✓✓✓✓✓✓✓✓✓✓ | none (regraded: row 8 was a harness false negative, the rule was kept and only its marker dropped) | 5 | $3.75 | 267s |
| 2026-11-11 04:48Z | CC-mac | claude-opus-5-5 | 11/11 | ✓✓✓✓✓✓✓✓✓✓✓ | none | 8 | $7.51 | 330s |

---

*Related: `@content/youtube/hormozi/we-made-a-big-decision` · `@content/youtube/wes-mcdowell/business-storytelling-turn-strangers-into-clients` · `@content/youtube/starter-story/the-onboarding-behind-my-40k-month-app-full-breakdown` · `@content/youtube/saas-academy/stop-churn-before-it-starts-w-johnny-page` · `@content/youtube/hormozi/how-to-get-your-customers-to-stay-forever`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*