The vault keeps logins (a site, a username, a password, optionally a 2FA key) so Oscar can sign in to websites with the browser without the model ever seeing the password or the code, and payment cards and addresses so it can fill checkout forms without the model seeing the card number. The model asks for an item by its handle; Oscar looks it up and writes it into the page itself.
oscar vault add https://github.com --username dana # asks for the password, hidden
oscar vault add https://github.com --totp - # also a 2FA key, asked hidden
oscar vault list
oscar vault code github.com # the current 2FA code
oscar vault remove github.com
oscar vault add-card --site https://shop.example # asks for the number, hidden
oscar vault add-address --site https://shop.example --name "Dana R" --street "1 Main St" \
--city Springfield --postal-code 12345 --country US
oscar vault passphrase # protect the vault with a passphraseThe vault commands need only Oscar's home (--home, OSCAR_HOME, default
~/.oscar), not a workspace or a provider.
Commands
oscar vault add <origin>
Saves a login for one site. The origin is the site's address; https:// is
assumed and the path is dropped (github.com/login → https://github.com).
| Flag | Meaning |
|---|---|
--username <name> |
the username or email; without it you are asked on a terminal (shown); empty is allowed |
--password-stdin |
read the password from the first line of stdin, for scripts |
--totp <key or otpauth:// URI> |
the site's 2FA (authenticator) key; --totp - asks for it hidden, which keeps it out of your shell history |
--handle <name> |
the name the model uses for this login; default the host (plus -<port> for an unusual port; -2, -3… if taken) |
--subdomains |
also use it on subdomains (https domain names only) |
--from <ref> |
take the password from a password manager instead of storing it: op://vault/item/field (1Password), bw:<item id or name> (Bitwarden), bws:<secret id> (Bitwarden Secrets Manager), cmd:<argument> (your command) |
Without --from, the password is asked twice with the input hidden, or read
with --password-stdin; it never comes from the command line. Saving the
same site and username twice is refused (remove the old one first). It
prints saved <handle>: <site> as <user> (2FA codes: yes) and how the vault
is protected — never the password.
oscar vault list
A table of handle, site, username, whether 2FA codes are available (yes,
-, or ? when 1Password does not say) and where the password lives
(local, local, password from 1Password, 1Password (item title),
Bitwarden (item title)…), after a line per card (brand, last four digits,
expiry, sites) and per address (city, country, sites). Passwords and card
numbers are never shown. With op or bw installed but not configured,
list on a terminal first offers to unlock it (see
password managers).
oscar vault add-card --site <origin>…
Saves a payment card for checkout forms on the given sites (--site is
required and may be repeated: the shop, and its payment page if that is
another address). The number (checked with the Luhn digit), the expiry
(MM/YY) and the security code (optional) are asked on a terminal, the
number and code hidden; --stdin reads them as three lines instead. They
never come from the command line. --name is the name on the card,
--label a word for you and the model ("work card"), --handle its name
(default brand and last four digits, e.g. visa-4242). It prints the brand,
the last four digits and the expiry — never the number.
oscar vault add-address --site <origin>…
Saves an address for checkout forms on the given sites: --name,
--organization, --street, --street2, --city, --region (state,
province, county), --postal-code, --country (the code or name the shop's
form lists, e.g. GB), --phone, --email, --label, --handle (default
address, address-2, …). Missing name, street, city, postal code and
country are asked on a terminal.
oscar vault code <handle>
Prints the current 2FA code (and, for local logins, how many seconds it is still valid). Works for password-manager logins too.
oscar vault remove <handle>
Deletes a local login, card or address. Logins listed from 1Password or Bitwarden live there; remove them in the password manager.
oscar vault passphrase [--stdin] [--remove]
Re-encrypts the vault under a passphrase (at least 8 characters, typed twice
or read with --stdin). If the vault already has one, Oscar needs the
current one first (OSCAR_VAULT_PASSPHRASE, or asked on a terminal).
--remove goes back to a key file protected by file permissions only. When
OSCAR_VAULT_PASSPHRASE is kept in credentials.env, it is updated for
you; when it is in your environment, change it there.
Where it is stored and how it is protected
$OSCAR_HOME/vault/ (mode 0700) holds vault.enc (0600). The contents are
encrypted with ChaCha20-Poly1305 under a random 256-bit key, with a fresh
nonce on every write; the file's header is authenticated too, so it cannot
be swapped or downgraded. The key is protected in one of two ways:
- A key file (the default):
vault/key, mode 0600. Anyone who can read your files can read the vault; Oscar refuses a key file other users can read. - A passphrase: the key is wrapped with a key derived from your
passphrase (PBKDF2-HMAC-SHA256, 600,000 rounds, random salt); no key file
remains. Oscar reads the passphrase from
OSCAR_VAULT_PASSPHRASEin the environment, then fromcredentials.env(which works, but sits next to the vault). It is never read fromconfig.tomland never stored anywhere else. Without it, a passphrase vault does not open: "the vault is protected by a passphrase; set OSCAR_VAULT_PASSPHRASE".
Writes are atomic and serialised with a lock file, so a gateway and a terminal can use the vault at the same time. A vault that was tampered with fails its integrity check rather than opening.
The browser_vault tool
When a browser is available and there is a vault or a password-manager
backend, the model gets the browser_vault tool:
| Action | What it does | Approval |
|---|---|---|
list |
the saved logins (handle, site, username, whether 2FA is available, source); current_page: true limits it to the open page's site |
never asks |
fill |
types a login's username and password into the sign-in form on the open page | asks |
enter_code |
types the current 2FA code into the code field; without a saved 2FA key, asks you for the code the site sent (SMS, email) | asks |
save_login |
asks you for a username and password, saves them for the open page's site, then fills | asks |
fill_card |
fills a card's number, name, expiry and security code into the checkout form on the open page | asks every time, in every mode |
fill_address |
fills an address (name, street, city, region, postal code, country, phone, email) into the form | asks |
The model passes a handle (and may pass the origin it expects, and the
browser session whose page to fill); it gets back only which fields were
filled, never the password, the code, the card or the notes. "Allow for
this session" covers only the same action, item and site. --approve auto
approves login and address fills with an audit record like any other asking
tool; a card fill always asks you, in every mode but never (which
refuses it), and is never allowed "for the session".
Cards and addresses
A card or an address is bound to the sites it was saved for, exactly like a
login, and is filled the same way: checked against the page's origin in
Rust and again inside the page, written from an isolated script whose
source never contains the value, read back, never submitted — the model
shows you the order and you confirm. Card fields are found by their
autocomplete names (cc-number, cc-name, cc-exp, cc-exp-month,
cc-exp-year, cc-csc) or their labels; an expiry goes in as the field
asks (MM/YY, MM/YYYY, separate month and year boxes or lists). Address
fields are found the same way (name, given-name/family-name,
address-line1/street-address, address-level2, postal-code,
country, …).
After a card fill, the number (in every spacing) is redacted from
everything the model is sent for the rest of the process, the security code
is scrubbed from everything the browser session returns, a snapshot shows
card fields as <hidden>, and screenshots are refused in that browser
session (a card field shows its digits) until it is closed. A card form
inside a payment provider's frame (another origin, such as a hosted payment
field) is not filled: the model asks you to enter the card there.
Codes sent by SMS or email
When a login has no saved 2FA key, enter_code asks you for the code the
site sent: in the full-screen chat a masked dialog, in the line chat a
hidden prompt. The code goes into the page and is redacted like a password;
the model never sees it. Chat rooms never ask (the code would stay in the
room's history): there the model asks you to enter the code on the page
yourself, or to save the site's 2FA key with oscar vault add … --totp -.
Model-blind fill
Oscar resolves the secret itself and writes it into the page over the
browser's debugging protocol: the username is typed as real keyboard input,
the password and codes are set on the field with the events a page expects,
from an isolated script whose source never contains the value. The values
are read back to check the page kept them. The form is not submitted:
the model clicks the button with the browser tool, so you can see each
step. Identifier-first sign-ins (the username on one page, the password on
the next) work by filling again on the second page. Fields for a new
password (sign-up, password change) are left alone.
Origin binding
A login is bound to its site: scheme, host and port must match exactly.
A login for https://github.com is not filled on gist.github.com,
http://github.com or https://github.com:8443, unless it was saved with
--subdomains (then the domain and its subdomains, same scheme and port).
The check runs before the secret is even looked up and again inside the
page, so a page that navigated away or an embedded document with another
origin gets nothing: "refused: the page is on X, but this login is saved
for Y. Nothing was filled". Logins are only saved for https sites, except
on localhost and loopback addresses.
2FA codes
Time-based one-time passwords as authenticator apps make them (RFC 6238):
SHA-1, 6 digits, 30-second steps by default; an otpauth://totp URI can
set SHA-256 or SHA-512, 6–8 digits and another period. Counter-based
(hotp) keys are refused. The code goes into a single code field or into a
row of one-digit boxes. A site that wants a passkey, a security key or an
approval in an app needs you: the model is told to ask.
Saving a login from a conversation
save_login asks you, never the model, for the username (shown) and the
password (hidden): in the line chat and oscar run with a hidden prompt, in
the full-screen chat with a masked dialog. Chat rooms (Matrix, Telegram,
Discord) refuse to ask, because the password would stay in the room's
history; filling saved logins still works there. Without anyone to ask, the
model tells you to run oscar vault add <origin>.
Password managers
1Password, Bitwarden and Bitwarden Secrets Manager can supply logins
without copying them into Oscar.
Oscar only reads them and never writes to them. Turn them on in
config.toml (or the matching variables):
| Setting (variable) | Value |
|---|---|
vault_op (OSCAR_VAULT_OP) |
on to use op, or the path to it |
vault_op_account (OSCAR_VAULT_OP_ACCOUNT) |
a 1Password account, when you have several |
vault_bw (OSCAR_VAULT_BW) |
on to use bw, or the path to it |
vault_bws (OSCAR_VAULT_BWS) |
on to use bws (Bitwarden Secrets Manager), or the path to it |
BWS_ACCESS_TOKEN |
the machine account's access token bws signs in with (credentials.env or the environment) |
vault_command (OSCAR_VAULT_COMMAND) |
a command that prints a password |
- 1Password: logins that have a website are listed (
op item list); the password is read when a fill needs it (op read), the code withop item get --otp. Oscar uses your existingopsession orOP_SERVICE_ACCOUNT_TOKEN. - Bitwarden: login items with URIs are listed (
bw list items); the password and code are read withbw get. The vault must be unlocked (BW_SESSIONexported). - Bitwarden Secrets Manager: it has no list of logins. Save a login
with
--from bws:<secret id>: its site and username stay in Oscar, and the password is read when a fill needs it (bws secret get <id> --output json, the secret's value).bwssigns in withBWS_ACCESS_TOKEN(andBWS_SERVER_URLfor a self-hosted server): when they are incredentials.env, Oscar passes them to thatbwsrun only, in its environment (never on its command line); otherwisebwsreads them from the environment Oscar runs in. The token is kept out of every command the agent runs and redacted from tool output like any other*_TOKEN. - Your own command: for logins saved with
--from cmd:<argument>, Oscar runs the command (split like a shell would, but without a shell) with the argument added last, and takes its output as the password.
Found on PATH, unlocked once. When vault_op / vault_bw is not set
and op or bw is installed, Oscar notices it (oscar doctor says so) but
does not use it until you unlock it: the first time the vault is listed on a
terminal (browser_vault list in the full-screen or line chat, or oscar vault list) it asks once, hidden, for the master password. Bitwarden gets
it through a variable of bw unlock's own (never the command line),
1Password on op signin's input. The session key that comes back is kept
in that Oscar process's memory only — never written to disk, never shown —
and used for its later calls; leave the prompt empty to skip. Chat
gateways never ask. vault_op = "off" / vault_bw = "off" stops the
question; "on" uses your own session as before.
A password manager's site address binds exactly (never subdomains); an
http:// address is dropped unless it is on this machine. Each call has 20
seconds ("is it waiting to be unlocked?"), gets no input, and does not see
OSCAR_VAULT_PASSPHRASE. Their logins appear in list with handles such
as op:<id> and bw:<id>. A login saved locally with --from keeps its
site binding and username in Oscar and fetches only the password.
API keys from your password manager
The same managers can hold Oscar's own API keys: write
OPENROUTER_API_KEY=op://Private/OpenRouter/credential (or bw://item/field,
bws://<secret id>, or cmd:<command>) in credentials.env and the key is read when Oscar starts
and kept in memory only. See
Providers and models.
Security model
What the vault is for: letting the model sign in for you without the password or code ever entering the conversation, the transcript, the logs or a provider's request.
- The model only ever handles a login's handle. The password and code go from the vault straight into the page.
- Every value written to a page is registered as a secret for the rest of
the process: anything a later tool returns (page text, script results,
raw browser reads) is redacted (
<redacted:secret>) before the model sees it. - Secrets live in memory as values that print as
***and are wiped when dropped; error messages never contain one. - A login fills only on the site it was saved for.
- Filling asks for approval (unless you chose
--approve auto), and nothing is submitted for you. - The model is told never to ask for a password or code in the conversation
and never to type one with the
browsertool.
What it does not protect against:
- Someone who can read your files and has the key file (or your passphrase
from
credentials.env) can open the vault. Use a passphrase kept in the environment for more. - Once a password is in a page, that page's own scripts can read it — as with any password you type.
- Redaction covers text; a screenshot of a page that shows a password in clear would show it (after a card fill, screenshots are refused in that browser session for this reason).
- A 2FA key passed as
--totp <key>lands in your shell history; use--totp -. - Forms inside iframes are not filled.
Checking it
oscar doctor prints a vault line: how many logins (and cards and
addresses) and how the vault is protected, which password-manager backends
are on or found on PATH, and problems such as
loose file modes, a key file left behind after switching to a passphrase,
or OSCAR_VAULT_PASSPHRASE set while the vault still uses a key file
(oscar vault passphrase switches).