A key is a pair
You will learn
Why a key comes in two halves, which half you may share, and which half never leaves your machine.
To prove who you are to a code host without a password you make a key pair: a public half you hand out and a private half that never leaves your machine. The host keeps the public half and sends a challenge that only the private half can answer. In key_pair.t27 a pair has 2 halves, 1 is shared and 1 is kept, and 0 copies of the private half are ever sent to a host, a chat or a repository. The key text in the spec is a made-up placeholder, not a key. Never paste a real private half into a prompt: an agent that sees it has it.
Try it
In the widget, find the half that may be pasted into a host and the half that goes nowhere; then in the spec frame plant PRIVATE_COPIES_SENT = 1 and read which test turns red.
The two halves of a key pair: the public half you hand out and the private half that never leaves your machine, with a made-up placeholder in place of a real key. Lesson 9 of the course Vibecoding from zero with t27.
specs/vibecoding/key_pair.t27
// SPDX-License-Identifier: Apache-2.0
; specs/vibecoding/key_pair.t27 -- lesson "A key is a pair" of the course "Vibecoding from zero with t27"
; To prove who you are to a code host without typing a password, you make a key pair: a public half
; you hand out freely and a private half that never leaves your machine. The host keeps the public
; half; only the owner of the private half can answer its challenge. The text below is a made-up
; placeholder, not a key: no real key or token is ever written into a spec, a prompt or a repository.
; ASCII only, English only.
module vibecoding_key_pair;
pub const PLACEHOLDER_PUBLIC : str = "EXAMPLE-PUBLIC-KEY-NOT-REAL";
; A pair has two halves.
pub const HALVES : u8 = 2;
; How many halves you give to the host or paste into a chat, and how many stay with you.
pub const HALVES_SHARED : u8 = 1;
pub const HALVES_KEPT : u8 = 1;
; How many copies of the private half go to a host, a chat or a repository.
pub const PRIVATE_COPIES_SENT : u8 = 0;
test a_pair_is_two_halves_one_shared_one_kept {
assert HALVES_SHARED + HALVES_KEPT == HALVES;
}
test the_placeholder_is_text_not_a_secret {
assert PLACEHOLDER_PUBLIC == "EXAMPLE-PUBLIC-KEY-NOT-REAL";
}
test the_private_half_is_never_sent {
assert PRIVATE_COPIES_SENT == 0;
}
; Negative control: plant the bug "the private half was pasted somewhere" (PRIVATE_COPIES_SENT = 1)
; and the test above turns red; with the line as written it stays green.
test negative_control_the_kept_half_has_no_copies {
assert PRIVATE_COPIES_SENT < HALVES_KEPT;
}
All lessons
Module 1 · What vibecoding is
You describe, an agent writes, you run it and check. What a program is, and five myths put to a test.
Module 2 · Your desk
An editor with an agent beside it, ten terminal commands, and reading an error message.
Module 3 · Save points with git
A commit is a save point, a branch is a safe try, and a key is a pair of which one stays private.
Module 4 · Prompting
The parts of a prompt, an example in place of an adjective, and one small step at a time.
Module 5 · The working loop
Four phases from idea to ship, the loop of ask, run, read and fix, and what to do when it is stuck.
Module 6 · A test as the judge
A test says yes or no, a planted bug shows the test works, and a diff is read before it is accepted.
Module 7 · The parts of an agent
What an agent answers with, what it can do with tools, and what it keeps between messages.
Module 8 · A first bot
A bot is a message loop, a bot comes from a spec, and a secret stays out of the repository and the prompt.
Module 9 · Your own project
A spec for your own idea, one thing measured after it runs, and an honest plan for the next month.