Skip to content

OS keychain ​

The keychain provider stores values in your operating system's credential store. fnox.toml holds only the entry name; fnox set writes the value to the keychain.

Config typekeychain
StorageLocal store
Writes (fnox set)Yes
RequiresmacOS Keychain, Windows Credential Manager, or a Linux Secret Service on D-Bus

On Linux, fnox talks to the Secret Service API directly over D-Bus, so you need a Secret Service implementation such as GNOME Keyring or KWallet running. No libsecret packages are required. macOS and Windows need no setup.

Quick start ​

toml
[providers.keychain]
type = "keychain"
service = "fnox"
sh
fnox set GITHUB_TOKEN --provider keychain
fnox provider test keychain
fnox exec -- ./release.sh

On macOS, enable Touch ID protection for this provider with touch_id = true:

toml
[providers.keychain]
type = "keychain"
service = "fnox"
touch_id = true

Protected items use a separate service.touch-id Keychain service. For each read, Fnox shows the full invoking command, project path, and secret name in its approval window, then asks macOS to verify Touch ID. The same authentication context authorizes the read. Canceling or failing authentication blocks access; there is no password fallback. Touch ID is macOS-only and prompts for every protected read.

Building fnox from source on macOS requires Node.js 22.18.0 or later (Node.js 23 requires 23.6.0 or later) and the macOS 26 SDK (Xcode 26+) to generate and compile the approval UI. Node.js 26 LTS is recommended as the current LTS release, but is not a strict requirement. The CLI and its Touch ID helper must be signed by the same Apple Developer ID team and use the same signing identifier. The helper uses dev.jdx.fnox by default; its identifier must also be the CLI's code-signing identifier. For a different explicit App ID, set FNOX_TOUCH_ID_HELPER_IDENTIFIER to that identifier when building the CLI and packaging the helper, and pass the same value to codesign --identifier when signing the CLI binary.

Apple's Data Protection Keychain requires a code-signing entitlement authorized by a provisioning profile inside an app-like bundle. A bare command-line executable cannot use biometric-protected Keychain items. Install the matching Fnox.app helper in /Applications or beside the CLI; Fnox runs the protected Keychain operation through that signed app executable. Official releases publish the helper as a separate fnox-touch-id-<target>.zip asset when the repository has a valid FNOX_KEYCHAIN_PROFILE_BASE64 Developer ID provisioning profile configured. Source builds need the same kind of profile and signing identity.

To create a helper for a source build, use Apple's Developer portal to create an explicit App ID and a Developer ID provisioning profile that authorizes its Keychain access group. Then package the compiled executable with that profile and your Developer ID Application identity:

sh
.github/scripts/package-touch-id-app.sh \
  target/release/fnox \
  /path/to/Fnox.provisionprofile \
  "Developer ID Application: Your Name (TEAMID)" \
  target

Move target/Fnox.app to /Applications or leave it beside the fnox CLI. Without the provisioned helper, Touch ID operations fail with an Apple missing-entitlement error.

fnox set stores the entry under the secret's name and records that name in fnox.toml:

toml
[secrets]
GITHUB_TOKEN = { provider = "keychain", value = "GITHUB_TOKEN" }

Use --key-name to choose a different entry name.

Authentication ​

Access belongs to the current OS user and requires an unlocked credential store. macOS may show an access prompt for each keychain item. fnox reads entries one at a time so those prompts never overlap.

The provider needs a desktop session or an unlocked Secret Service, which CI runners and containers usually lack. Prefer age or a cloud provider there. You can provision one yourself; fnox's own Linux CI runs gnome-keyring-daemon --unlock --components=secrets --daemonize, but that means keeping the unlock password in CI. For touch_id = true, fnox provider test creates a temporary protected item, asks you to approve a read in Fnox's approval window, and removes the item after validation. This verifies actual protected Keychain access, not just biometric availability.

Configuration ​

FieldRequiredDefaultDescription
serviceYesNoneService name for every entry; isolates fnox's entries from other applications.
prefixNoNoneString prepended to each entry name. With prefix = "myapp/", api-key is stored as myapp/api-key.
touch_idNofalseOn macOS, require Touch ID for protected Keychain items.

service and prefix accept { secret = "NAME" }. Every provider also accepts auth_command and daemon_cache.

Reference formats ​

valueKeychain entry read
api-keyService service, account api-key
api-key with prefix = "myapp/"Service service, account myapp/api-key

The entry holds the value as a single string. On macOS it appears in Keychain Access under the service name; on Windows, in Credential Manager under Windows Credentials.

Hold an age identity ​

The keychain works best for a few bootstrap secrets rather than every value. Store one age private key in the keychain and encrypt the rest with age, so a project with many secrets touches the keychain once:

toml
[providers.keychain]
type = "keychain"
service = "fnox"

[providers.age]
type = "age"
recipients = ["age1..."]
identity = { provider = "keychain", value = "age-key" }

[secrets]
DATABASE_URL = { provider = "age", value = "YWdl..." } # ciphertext, abbreviated
API_KEY = { provider = "age", value = "YWdl..." }      # ciphertext, abbreviated

To store the identity, run the command below and paste the AGE-SECRET-KEY-1... line from your key file at the hidden prompt:

sh
fnox set AGE_IDENTITY --provider keychain --key-name age-key

Then delete the AGE_IDENTITY entry from [secrets], or add env = false to it, so fnox exec does not export the private key to your commands. Losing the keychain item is recoverable from any machine that holds the same age identity.

Other good candidates are tokens that unlock remote providers, such as a 1Password service account token.

Troubleshooting ​

No OS keyring backend is available ​

On Linux, no Secret Service is reachable. Start one (for example gnome-keyring-daemon --start --components=secrets), and check that DBUS_SESSION_BUS_ADDRESS is set in the fnox process.

Keychain is locked or access is denied ​

Unlock the login keychain or Secret Service collection, then accept the access prompt. fnox provider test keychain writes and reads an entry named __fnox_test__ under the provider's service and prefix, then attempts to delete it. An existing entry with that name is overwritten, and if the delete fails the test value stays behind, so don't store anything under that name.

Entry not found ​

The entry does not exist under this service (and prefix). Check the service and account name in Keychain Access, Credential Manager, or Seahorse, or store it again with fnox set.

See also ​

  • age: encrypt the bulk of your secrets with a keychain-held identity.
  • Configuration files: keep machine-specific providers in fnox.local.toml.
  • 1Password: a shared password manager for teams.
MIT LicenseCopyright © 2026jdx.dev