Building the Machine · Lesson 1
What you'll be able to do: let a machine act on your project without giving it the keys to everything — grant any agent a scoped, expiring, revocable channel into a protected repo, and prove both that the channel works and that the secret behind it never leaked.
A bank doesn't give the armored-car company a vault key. It gives them a badge that opens the loading dock — two doors, business hours, expires quarterly, revocable from the front desk. Deliveries flow; the vault stays bank-only. The token is the badge; the env var is the badge printer's safe; the MCP server is the loading dock itself.
Where the analogy ends: a badge names its holder; a token authenticates whoever possesses it. Steal the badge and a guard might notice the face; steal the token and GitHub cannot tell. That's why the secret's handling matters more than the badge's scope — and why it never goes in a file, a chat, or a command that gets logged, and why it expires.
Read-Host -AsSecureString) into a user-scope environment variable. You should see: nothing — that's the point. Verify with a substring: first 14 characters only.${GITHUB_MESH_PAT} — single-quoted so the shell can't expand it. You should see: config on disk containing the placeholder text, not the token. Grep the file to prove it.gh) before believing it. An empty answer that flatters you is exactly the one to check.Three parts, strictly separated: the CREDENTIAL (a fine-grained token = what the channel may
do), the STORE (an environment variable = where the secret lives, outside every file), and the
CHANNEL (an MCP server registration = how the agent reaches GitHub). The config references the
store by NAME (a ${VAR} placeholder); the secret itself never enters any file,
command line, or log.
Why three separations instead of one convenience: if the credential leaks, scope limits the
blast (two repos, no admin, no merge); if the config leaks, there's nothing in it (a placeholder
name); if the agent misbehaves, the channel is one revocation away from dead — without touching
the fortress. Compare the failure modes of the shortcuts: a token in a config file is leaked by
any backup, sync, or paste of that file; a token on a command line is leaked to shell history and
logs; reusing a human's broad login (like gh's OAuth) means the agent inherits
everything the human can do, including the things you specifically never want automated. The mail
slot's entire value is what it CANNOT do. Note also the two-channel doctrine: the orchestrator
keeps its own read/review channel, separate from the mesh's write channel — eyes and hands on
different circuits, so blinding one never severs the other. And merge-to-main stays outside the
credential entirely: the branch-protection lock doesn't care whose token asks.
Pass each gate before moving on. These are permission to advance, not hazing.
Lesson complete — you can now give a machine hands that reach exactly two rooms and nothing else, and prove it. Next: Lesson 2 — The Depth Chart, which staffs the minds that will use those hands.