Security
This software stores a person's whole life. Treat every bug as if it were serious.
Reporting
Report a vulnerability privately: through GitHub's private vulnerability reporting on this repository, or to the address in the repository profile. Never in a public issue. You will get a reply within 48 hours. The fix ships before the report is disclosed, and the advisory names you unless you ask it not to.
Threat model
What is protected. One folder on a machine the owner controls: the record (logbook/<YYYY>/<MM>.jsonl), the notes, the attachments, the policy files, the owner's signing key and the sealing identity. The record is the whole of a person's whereabouts, company, words, health and money, so a copy of the folder is the asset, and the chain head is the proof that nobody changed it.
Who the adversary is. Anyone who obtains the files: a stolen laptop, a backup disk in the wrong hands, a cloud drive the folder was mistakenly placed in, malware on the machine, a member of the owner's circle who was handed one page and wants the rest, and an agent that was given read access and asked for more. The adversary is not assumed to hold the owner's key.
What is defended today.
- Integrity. Every line carries the hash of the one before (SPEC §3).
verifyfinds any edit, removal or reordering, and a broken chain is an error, never repaired silently. Nothing in the code updates or deletes a line; a correction is a new line that retracts an old one. The two operations that recompute hashes,repair migrateandkey seal --all, verify every original hash under the rule it was written with and every link across the whole record before they write, and refuse a record that fails, so a line that does not verify is never given a fresh hash. - Confidentiality at rest. Tier 1 is plain. Tiers 2 and 3, the words, the names, the amounts and the samples, are sealed with age to recipients the owner holds (SPEC §2 and §4, RFC 0029, ADR 0020) once the record names them: the identity never enters the record and is never in a variable on disk, and there are two recipients at least, so a lost laptop loses nothing and a lost key loses the words of tiers 2 and 3 and never the chain. The envelope stays plain, so an adversary with the files learns the shape of the owner's days, a message from which source at what time, and none of the words; RFC 0029 §2 states that limit. The chain is verifiable without any key; with the key,
verifyopens every sealed line and checks it against its digest. Attachments a sealed line points at are sealed under the same name, and the index, a plaintext locator, lives in the user's cache directory with chat ids blinded, never in the record. - Nothing leaves. There is no server and no account, and reading never opens a connection. Every reader touches the record and the tables shipped in the package, nothing else.
tests/test_no_network.pyreplaces the socket,urllib,http.clientand, where installed, thehttpx,requestsandwebsocketsrequest paths with ones that record and refuse every connection, runs every reader against the demo record and every page ofservethrough it, and fails if any of them asked for one, whatever it printed or caught. A socket opens only behind a command that says so:syncfor the live source it names,videos fetchfor the bytes of the family's videos into the bounded cache understate/videos/(and, with--models, the two modelsvideos inferuses;videos inferitself never opens one),derive transcripts --fetch-modeland its siblings for a model this machine has not got,setup speakers --fetch-modelfor the speaker models (with the owner'sHF_TOKEN, read for those requests only, never written or printed),dreamandtranscript synthesizefor the model endpoint thedreamentry allows,doctor --packetfor one probe of that endpoint and only while thedreamentry allows it (with no entry, or one expired, the packet says the probe was not sent),doctorfor one HEAD to 127.0.0.1 when a serve service is installed,setup places review --ask-photosfor the owner's photo library,people review --from-googlefor the owner's Google contacts, andservelistening on 127.0.0.1, refusing any other host, and reading for this machine and the owner's named phone only.sync heardfetches a feed's transcript only under aheardentry that says"fetch": true, from an address on the public internet alone (never this machine, its network or the tailnet), connecting to the address it checked, never through a proxy, on ports 80 and 443. A change that needs a reader to fetch anything is wrong; a new reader goes into that test's list. - Voiceprints. The registry
review speakersproposes names from,voiceprints.age, is biometric: it holds vectors that recognise a voice in any recording. It is one file sealed to the record's recipients (a record without recipients keeps none on disk), written whole through a temporary name, sealed again before the record's own lines when a recipient is removed (so the removed identity opens no copy of it, even when the change stops half way), a cache rebuilt from the record thatverifyignores andbackupleaves out, and nothing reads it but the review, the commands that write it,setup speakersanddoctor, which say it is there and never what is in it. No crossing, shared page, trip bundle, vault, site, MCP answer, dream or export carries it or any vector of it, whatever the tier (RFC 0038 §5.3); a test builds every one of them over a record with a registry and looks for both. - The circle. A shared page or trip is a bundle signed with the owner's Ed25519 key, holding only the lines the owner's
policy/crossing.jsonlets cross to that one named person at their tier ceiling. The receiver verifies the signature and keeps the bundle beside the record, never in its chain. A person the policy file does not name receives nothing. An agent over MCP, a site, a vault and the world map get tier 1 when the file names none: the shape of the days and no note, message, name, health or money. - Adapters. An adapter is untrusted code that runs without network by default, never writes to its source, and can only append. An app store is opened read-only after its schema is confirmed with
PRAGMA table_info; a phone backup is copied intoinbox/and never modified. - Agents. An agent over MCP may read within its ceiling and run adapters. It writes nothing unless the owner names the tool under
writein themcpentry ofpolicy/crossing.jsonand the entry has not expired (ADR 0022): a tier-2 note (add_note) and a promise's done mark (promise_done), aslogbook addandpromises donedo but with sourcemcp, nevermanual, so an agent never writes as the owner; the day's signature,sign_day, through the writerday signuses; and a note on a day,note_day; each within a window of days and under the writer lock.sign_daywrites the signature asday signdoes, sourcemanual, so the owner names it only for an agent that signs for them; whoever signs, a signature never confirms a line an agent or a model wrote. It never writes above tier 2 and never a visibility decision. Tier 3 reaches it only when the policy file allows it and the server was started with--allow-tier-3. - The daily messages. With the scheduled run's Telegram notifier set, two messages a day leave the machine (docs/schedule.md, the daily loop): the Day page's date and how many lines it holds, with a link to the owner's own host when
LOGBOOK_NOTIFY_LINK_HOSTnames one, and the evening question whenLOGBOOK_NOTIFY_EVENING_HOURis set. Nothing else of the day: no place, no name, no line's text, no source; a question of the bank filled from the day (a person's name, a promise's sentence) is not sent, the message says it waits inlogbook digest. Each goes at most once a day (state/notify-daily.json), the token is never printed, and without the token and the chat nothing is sent. Telegram still learns that the record had a day, its count and when the owner reads it; leave the variables unset if that is too much. - The shelves. The Promises, Goals and Agents pages of
logbook serve(/promises,/goals,/agents) only read: no form, no POST, nothing written. Each reads through the server's tier gate as the other shelves do, so a promise, a goal, a review or a session above it is not listed, counted or reachable by its own address, and what a page derives (a verdict, a session's summary) is at the tier of the line it came from. No page runs a model: a promise's verdict is the onepromises --judgealready kept on this machine.tests/test_shelves.pyandtests/test_no_network.pyhold them to it. - Who reads the Library.
logbook servereads for this machine and for the owner's own phone, nobody else. This machine is a request with no proxy's header and oneHost,127.0.0.1,[::1]orlocalhostwith the server's own port, or none. The phone is a request through Tailscale Serve oncelogbook setup phonenames it: oneHost, the setting's tailnet name, oneTailscale-User-Login, the setting's login, and never aTailscale-Funnel-Request; it reads at the tiers this machine reads. The login names a tailnet user, not a device, so every device signed in as the owner's login reads too: keep that login on the owner's own devices. One login at a time: tailscaled keeps a connection open for many requests, so the first request on a connection says whose it is, and a later one on it that names another login, none, or is this machine's own is a 403 and the connection closed (tests/test_serve_edges.py); nothing is kept between requests that one login's answer could lend another. A proxy is told by its headers (Tailscale-*,X-Forwarded-*,Forwarded,Via,X-Real-IP); one that adds none and rewrites theHostto127.0.0.1:8765, or a raw TCP forward, cannot be told from this machine, so never put one in front of the server. Any other request through a proxy, and every one while no phone is named, is a 403; any otherHost(a website that points its own name at 127.0.0.1, DNS rebinding) is a 421; both before anything of the record is read (Site.gate,tests/test_serve_hosts.py). No page can be framed: every policy saysframe-ancestors 'none'and every answerX-Frame-Options: DENY, and a POST the browser says came from a frame or another site (Sec-Fetch-Dest,Sec-Fetch-Site) writes nothing (tests/test_serve_frames.py). - The owner's phone. The Library's forms are answered from this machine only, and from the owner's own phone only once
logbook setup phonenames its tailnet origin and login inlogbook.json(off by default): then a POST forwarded by Tailscale Serve is answered when its oneOrigin,HostandTailscale-User-Loginare all the setting's and it was not posted from a frame, and a form from any other origin, Host or login is a 403 with nothing written (docs/serve.md, From your phone; ADR 0024). A request that came through a proxy (aHostthat is not127.0.0.1or[::1], or any proxy's header,Tailscale-*,X-Forwarded-*,Forwarded,ViaorX-Real-IP) is answered only through those checks, never because it sends noOrigin, so a program on another tailnet device that leaves the Origin out is refused too, the setting on or off; requests tohttp://127.0.0.1:8765orhttp://[::1]:8765from this machine are answered as before; a request naming any other host,localhostincluded, is treated as coming through a proxy. - What the Library keeps.
logbook servekeeps, in its own memory and for the head it last saw, the pages it rendered (by their tags, the last 64 at most) and what several pages read alike (the people, the orgs, the ideas, the promises, the sessions with an agent): nothing of it is written to disk, nothing outlives the process, and a head that moves drops it all. A kept page is served only to the requests the server answers at all (this machine and the owner's named phone, through the tier gate it was started with), and the same tag is the same page the browser may already keep. - The Day's pictures. A Day page of
serveshows a photo only from the record's own attachment store, at/photo/IDon the same server: its policy allows images from the server alone (img-src 'self'), every other page's none, and/photo/IDanswers only for a photo line that stands and that the page's tier gate lets through, a 404 otherwise, the words a missing line gets. No page asks a photo library for a picture, and a static site draws none./line/ID, the line as written, is gated the same way. - The relationship reader.
people askanddream personsend one person's lines to the model ofLOGBOOK_DREAM_ENDPOINT, a cloud model until one runs on the owner's hardware, and only under therelationshipentry ofpolicy/crossing.json, which must have anuntil: no entry, or a day past it, and nothing is read or sent. What crosses is the person's name, the window, the question and the lines on which they and the owner were in contact, at or under the entry'smax_tier, 1 or 2 (3 is refused while the model is a cloud one), and on signed days unless the entry saysinclude_unsigned, each as a reference and never its id; never a note, a group chat, a photo or a draft. The days you spent together go too: each its date and the name you gave the place (ora place with no name), never its coordinates, under the same ceiling. The names that say whom a line is with are held to the same ceiling. The bearer token goes in the request's header alone, and every error is said with it replaced by<key>.tests/test_relationship_model.pyandtests/test_dream_person.pyhold all of this against a fake endpoint.
What is not defended yet, and what to do about it.
- Older copies. Sealing protects the copies made after it is turned on; a backup or sync taken before
key seal --allholds the plaintext, and the command says so once. A record without recipients is plain text at every tier. In both cases the protection is the one the operating system gives: full-disk encryption on every machine and backup disk that holds the folder, and never a folder a sync client owns (logbook setuprefuses one). - The shape of the days. The envelope of a sealed line is plain by design, so the sources, kinds and times of tiers 2 and 3 are readable with the files; a sealed line in a shared page is ciphertext the receiver cannot open until the page reseals it (RFC 0029 §15), and
searchdoes not search sealed lines. - The keys. The sharing key is a file under
~/.config/logbook/share/, the sealing identity one under~/.config/logbook/identities/, both outside the record and readable by the owner alone, so a copy of the folder cannot sign as the owner or open the sealed lines. Whoever holds those files can; neither is protected by a passphrase, because a prompt breaks unattended reads, so the disk they sit on is encrypted. A lost sharing key means a new one, and every member of the circle learns the new public half; a lost sealing identity is covered by the recovery identitykey init --recoveryprinted once for paper, andkey remove-recipientreseals the record without the lost one. - Malware with the owner's privileges can read the files and append to the chain. The chain shows that something was appended and when; it cannot show who typed it.
- What a page reveals. A member who receives a page at tier 2 receives the notes on it. The policy file is the owner's decision; an export's
--dry-runlists what would cross, and an agent's answer says how many lines sat above its ceiling and were left out, so the owner can see what a raise would release. - Hold's reports.
lab hold census(docs/hold.md) writes what it counted tostate/hold/in the record folder: file and folder names, sender addresses, Drive file names. They are in no line, so no crossing, export or page carries them,backupleavesstate/out, and the stdout of a census holds counts only. They are plain files (mode 0600 in a 0700 folder), not sealed even in a sealing record (RFC 0042 §10, Q3): deletestate/hold/when a report has served. The walk opens files read-only, follows no link, enters no other disk, reads no file whose bytes are in a cloud (it would make the system fetch them), and writes nothing in the folders it reads but its own report when the record lies inside one.
Out of scope. The security of the services the exports come from, the phone's own backup encryption (which import backup decrypts only with the owner's password, locally), and the model files derive transcripts, setup speakers, promises --judge and derive descriptions download on request. A run that separates voices switches off pyannote.audio's own usage reporting, which its 4.x releases switch on by default.
Housekeeping
Dependencies are pinned in uv.lock and raised by Dependabot. Every release wheel carries SLSA provenance and is published to PyPI through trusted publishing; nothing is signed by a human's laptop. gitleaks and the PII check run on every commit, so no secret and no real identifier enters the tree.