# Set up Klav

You are an AI agent, and the person you work with asked you to install and
set up Klav: an open-source, end-to-end encrypted password and secrets
manager built for people and their agents. Work through the steps below in
order, one at a time. Before each step, tell the person in one line what you
are about to do and why, and ask before you download or install anything.

Klav's promise is that agents get **actions, not values**. Setting it up has
to keep that promise from the first minute.

## Rules for you, the agent

Read these before anything else. They apply to every step.

1. **Never ask for a secret in the chat, and never accept one.** That means
   the master password, the Secret Key, the emergency kit, any password,
   2FA code, API key or token. The person types those only into the Klav
   app or into their own terminal. If they paste one into the chat anyway,
   don't repeat it or use it, and suggest they change it.
2. **Never open, read, print, upload or paste a password export file**
   (`.csv`, `.json`, `.1pux`, QR screenshots) or a `.env` file's values. Not
   with `cat`, `head`, `grep`, an editor, or by attaching it to the chat.
3. **Some commands are only for the person.** Give them the exact command
   and let them run it in their own terminal: `klav signup`, `klav login`,
   `klav unlock`, `klav import <file>` (without `--dry-run`),
   `klav agent approve`, `klav approval approve`, `klav task approve`,
   `klav secret-request fulfill`, `klav item get --reveal`,
   `klav health --fix-with`, and every `klav proxy …` command.
4. **Don't work around a "no".** If Klav answers that something was denied
   or that the person paused agents, stop and tell them.
5. **Inside a sandbox, don't install Klav.** If `klav-forward status`
   answers, you are in a sandbox Klav started: use the `klav-sandbox` MCP
   tools (`sandbox_info`, `request_secret`) and stop here.

## Step 0 · Find out where you are

```sh
uname -s && uname -m
command -v klav && klav --version && klav status
command -v klav-forward && klav-forward status
```

On Linux, also check the C library: `ldd --version | head -1` (Klav needs
glibc 2.36 or later: Debian 12, Ubuntu 23.04 and newer).

| What you found | Go to |
|---|---|
| `klav-forward status` answers | Rule 5: stop, use the `klav-sandbox` tools |
| macOS on Apple silicon (`arm64`), no `klav` | Step 1, Mac |
| Linux `x86_64` with glibc 2.36+, no `klav` | Step 1, Linux |
| `klav status` says `account: none` | Step 2 |
| `klav status` shows an account | Step 3 |
| An Intel Mac, older Linux, or Windows | Tell the person the downloads don't cover it yet; Klav can be built from source with Rust |

## Step 1 · Install Klav

### On a Mac (macOS 15 or later, Apple silicon)

The person installs the Mac app. It brings the command line and the
background service (`klavd`) with it.

1. Ask the person to download it from <https://klav.dev/download/mac>, or
   with Homebrew: `brew install --cask omaralex24/tap/klav`. If the address
   leads back to `klav.dev/#download` instead of downloading `Klav.dmg`, the
   Mac download isn't out yet: tell the person and stop.
2. They open the disk image, drag Klav to Applications and open it from
   there.
3. "Set up this Mac" walks them through: the background service, the
   command line (`/usr/local/bin/klav`; macOS asks for an administrator
   password in its own dialog, never in the chat), the browsers, the
   account (Step 2) and the agent skill. In the browsers step, each
   Chromium browser (Chrome, Brave, Edge, Arc, Dia, Ardia) has "Install from
   Chrome Web Store", which opens Klav's listing in that browser; they don't
   download or load anything unpacked.
4. Check: `klav status`.

### On Linux (x86_64, glibc 2.36 or later)

There's no app on Linux: you get `klav`, `klavd` and `klav-native-host`.

```sh
curl -fL -o klav-linux-x86_64.tar.gz https://klav.dev/download/linux
curl -fL -o SHA256SUMS https://klav.dev/download/checksums
grep klav-linux-x86_64.tar.gz SHA256SUMS | sha256sum -c -
tar -xzf klav-linux-x86_64.tar.gz
mkdir -p ~/.local/bin
install -m 0755 klav-linux-x86_64/klav klav-linux-x86_64/klavd klav-linux-x86_64/klav-native-host ~/.local/bin/
klav status
```

If the checksum check fails because the download is an HTML page (the
address led back to `klav.dev/#download`), the Linux build isn't out yet:
tell the person and stop. Homebrew also works:
`brew install omaralex24/tap/klav-cli`.

`klav status` should print `account: none (run klav signup or klav login)`.

### The browser extension

In Chrome, Brave, Edge, Arc, Dia and Ardia, the person adds Klav from the
Chrome Web Store:
<https://chromewebstore.google.com/detail/klav/aoabckikmlcaffgipfcaoeccgclbpbph>.
On a Mac, the app's browsers step opens that page. On Linux, they then run
`klav extension install-host` and restart the browser. Firefox gets a file
Mozilla signed, from <https://klav.dev/download/extension/firefox>; if that
address leads back to `klav.dev/#download`, the Firefox build isn't out yet.

