Some facts should never sit in a note in plain text: a passport number, a permit case number, an IBAN, a password. Hippocampus stores these encrypted with age, one small file per field. The note only holds a reference. Everyone, agents and dashboard included, sees a sealed value. Only you, on a machine with your private key, can open it.
How a secret is stored
On the note, the fact’s value is a secret://<entity>/<field> reference:
facts:
number: { value: "secret://passport/number", status: canon, by: residency-agent }
expiry_date: { value: 2031-03-14, status: canon, by: residency-agent }
The ciphertext lives next to it in the vault:
secrets/passport/number.age
In Obsidian the facts table shows 🔒 secret. Agents get the same through get, recall and ask_canon, and the dashboard shows a lock. Provenance (by, at, src) stays visible, so you can still see who reported it and when.
One key to lock, one to open
npx @mehrad77/hippocampus -v ~/vaults/my-vault secrets keygen
keygen creates an age key pair:
| Half | Where it goes | Who uses it |
|---|---|---|
| Public recipient | secrets.recipient in _hippo/config.yaml, inside the vault |
The curator, to encrypt |
| Private identity | ~/.config/hippocampus/age-identity.txt, mode 0600, never in the vault |
You, to decrypt |
The curator only ever has the public half, so it can lock secrets away but can’t read them back. keygen refuses to overwrite an identity that already exists. Set HIPPO_AGE_IDENTITY_FILE to keep the identity somewhere else. Session Zero’s Secrets step can forge the key for you, or reuse the one already on this machine.
On the hosted app
The “Your vault” step of Setup makes the key pair in your browser. Download the key file (hippocampus-<name>.agekey) and tick that you saved it. Only the public half is sent, and it goes into your vault’s config when the vault is set up. Without the tick, the vault starts with no key; add one later under Setup → Secrets key. The app never sees the private half, so it can’t decrypt anything, and neither can its operator. If you reload the page before saving the file, make a new key.
To read secrets later, put the file at ~/.config/hippocampus/age-identity.txt (or point HIPPO_AGE_IDENTITY_FILE at it) and use secrets show in a clone of your vault, or with --github.
Adding the key later
If you skipped the key, secret facts are held back until you add one. On the hosted app, open Setup, find Secrets key, make a key in your browser, download the file, and lock the vault to it. Already have a public key (it starts with age1)? Paste it there instead. On a local vault, run secrets keygen, or secrets set age1… to use a public key you already have. Your agents’ next memories are stored; the ones held back before are not replayed, so ask the agents to send them again.
Lost the key file
Nobody can recover it: the vault only holds the public half. Replace the key (hosted: Setup → Secrets key → Lost the key? Replace it…; local: secrets keygen, or secrets set age1… --replace), then ask your agents to send the secrets again. Secrets saved under the lost key stay unreadable, and a resent one replaces the unreadable one.
The key file leaked
Rotate instead: Setup → Secrets key → Key compromised? Rotate…. Make a new key and save its file, then pick the old key file. Your browser opens every secret with the old key and locks it to the new one, and the vault swaps them all in at once (all or nothing: if any secret won’t open with the old key, nothing changes). Afterwards the old key opens nothing in the vault as it is.
It can’t take back what already leaked: old copies stay in the repository’s git history, and the old key still opens those. Change the real secrets where you can (passwords, card numbers), and treat the old values as known.
Reading a secret
npx @mehrad77/hippocampus -v ~/vaults/my-vault secrets show passport
npx @mehrad77/hippocampus -v ~/vaults/my-vault secrets show passport number
show decrypts every secret fact of an entity, or just one field, and prints them in your terminal. It works with --github too. It needs the identity file, so it only works on your machine.
On the dashboard
On the hosted app, the vault’s owner can read a secret on its record’s page: Reveal next to the 🔒, then pick your key file. Your browser fetches the locked copy and opens it itself; the key file is read on your device and never sent anywhere, and the value disappears again after 30 seconds. The server only ever handles locked copies, so it still can’t read your secrets. Members and viewers of a shared vault don’t get Reveal.
Opening a key file in a web page does trust that page with it while it’s open. If that worries you, use secrets show in a terminal instead.
What becomes a secret
During sleep, a fact is stored as a secret when any of these is true:
- its field is declared
secret: truein the type’s note in_hippo/schema/types/. For items (item.md) that’snumber,document_number,iban,card_numberandpassword; - the model flags it while extracting claims: ID, passport, permit, bank or card numbers, passwords, credentials;
- the episode was marked
secret: trueand the value looks like an identifier (six or more letters, digits or dashes, with at least one digit); - the field already holds a secret.
Secrets skip the usual precedence table, because ciphertext can’t be compared. The latest report replaces the stored value, unless it comes from a lower rank than whoever stored the current one: an agent can’t overwrite a secret a human set, and the sleep warns instead. It’s canon if the reporter has authority over the note, or is a human, and a rumor otherwise. For a secret field only a human sets, an agent’s value is encrypted beside it and waits as a proposal.
Secret-bearing episodes
When an agent remembers something that contains a secret, it should say so: secret: true in the remember call or the episode file. When you scribe one yourself, tick “Contains an ID, document or account number, or a password”. From the command line, use hippo remember --secret.
Until the next sleep, such an episode waits in inbox/ in plain text. The dashboard shows it sealed in the Satchel, without its text or hints. Then the sleep:
- encrypts the secret values into
secrets/; - writes the episode to the chronicle with those values replaced by
[redacted]; - gives the summary step only “(secret-bearing episode)”, never the text;
- scrubs any secret that the model echoed into a note’s title or aliases;
- removes the episode from the inbox.
Secret or confidential?
Hippocampus has two tiers for values that shouldn’t travel:
| Secret | Confidential | |
|---|---|---|
| For | Identifiers that unlock something: passport and permit numbers, IBANs, passwords | Private but harmless to keep: a phone number, a home address, a health detail, an email |
| In the vault | Encrypted with age in secrets/; the note holds a secret://… reference |
Plain text in the note’s frontmatter |
| Facts table, dashboard, agents | 🔒 secret, always |
◐ confidential |
| Who can read it | Only you, with your age identity and secrets show |
You in the vault, and agents bound to their id with authority over the note |
| Search, summaries, chronicle | Never; the chronicle shows [redacted] |
Kept out; the curator reads it only to file it |
| How it’s marked | secret: true on the memory or the field |
confidential: true on the memory, the fact or the field; identity keys are confidential too |
When in doubt, use a secret. A confidential value is protected by the vault’s privacy and by Hippocampus keeping it out of places it would leak; a secret is protected by encryption.
Limits worth knowing
- Git history keeps inbox files. An episode that reached a GitHub vault (on the hosted app, that’s every episode) stays in the repo’s history after the sleep removes it, even though the chronicle copy is redacted. The dashboard warns you about this when you scribe a secret into a GitHub-backed vault. Keep the vault repo private.
- The curator sees the episode. To find the secret, the curator reads the episode text, and it sees confidential memories too. With a local model (LM Studio, Ollama) it never leaves your machine. With a hosted provider, it is sent to that provider. An agent with a curator key sees secret memories in plain text while it curates, and so does its model’s provider. See The curator.
- The hosted app passes them through. A secret-bearing episode waits in your repo’s inbox in plain text, and the app reads it while serving the curator. It never stores inbox files at rest, but its operator runs the code that reads them. See
SECURITY.mdin the Hippocampus repository. - Ciphertext is only as safe as the identity. Anyone with your identity file can read every secret. Keep it out of the vault, out of backups you share, and out of chat.