Source: https://keypaste.com/developers/start/
Last updated: 2026-12-01

# Give an AI agent its first key

You’ll have an AI tool connected to a vault, and one request for a value answered by you and recorded in the log.

## Prerequisites

- The `keypaste` command: the desktop app puts it on your `PATH` from Settings › keypaste in a terminal, or [install the CLI](https://keypaste.com/developers/install/) alone.
- An AI tool such as Claude Code, Codex or Cursor.

## 1\. Make a vault

Terminal window

```
keypaste init ~/vault.kdbxkeypaste use ~/vault.kdbx
```

```
New master password:Confirm master password:Created /home/you/vault.kdbxkeypaste: agents and the CLI now use /home/you/vault.kdbx when no --vault is given.keypaste: an AI tool's running bridge keeps the vault it started with until the tool restarts it.
```

Nothing can recover a forgotten master password. In the desktop app, Create a vault… does the same.

## 2\. Add a test value

Terminal window

```
keypaste env set demo STRIPE_KEY
```

```
Master password:Value for STRIPE_KEY:Set STRIPE_KEY on env/demo/.env, created and tagged env:demo
```

Paste a fake value, such as `sk_test_EXAMPLE_ONLY_not_a_real_key_0000`: an AI tool can keep what it receives.

## 3\. Connect your AI tool

Terminal window

```
keypaste setup
```

```
  claude-code      claude mcp add --scope user --transport stdio keypaste -- …  cursor           edit /home/you/.cursor/mcp.json: set mcpServers.keypaste …Connect keypaste to these 2 tools? [y/N] y  claude-code      configured  cursor           configured; the original is kept as /home/you/.cursor/mcp.json.keypaste-backup; restart Cursor to load it
```

No master password goes into a tool’s configuration. In the desktop app, Agents › + does the same ([Connect an AI tool](https://keypaste.com/developers/mcp-setup/)).

## 4\. Hold the vault unlocked

Unlock the vault in the desktop app, or leave this running in a terminal of its own:

Terminal window

```
keypaste approve
```

```
Master password:keypaste: watching /home/you/vault.kdbxkeypaste: listening on keypaste-vault-9f3a1c02b7d54e60 for unlock 5d0c8e1a…, 45 seconds to answer.
```

## 5\. Ask, and answer

Start a new session in your AI tool and ask: “use keypaste to get STRIPE\_KEY from the demo environment”. keypaste asks you:

```
keypaste: an agent is asking for a credential.
  agent    claude-code (claude-code)  item     .env  group    env/demo  field    STRIPE_KEY
[d] deny  [o] once  [a] always  45s ›
```

Press `o` to allow this one request. The app shows the same question with Deny, Allow once and Always allow.

## 6\. Read the log

Terminal window

```
keypaste log --since 5m
```

```
2 records of 2 in /home/you/.keypaste/audit.jsonl, since 2026-07-27 09:53:07Z
  time (UTC)           agent        item           decision  method  2026-07-27 09:57:42  claude-code  -              granted   exposure  2026-07-27 09:57:42  claude-code  env/demo/.env  granted   prompt
```

`exposure` is the agent listing names, and `prompt` the request you answered. The log records every request, allowed or refused, and never the value.

## Next steps

- [How approvals work](https://keypaste.com/developers/how-approvals-work/)
- [Use your vault’s env in a project](https://keypaste.com/developers/replace-dotenv/)
- [Sandbox your AI tool](https://keypaste.com/developers/sandbox-your-ai-tool/)
