A source names a secret by name; the value itself lives in the Mac's Keychain. Add secrets in Settings → Secrets, which also lists the secrets your pages need, with the name and host filled in, so you only paste the value.
To keep a value in 1Password instead, see 1Password secrets. For Todoist, Connect signs in through your browser and saves a connection instead of a token.
- A secret's name is 1–48 lowercase letters, digits and hyphens. Settings → Secrets saves no other names, so a page that names
my_apican never be filled; call itmy-api. - Each secret is tied to one host. Legato sends it only to that host, so a page can't point a secret at another server. One name can be saved for several hosts, each with its own value: a host list sends each host the one saved for it.
- Secret values are sent only to their configured service, when a request needs them. The
legatotools and MCP server never read or return them, and they aren't in the page file. Agents can list secrets, change their expiry dates and delete them without seeing a value. - Save source secrets in Settings → Secrets, or with
Legato secretbelow. Legato reads only its own source-secret records in the Keychain. A changed app signature or Keychain access restriction can prevent the current build from reading a saved item; if the card says "This build of Legato can't read the secret", save it again in Settings → Secrets. - Use the least access a service offers: a Pi-hole app password rather than its admin password, and an Uptime Kuma API key rather than a login.
From 1Password
A secret's value can stay in 1Password instead. In Settings → Secrets, add it with + (or Set…), choose 1Password under Value from and give the item's reference, such as op://Legato/Pi-hole/password (in 1Password, Copy Secret Reference from a field's menu). Legato reads the value when a source needs it, with a 1Password service account saved in the same tab (Set Up… beside 1Password), through Legato's own 1Password helper (nothing else to install). Secrets from 1Password walks through setting it up. A secret in two parts, such as an OAuth client's ID and secret, can come from two fields. From the command line, Legato secret set --1password links a reference only when the caller supplies the same service account token saved in Legato. Saved references use the token saved now.
- The page still names only the secret (
"secret": "pihole"). Which 1Password item it is, and the host it's sent to, are set in Settings, never by a page, so a page can't ask for another item or send one elsewhere. - Legato keeps the value in memory and reads it again every hour, and at once when the service refuses it, so a rotated credential reaches the cards on its own. If 1Password can't be reached, the last value read keeps working for up to a day (unless the service refused it), and Legato tries 1Password again after a minute, then less and less often.
- The service account token is kept in the Keychain and handed to Legato's own 1Password helper on its standard input, never in an environment or on a command line. No
optool or Homebrew is needed. Give the service account read access to only the vaults Legato needs. - A wrong reference, or one the service account can't read, shows when you save it, and on the card with a message saying what's wrong.
Expiry dates
Some tokens stop working on a set day: a Tailscale API access token lasts 90 days at most, and a GitHub fine-grained token as long as you chose. Save that day with the secret and a page can warn you before it comes.
- In Settings → Secrets, tick Expires and pick the day when you add or replace a secret. To change only the day, right-click the secret and choose Set Expiry…. From the command line, add
--expires 2027-02-09(or--expires 90d) tosecret set, or runsecret expires. - From 14 days before that day, the secret's status is Needs attention, and hovering over it says how many days are left.
- Saving a new value takes the day shown in the sheet, or none. A day kept from the old token would warn at the wrong time.
- A page reads only the day, through its source's
secret_expires, and counts down to it with theexpiresrule. - For a 1Password secret, the day is kept in Legato, not 1Password. If you rotate the item in 1Password, change the day in Legato too.
From the command line, or an agent
The Legato app is also a command, for scripts, password managers and AI agents that already hold a credential. It reads the value from standard input, never from an argument, so the secret stays out of shell history and the process list, and saves it to the Keychain exactly as Settings → Secrets would.
Nothing is sent anywhere: the value goes to the Keychain, and cards that were waiting for it try again at once.
# Typed: the value isn't echoed
/Applications/Legato.app/Contents/MacOS/Legato secret set lunch-money
# From 1Password, without the value passing through anything else
op read 'op://Private/Lunch Money/credential' | /Applications/Legato.app/Contents/MacOS/Legato secret set lunch-money| Command | Does |
|---|---|
Legato secret set NAME [--host HOST] [--replace] | Saves the value read from standard input. HOST defaults to the host of the page that names NAME, so write the page first. A secret that's already saved needs --replace. |
Legato secret set NAME --1password REFERENCE [--1password REFERENCE] [--host HOST] [--replace] | Links a 1Password reference instead of a value, only with the same OP_SERVICE_ACCOUNT_TOKEN saved in Legato. Twice for a secret in two fields. |
Legato secret set NAME … --expires DATE | Saves the expiry date with the secret: 2027-02-09, or 90d for 90 days from today. Without it, a new value has no date. |
Legato secret expires NAME DATE|none [--host HOST] | Changes or clears only the expiry date. |
Legato secret list | Saved secrets by name and host (from 1Password for a reference), with their expiry dates and the pages that use each, then the ones your pages name that aren't saved yet. Values are never shown. |
Legato secret delete NAME [--host HOST] | Removes a saved secret. |
Legato secret token set [--replace] / token delete | Saves (or removes) the 1Password service account token, read from standard input. |
An agent setting up a page for you writes the page, then runs secret set with the credential piped in from wherever it holds it, then secret list to check nothing is missing.