## Step 2 · Create the account, or sign in (the person does this)

The account and its keys are created on the person's device, and only there.
You explain; they type.

- **Which server.** Klav's own server, `api.klav.dev`, is a free beta by
  invite: the person requests one at <https://klav.dev/#beta>, and the code
  arrives by email. Or they run their own server (Docker, SQLite or
  Postgres).
- **On a Mac:** in "Set up this Mac", the Account step: "Create an account",
  or "Sign in" with their emergency kit if they already have one.
- **On Linux,** in the person's own terminal:

  ```sh
  klav signup --email you@example.com --emergency-kit ~/Desktop/klav-kit.txt
  # an account they already have:
  klav login --email you@example.com --emergency-kit ~/Desktop/klav-kit.txt
  # their own server: add --server https://klav.example.com
  ```

  `klav signup` asks for the invite code and the master password itself.
- **The emergency kit** holds the Secret Key. Tell the person to print it or
  keep it offline, then delete the file. Never open it.
- **Unlock:** on a Mac, with Touch ID in the app. On Linux, the person runs
  `klav unlock` (it starts `klavd` and asks for the master password).

Check with `klav status`: it shows the account, and `klavd` running.

## Step 3 · Connect yourself to Klav

Your client is the program you run in: `claude-code`, `claude-desktop`,
`codex`, `cursor`, `vscode` or `antigravity`. If you don't know which one
you are, ask.

1. Run:

   ```sh
   klav client connect <client> --yes --json
   ```

   It adds Klav's MCP server (`klav mcp`) and Klav's skills to your client,
   with a backup of its settings, and registers you as an agent waiting for
   approval. You get no access yet.
2. Show the person the **six words** exactly as `klav` printed them, and tell
   them where to approve: the Mac app's Requests, their iPhone, or
   `klav agent approve <client>` in their own terminal. They compare the
   words and choose which projects you get.
3. Wait in the background, without using Klav meanwhile:

   ```sh
   klav agent status --agent <client> --wait
   ```

4. Once approved, `klav agent …` works at once. Klav's MCP tools appear the
   next time your client loads its MCP servers; if you don't see them, tell
   the person the client needs a restart.

If the answer is denied or revoked, stop: the person already decided. A
runtime that isn't one of those clients registers with
`klav agent register --name <name> --note "<what it is for>"`.

## Step 4 · Bring their passwords over

The person exports from their old password manager or browser, and imports
the file. **You never see the file's contents**, and it never goes into the
chat.

| From | How the person exports | File |
|---|---|---|
| 1Password | Desktop app: File › Export › the account › 1PUX | `….1pux` (or `.csv`) |
| Bitwarden | Web vault: Tools › Export vault, `.json` (not the encrypted one); passkeys come too | `bitwarden_export_….json` (or `.csv`) |
| Chrome, Brave, Edge, Arc, Dia | Password manager › Settings › Export passwords | `….csv` |
| Firefox | `about:logins` › ⋯ › Export passwords | `logins.csv` |
| Safari | Passwords app › File › Export All Passwords | `Passwords.csv` |
| Google Authenticator | On the phone: menu › Transfer accounts › Export accounts, one or more QR codes | a photo or screenshot of each QR |

1. Help them find the export menu, and agree on where the file goes (for
   example `~/Downloads`). Ask them for its path, not its contents.
2. Optionally, preview the import. This reads the file inside Klav and
   prints what would happen, without any values:

   ```sh
   klav import <path> --dry-run --json
   ```

3. The person imports, in their own terminal:

   ```sh
   klav import <path>
   ```

   They can also use the browser extension ("Where are you coming from?")
   or the iPhone app, which reads Google Authenticator's QR codes with the
   camera. Google Authenticator's `otpauth-migration://` links hold the
   secrets: they go only into `klav import -` in the person's terminal,
   never into the chat or a command argument.
4. **Then the person deletes the export file and empties the Trash.** It
   holds every password in plain text. Remind them until it's done.

A login they already had is merged, and its older password goes to the
item's history. Authy has no export: each 2FA code has to be set up again.

## Step 5 · Check the Vault's health

Reused, weak and old passwords show up in Vault Health: in the Mac app
(Vault health, ⌘4), on the iPhone (Settings › Passwords › Vault health), or
with `klav health` in the person's terminal. It names items, never values.

- **Breached passwords** are off until the person turns the check on with
  `klav health breach-check on`. It sends only the first five characters of
  each password's SHA-1 hash to Have I Been Pwned.
- **Offer to fix the reused ones.** The person offers you a task from the
  app ("Fix my reused passwords") or with
  `klav health --fix-with <client>`. You find it with `list_tasks`, and for
  each site: open its change page (`change_password_url`), call
  `rotate_password` with `target: "extension"`, and `rotate_confirm` once
  the site accepts the new password. Call `end_task` at the end. You get the
  sites, never which ones shared a password, and never a value. This needs
  the browser extension on the computer you run on.

