Skip to content

Latest commit

 

History

History
83 lines (63 loc) · 4.87 KB

secrets.md

File metadata and controls

83 lines (63 loc) · 4.87 KB

Secrets

Onicode can read credentials from a secret provider, so the credential stays in your password manager and Onicode saves only a reference to it. Agents can also ask you for a secret in a private card instead of in the chat.

Secret providers are in preview, so a server offers them only when its environment turns the flag on: export ONICODE_FEATURE_FLAGS=secret_providers in your shell profile, then restart Onicode. Separate several flags with commas. The Secrets settings page appears once a connected server has the flag on. Secret requests from agents work everywhere.

Secret providers

1Password is the supported provider. Onicode reads secrets with the 1Password CLI (op), so op must be installed and signed in on the machine that runs the Onicode server. When you use Onicode on another machine or from your phone, that is the remote machine, not the device in front of you.

A desktop sign-in asks for approval on that machine, which a remote user cannot answer. On a remote or headless server, sign op in with a service account or a Connect server instead.

To add one, open Settings → Secrets, select Add provider, and enter a name and the 1Password account: the shorthand, sign-in address (without https://), or ID that op account list shows. Secret providers belong to the environment you are connected to. Each environment keeps its own list.

Use a secret reference

Credential fields in Settings, such as provider environment variables and credentials, source control tokens, usage limit keys, and device host tokens, show a source picker next to the field. Pick Value to save the credential itself, or pick a secret provider and enter a reference such as op://vault/item/field. Copy the reference from 1Password with Copy Secret Reference. Select the check button next to a reference to read it now. If it reads, providers that use it start using the new value.

Onicode reads the secret when it needs it, for example when a provider starts. Change the credential in 1Password and refresh to use the new value.

When a secret cannot be read

If 1Password is locked or signed out, the provider or feature that needs the secret shows an error naming the secret provider. Unlock 1Password on the server's machine, then select Refresh in Settings → Providers. Onicode never replaces a saved credential it cannot read with another login.

Remove a secret provider

When you remove a secret provider in Settings → Secrets, Onicode lists the fields that read from it. Removing it clears those fields, so set them again before you need them. The secrets in 1Password are not touched.

When an agent asks for a secret

An agent that needs a token or password shows a secret request card in the thread instead of asking you to paste it into the chat. Type or paste the value and select Save securely, or select Decline. You can answer from desktop or mobile. A login can come as one card with a field for each value, such as an email and a password. The eye button shows what you typed in a masked field.

On your phone, a password manager can fill the card, so nothing is copied or pasted. On iOS, tap Passwords above the keyboard to fill a saved password. On iOS 18 and later you can also touch and hold the field and choose AutoFill → Passwords: a password manager that supports it, such as Bitwarden, then lets you pick any field of any item, such as a custom field, a note, or an SSH key. On Android, pick the suggestion your password manager shows for the field. A masked field takes a login's password and an unmasked one, such as an email, its username, so keep a token you want to fill this way as a login's password. The password manager unlocks with Face ID or your fingerprint as it always does.

A desktop field cannot be filled that way. When your phone gets Onicode notifications, the desktop card says the request is on your phone too: answer it there and the desktop card closes.

The card names the project and the machine the value goes to. That line comes from Onicode, while the title and the reason are the agent's words, so check where the value goes before you answer.

If the environment has a secret provider, a card that asks for one value also lets you pick it and enter a reference instead of the value. A card with several fields takes typed values only. Answering with a reference needs permission to manage providers, as saving a reference in Settings does; a session without it sees only the value field. Onicode reads the secret once, when you answer. If 1Password is locked, the card says so and the request stays open: unlock it and try again, or enter the value.

The value never appears in the conversation. It goes into a private file, one per field, that the agent's commands can read for about 24 hours, and the card says so.