Give Claude Code or Codex an API key when you approve

In Nature Work, your coding agent asks your vault for a key by name and you approve the request with your passkey. Nature Work's local agent then runs one command with the key, and the coding agent gets that command's output with the key taken out.

Updated 8 November 2026

What happens when the agent needs a key

  1. It looks up the name

    key_guard_list_secrets returns the names in your vault and your agent access setting. Values are never returned.

  2. Nature Work makes a one-use key pair

    nw-agent vault begin returns a handle and a public key. The private key stays in the local Nature Work agent's memory and expires after 10 minutes.

  3. The agent asks for one secret

    key_guard_request_secret sends the name, the public key, a name for the agent and a reason. Raq.com sends an approval notification to your phone if you have turned notifications on there.

  4. You approve with your passkey

    Face ID, Touch ID or a fingerprint, depending on the device. Your browser decrypts the secret and seals it to the agent's public key, so Raq.com only relays a copy it can't open.

  5. One command runs with it

    The agent passes the sealed value to nw-agent vault exec with the handle. The local agent opens it, sets one environment variable for that command and replaces the key in the output with [REDACTED_SECRET].

In the agent's terminal
$ nw-agent vault begin
{"handle":"…","public_key":"…","expires_at":"…"}

$ printf '%s' "$SEALED" | nw-agent vault exec \
    --handle "$HANDLE" --sealed-stdin \
    --env STRIPE_API_KEY -- npm run sync-prices

The agent fills in $SEALED from key_guard_check_request after you approve, and $HANDLE from vault begin. The sealed value is handed over once.

What you are approving

You approve a request for one named secret, not a command. The approval page shows the name the agent gave itself, the IP address the request came from, the secret, the agent's reason and how long you have left. The name and the reason are the agent's own words, and the request doesn't say which command will use the secret.

So approve requests you expect, from a session you are running. Deny anything you don't recognise. If you add a reason when you deny, the agent sees it.

Every command or the current session

Choose this per vault in its settings. A request keeps the setting that was on when it arrived.

Every command Current session
One approval covers One named secret, which the agent is told to use for one command One named secret, reused by the same Nature Work session
Afterwards the value is Discarded when the command ends, unless the agent passes --cache-session Held in the local agent's memory until the session closes, the agent restarts or 24 hours pass
Good for Keys you use now and then A run of commands that all need the same key

The MCP tools tell the agent to pass --cache-session only in Current session mode. nw-agent vault forget clears session copies early. Freezing the vault stops new releases but can't clear a copy already held.

Limits on every request

  • 10 minutes to decide

    A request you don't approve or deny in time expires.

  • 10 minutes to collect

    An approved value the agent hasn't collected by then is destroyed.

  • One release per approval

    The sealed value is handed over once, then cleared from Raq.com.

  • 5 pending, 10 a minute

    Up to 5 requests can wait for you at once, and your agents can send up to 10 new requests a minute between them.

Questions

Can Claude Code see the key?

Not through this flow. It sees the request, a sealed value it has no key to open, and the command's output with the key replaced. A command can still print the key in a form the scrubber doesn't recognise, or send it somewhere, so what the command does still matters.

What if I'm away from my phone?

The request expires after 10 minutes and the agent can ask again later. You can also approve on any other device that holds one of your vault's passkeys.

Can the agent store or change secrets?

No. Secrets are added and edited in your browser, and every change asks for your passkey.

Set up your vault

Create a Raq.com account, register a passkey and save the recovery code before adding your first secret. It's free, with no charge per secret or per release.

Create your vault Sign-up goes through Raq.com.
  • Store API keys, tokens and other secrets
  • Approve or deny each agent request
  • Register passkeys on more than one device
  • Freeze one secret or the whole vault
  • Add it to your phone's home screen