Sites a key is sent to

An agent holds a placeholder. Laze puts the real key into a request on the way to a site approved for that key, and stops lookalikes.

On a Laze computer, the real key lives on the network and not in the agent's process. The agent holds a placeholder, and Laze's network puts the key into a request only when the request goes to a site approved for that key.

Laze computeryour agent holds a placeholdersk_live_Qm4xT9w2
Laze networkchecks the site, then puts the real key into the request
Approved sitegets the real keyapi.stripe.com
Lookalike sitegets nothing, and you are askedapi-stripe.example
The answer comes back with the key hidden
Laze swaps the key in on the way to an approved site. A lookalike gets nothing, and you are asked.

How the swap works

  1. The agent runs a command with laze vault run. The command gets a placeholder with the length, the first letters and the kind of characters of the key, because some tools check those before they send anything.
  2. The command sends a request, as it always would. Every request from a Laze computer goes out through Laze's network; there is no other way out.
  3. Laze finds the placeholder and looks at the host and port. If that site is approved for that key, and the key's level allows the use, the real key takes the placeholder's place in the header, the address or the body.
  4. The answer comes back with the key hidden, in case the site repeats it.

The level and the site are checked again at each request, so a Deny or a removed site counts for a command that is already running. Laze never follows a redirect with the key, and never sends it over plain HTTP.

Placeholders work only for the agent they were made for, on its computer, while one of its turns is running. Printed, logged or committed, one is a useless string. Writing one into a config file, or saving it as a key, is refused with a hint to read the key at run time.

Each key has its own sites

Open a key and look at Sites this key is sent to. A site is one exact host with its port, with no wildcards: api.stripe.com is approved, files.stripe.com is another site.

The Sites this key is sent to section of a key with approved hosts, who added each, and a field to add one
Sites this key is sent to. Each says who added it and when.

You can add and remove sites there. Agents cannot: they have no command for it.

A site the key has not been used on

Nothing is sent while Laze checks a new site. The check reads the key's name and label, the site, its domain and how old the domain is, and the sites the key already uses. It never sees the value, the placeholder or the request, and there is no list of vendors to keep up to date.

Laze approves the site alone only when the check is at least 90% sure that it belongs to the service that issued the key, and that it is one of that service's official domains.

A site on a domain the key has not used also needs a blind pick: without seeing the site, a second question has to choose that domain, at 85% or more, from near copies of it. Domains your workspace has proven count as your own, so a key for your own API reaches it.

Everything else becomes a card, with the reason in one line.

A card in the Feed asking to allow an agent to use a key on a new site, with Deny and Allow on that site
A new site asks once, for this key and this host.
  • Allow on api.replicate.com sends the waiting request and adds the site for every agent that may use the key.
  • Deny refuses it. The host got nothing.

There is no Allow once: a host that has received a key once has it.

Phishing and lookalike sites

An agent can be tricked by a page, an issue or an email into sending a key to api-stripe.example instead of api.stripe.com. The site list stops it: a lookalike is another host, so it has no approval, and a host that scores as a lookalike is never approved by Laze alone. You get a card with the line "This site may be imitating another one".

A lookalike never joins the card of the real site, and an approval for one never counts for the other.

Which commands get a placeholder, and which a value

CaseWhat the command holds
HTTPS calls from a hosted agent on a Laze computer: headers, basic sign-in, address or text bodyA placeholder
A command that asked with --real-valueThe value, for that command
A key with Used on the computer onlyThe value
A short field, a URL or JSON, such as a region or a database URLThe value of that field; the key's other fields stay placeholders
A sealed key, after you approved itThe value, for that command
An AWS keyA one-hour session. See Env files and AWS
An agent connected from your own machine, or your own terminalThe value, in that one command, with its output redacted

Connected accounts, GitHub and model logins on a Laze computer have been on the same network path with fixed hosts from the start, and the computer holds none of them.

When a program needs the real value

Request signing, SSH, databases, SMTP and file signing use the key inside the program, so there is no request to put it into. The agent asks for that one command:

laze vault run analytics-db --real-value --reason "Count last week's orders on the read replica" -- psql -c "select count(*) from orders"

The automatic check reads the command, the reason and what you asked for, even on an Allow key. It allows uses the swap cannot do and that fit your request, asks you when unsure, and refuses a command that prints, copies or sends the value (vault_real_value_refused).

What the agent sees when a request is held

MessageWhat it means
Laze is waiting for a person to approve this useA card is open. The request is held for up to a minute; retry after the answer
Laze is already holding 8 requests from this agent for approvalAnswer the open cards first
Laze only sends vault keys over HTTPSThe address starts with http://
Laze can't swap vault keys inside binary or compressed dataSend the body as plain text, or use --real-value
Laze: vault keys work only during the agent's turnsA process kept running after the turn ended

A site you approved stays approved until you remove it.

Also check: How the vault is encrypted, Security architecture.