Source: https://keypaste.com/developers/keepass-and-agents/
Last updated: 2026-12-01

# KeePass and AI agents

A coding agent that needs a credential often asks you to paste it into the chat, where it stays. keypaste lets the agent ask your KeePass vault for one value instead, and you decide each time.

## What stays the same

- **Your file.** The vault is a KDBX file on your computer, with no account or network. KeePassXC opens it ([compatibility tests](https://github.com/notinferred/keypaste/blob/main/docs/FEATURES.md#keepassxc-compatibility)).
- **Your items.** They stay ordinary KeePass entries ([what KeePassXC sees](https://keypaste.com/developers/env/#what-keepassxc-sees)).
- **Where it lives.** An existing file can stay where it is ([below](#using-your-keepass-file)).

## What changes

**Agents can ask.** Your AI tool starts `keypaste mcp`, a bridge that holds no vault. You unlock the vault where you approve: in `keypaste approve` or the desktop app. An agent cannot make keypaste ask for the master password.

**An agent sees names, not values.** It sees each item’s title, group, tags and URL, and cannot name an item outside that.

**You decide each value.** The agent’s [settings](https://keypaste.com/developers/policy/) set each kind of value to Ask, Allow or Block, and Ask is the default. Silence for 45 seconds denies ([Approvals](https://github.com/notinferred/keypaste/blob/main/docs/approvals.md)).

```
────────────────────────────────────────────────────────────keypaste: an agent is asking for a credential.
  agent    claude-code (claude-code)  item     .env  group    env/demo  field    STRIPE_KEY
  the agent says it needs this because:    deploy the billing service to staging
  That sentence was written by the agent, not by keypaste. Treat it as a claim.
[d] deny  [o] once  [a] always  45s ›
```

**Every call is logged.** Each goes to a local, hash-chained audit log before the answer, without the value. If the log cannot be written, the call is refused.

```
2 records in /home/you/.keypaste/audit.jsonl
  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
```

[The demo](https://keypaste.com/developers/demo/) runs this flow in about sixty seconds.

## Using your KeePass file

keypaste can keep editing an existing KeePass file where it is, or copy it into the vault you already use. The source file is only read when copied. [Import](https://github.com/notinferred/keypaste/blob/main/docs/import.md) shows both.

## Why approve locally

Credentials leak through AI prompts and [MCP configuration files](https://blog.gitguardian.com/the-state-of-secrets-sprawl-2026/), and malware has run installed coding agents to search for more, as in the [2025 `nx` compromise](https://blog.gitguardian.com/the-nx-s1ngularity-attack-inside-the-credential-leak/). keypaste applies KeePassXC’s browser model, another program asking over a local channel and you confirming, to agents.

Other password managers offer agent access with their own approval and delivery models. keypaste is an account-free, local approval bridge over a KDBX file.

## Limits

- A released value goes to the agent’s AI tool, which may send it to a remote model or keep it. keypaste cannot erase those copies or revoke the credential.
- The log records the release, not later use.
- keypaste cannot verify the agent’s reason.

[SECURITY](https://github.com/notinferred/keypaste/blob/main/SECURITY.md) and [THREATS](https://github.com/notinferred/keypaste/blob/main/THREATS.md) state the guarantees and limits.
