What encrypts
When the server can read the passphrase from the keystore, every JSONL line is encrypted with Fernet (AES-128-CBC + HMAC-SHA256) before append. What decides it is what the keystore answered, and it can answer three ways. The passphrase read: the veil is on and every line is sealed. The keystore said no such item exists (security exit 44): the veil is off, the posture of a backup Mac that holds the files as opaque blobs, and only then is a line written plain. Anything else, a locked login keychain, a read that times out, no security binary, an error: the veil is unavailable, and nothing is written plain. Found and missing are remembered for the life of the process; unavailable never is, and the keystore is asked again after RETRY_SECONDS (30 s). Writers decide through must_encrypt() / seal_line(), never is_enabled(), because a plain false would fold the third answer back into the second. The passphrase lives in the local OS keystore (security find-generic-password -s {service-name} -a {account-name}). SHA-256 of the passphrase derives the Fernet key deterministically — any Mac that knows the passphrase reads any encrypted JSONL. Machines without the keystore entry store the encrypted files opaquely as blob-backup endpoints.
Held, never written plain
While the veil is unavailable, SessionLogger keeps each line in memory, in order, keyed by the file it belongs to, and the first write, close or shutdown that finds the key readable again writes them all sealed. Chat goes on and every finished turn still lands in SQLite. A crash in that gap loses the held lines, and for a turn caught mid-stream they are the only record of what Dad already saw, because the segment still streaming is written to SQLite only when it completes (a steered Claude turn commits the segments before it as it goes; lesson 3 names this exception). Dad gets one Telegram when an outage begins and one when it ends. The other writers (healing, import, the intercom, connector secrets) refuse with VeilUnavailable instead.
가림막 — peace of mind
The threat model is honestly named: 가림막 (Korean for 'screen' or 'cover'). It defends against accidental visibility — Finder or Path Finder previews, shoulder-surfing, fleet sync going somewhere new — not against a determined attacker with filesystem + Keychain access. We're not pretending otherwise.
Plain + encrypted coexist
Read paths auto-detect by first byte: { is plain JSON, g is Fernet base64. A single JSONL may carry both during/after migration, and reads handle either. A line that starts with g on a Mac whose key will not read raises VeilUnavailable; it never comes back as text for a parser to skip.