## Step 6 · Move the repository's `.env` files to `klav.toml`

If the person works in code, offer this for each repository. Klav's
`klav-migrate` skill, installed in Step 3, has the full procedure.

1. **Inventory names, not values.** To list a `.env` file's variable names:

   ```sh
   awk -F= '/^[[:space:]]*[A-Za-z_][A-Za-z0-9_]*=/{gsub(/^[[:space:]]+/, "", $1); print $1}' .env
   ```

2. **Put each secret in Klav.** Search first (`search_items`). For a secret
   that isn't there, send `request_secret` (kind `api_key`, or `database`
   for connection URLs): the person types the value on their own device.
3. **Write `klav.toml`**, references only. It goes in the repository:

   ```toml
   project = "Work/acme-api"

   [env]
   STRIPE_KEY   = "Stripe/api_key"
   DATABASE_URL = "Postgres/url"
   ```

4. **Check it works:** `klav run -- <the usual command>`. Only then, and
   with the person's OK, delete the `.env`. If it was ever committed to
   git, the person should change those secrets too.
5. **Add Klav's rules to the repository's `CLAUDE.md` or `AGENTS.md`.** On
   a `klav` that has it, `klav client rules` prints the block. Otherwise,
   add this one:

   ```md
   ## Secrets (Klav)
   - Secrets live in Klav. Never read, print or write `.env` files or secret values.
   - Run what needs secrets with `klav run -- <command>` (or `run_with_secrets` / `klav agent run`); `klav.toml` holds references only.
   - Missing a secret? Use Klav's `request_secret`. Never ask for it in the chat.
   - In a sandbox, use the `klav-sandbox` tools, never a token.
   ```

## Step 7 · Test the notifications

Send one harmless request so the person sees how Klav asks them. With MCP,
call `request_secret` with kind `api_key`, the title `Klav notification
test` and a reason that says it's a test. Without MCP:

```sh
klav agent secret-request create --type api-key --title "Klav notification test" \
  --reason "Test that Klav's requests reach your Mac and iPhone" --json
```

Tell the person to look at the Mac app's Requests and at their iPhone (the
iPhone app has to be signed in, with notifications allowed). They can deny
it, or save any throwaway value and delete the item afterwards. Wait with
the `wait_command` the answer gives you, in the background.

## Step 8 · Optional: Klav Sentinel, for agents off this machine

Skip this unless the person's agents run somewhere else: a cloud sandbox,
CI, or a remote server. On this computer, Klav already fills and injects in
place, and nothing readable leaves the person's devices.

A sandbox runs on someone else's computer, so something trusted has to add
the credential to each request it sends out. That's Sentinel. It decrypts
only the credentials the person explicitly shares with it, and the sandbox
gets a credential that dies with it.

Go in this order:

1. **Where Sentinel runs.** The person picks one:
   - **Klav Cloud Sentinel** (invite-only beta): runs in an AWS Nitro
     Enclave that the person's devices check before they share a token.
     Klav turns it on per account; without access yet, the person can
     request it at <https://klav.dev/#beta> when new spots open. With
     access, they run `klav proxy use klav` (or choose "Use Klav Cloud
     Sentinel" in the Mac app).
   - **Self-hosted Sentinel** (`klav-proxy`, free; early preview): on a
     machine the person controls, best an always-on mini PC or home server
     on their home network, so sandboxes keep working when a laptop sleeps.
     Never inside an agent sandbox. They run `klav-proxy init` there,
     compare its six words once, then `klav proxy use own <its agent name>`.
2. **Allow the credentials** the projects need. That's the person's step:
   `klav proxy grant …`, or "Allow credential…" in the Mac app's
   Sentinel › Credentials (or "Use in Sentinel…" on an item in Keys &
   environments).
3. **The sandbox issuer**, always self-hosted: the orchestrator or runner
   that starts the VMs or sandboxes and connects them to Sentinel. Best on
   the same home-network mini PC, or a CI runner. It registers as an agent,
   and the person grants it the profiles it may use
   (`klav proxy issuer add …`, or the issuer's page in the Mac app's
   Agents). Then you start sandboxes with
   `klav sandbox start --label <purpose> --profile <name> -- <command that creates the sandbox>`,
   and never put a token in one.
4. **Hand off the environment.** Once Sentinel and the issuer are wired and
   a test sandbox works, give the person the environment URL to add in
   T3 Code (Settings → Linked environments) or in their ADE's Environments
   settings.

In the Mac app, Sentinel › Setup shows steps 1 and 3, in that order, and
Sentinel › Credentials step 2.

How the enclave is verified, and what each option trusts:
<https://klav.dev/security>.

## When you're done

Tell the person, in a few lines: what's installed, that their account is
set up (never repeat any part of a secret), that you're connected and which
projects you got, how many items were imported, that the export file is
deleted, what Vault Health found, and which repositories now use
`klav.toml`.
