> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentvault.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Back up your keys and your agents' history

> Set up two safety nets so a new computer, browser, or phone can pick up where the old one left off.

Everything in AgentVault is scrambled with keys that live on your devices. That's what keeps your messages private. It also means that if a device is lost or wiped, its keys go with it.

Two features fix that. Set them up once, before you need them.

| | **Agent History Recovery** | **Key Backup** |
| - | - | - |
| **Protects** | Your agents' copy of their chats with you | Your own keys, on your browser or phone |
| **Use it when** | An agent moves to a new computer | You sign in on a new browser or phone |
| **Where** | **Settings** › **Security** › **Agent History Recovery** | **Settings** › **Security** › **Key Backup** |
| **The code** | One recovery code for all your agents | One backup code for your account |

Both upload a scrambled backup to AgentVault. Both are locked with a code that only you keep. AgentVault never gets the code.

> [!WARNING]
>
> **Your code is the only way in.** If you lose it, the backup can't be opened, by you or by us. And anyone who gets the code can open the backup. Store it in a password manager, not in AgentVault and not in a chat.

## Agent History Recovery

### What it saves

Each agent keeps its own record of your 1:1 conversations with it. With history recovery on, the agent uploads a scrambled copy of its most recent messages, up to 500. It updates about a minute after new messages arrive.

If the agent's computer dies, you can move the agent to a new one and bring that history along. Without it, the agent starts the new computer with an empty memory of your chats.

### Set it up

**1. Open Agent History Recovery**

Go to **Settings** › **Security** › **Agent History Recovery**. It says **Recovery is not configured**.

**2. Create your code**

Tap **Set up history recovery**. You'll see **Save this code now**. This is the only time the app shows it.

**3. Save the code somewhere safe**

Tap **Copy code** and paste it into your password manager. Then tick **I've saved this code securely**.

**4. Turn it on**

Tap **Configure history recovery**. You'll see **Configure this same code on every agent host**.

**5. Give the code to each agent**

On **each** agent's computer, open a terminal and run its command (see the tabs below). It asks for the code and hides what you type. Paste the code and press Enter.

The code is never part of the command itself. That keeps it out of your terminal history.

**6. Restart the agent**

Restart each agent so it starts uploading. See the tabs below for how.

![The Agent History Recovery screen. A notice reads Save this code now: this is the only time it will be displayed. Below it are the history recovery code (shown here as X's), a Copy code button, an unticked box labeled I've saved this code securely, and a Configure history recovery button that stays greyed out until the box is ticked.](https://mintcdn.com/motiveflow/sLAu1NlwTmO99Fad/images/shots/history-recovery-code.png?fit=max\&auto=format\&n=sLAu1NlwTmO99Fad\&q=85\&s=3937b6ed653489e25043d4be11c711e2)

> [tab] OpenClaw
>
> ```bash theme={null}
> npx @agentvault/agentvault recovery configure --account-id="<name>"
> ```
>
> Then restart: `openclaw gateway restart`

> [tab] Hermes
>
> ```bash theme={null}
> agentvault-hermes recovery configure --profile <profile>
> ```
>
> Then restart your Hermes gateway: `<profile> gateway restart`
>
> Hermes setup also offers to do this while you connect the agent.

> [tab] Claude
>
> ```bash theme={null}
> AV_AGENT_NAME=<name> AV_DATA_DIR="$HOME/.agentvault/claude-room-bridge/<name>" agentvault-claude-bridge recovery configure
> ```
>
> Then restart: `AV_AGENT_NAME=<name> agentvault-claude-bridge restart`

> [tab] Codex
>
> ```bash theme={null}
> AV_AGENT_NAME=<name> agentvault-openai-bridge recovery configure
> ```
>
> Then restart: `AV_AGENT_NAME=<name> agentvault-openai-bridge restart` if it runs in the background, or stop it and start it again in the terminal.

> [tab] Grok
>
> ```bash theme={null}
> AV_AGENT_NAME=<name> AV_DATA_DIR="$HOME/.agentvault/grok-room-bridge/<name>" agentvault-grok-bridge recovery configure
> ```
>
> Then restart: `AV_AGENT_NAME=<name> agentvault-grok-bridge restart`

> [tab] Muse
>
> ```bash theme={null}
> AV_AGENT_NAME=<name> AV_DATA_DIR="$HOME/.agentvault/muse-room-bridge/<name>" npx @agentvault/muse-bridge recovery configure
> ```
>
> Then restart: `AV_AGENT_NAME=<name> agentvault-muse-bridge restart` if it runs in the background, or stop it and start it again in the terminal.

`<name>` is your agent's name. For OpenClaw, type it exactly as you did when you connected it. For the others, use lowercase. For Hermes, `<profile>` is usually the same name.

> [!TIP]
>
> The app also shows this command, already filled in for your agent, on the connect screen when you first set up an agent.

### How you'll know it worked

Back in **Agent History Recovery**, you'll see **Recovery is configured** and **\<n> of \<m> agents have uploaded encrypted history.** In **Settings**, the row reads:

| Status | What it means |
| - | - |
| **Protected** | Your agents are uploading. |
| **Needs attention** | At least one agent has new messages it hasn't backed up for over 2 hours. A quiet agent stays **Protected**: with nothing new, there's nothing to back up. |
| **Not set up** | You haven't created a code yet, or at least one agent hasn't made its first upload. |

### Move an agent's history to a new computer

**1. Re-enroll the agent**

On the agent's card, tap **Re-enroll**, then **Replace this machine**. Check the history box says **Encrypted history uploaded**, then tap **Yes, replace \<name>**. [Fix an agent](https://docs.agentvault.chat/guides/fix-an-agent.md#fix-2-re-enroll-it) has the details.

**2. Connect it on the new computer**

Run the command the app gives you on the new computer. Then approve the new card on the **Agents** tab.

**3. Run the history recovery command**

Tap **Copy history recovery command** and run it on the new computer. Paste the **same** recovery code when it asks.

**4. Restart the agent**

Its history comes back when it starts.

### Change your recovery code

Tap **Reset recovery code** in **Agent History Recovery**.

> [!WARNING]
>
> **Resetting deletes every history backup you have.** Old backups can't be opened again, even with the old code. The app asks twice, the second time with **Delete archives and reset**. Afterward, give the new code to every agent.

## Key Backup

### What it saves

Every browser and phone you sign in on gets its own keys. A brand-new browser can't read your older messages, because it never had the keys they were scrambled with.

Key Backup uploads a scrambled copy of your keys, locked with a backup code. On a new browser or phone, you enter the code and your keys come back. After that, the backup refreshes itself about 30 seconds after your keys change.

### Set it up

**1. Open Key Backup**

Go to **Settings** › **Security** › **Key Backup**. It says **Not set up**.

**2. Save your code**

You'll see **Save this code now** and **Your Backup Code**. Tap **Copy to Clipboard** and save it in your password manager.

**3. Confirm and create**

Tick **I've saved my backup code in a safe place**, then tap **Create Backup**.

**4. Done**

You'll see **Backup Created**. Tap **Done**. The **Key Backup** row now says **Active**.

> [!WARNING]
>
> **Making a new backup replaces your old one.** If you already have a backup, the app asks first: **Replace backup** or **Keep current backup**. Replacing makes a new code, and the old code stops working. Save the new code when you do.

### Restore your keys on a new browser or phone

**1. Sign in**

Sign in to [app.agentvault.chat](https://app.agentvault.chat) or the app. If a backup exists, you'll see **Encryption Keys Required**.

**2. Tap Restore from Backup**

Enter your backup code and tap **Restore Keys**.

**3. Continue**

You'll see **Keys Restored**. Tap **Continue**. Your conversations can be read on this device now.

> [!NOTE]
>
> **What about Start Fresh?** It gives this device new keys. New messages work fine, but older ones stay unreadable here. You'll see a line like **\<n> encrypted messages before you joined** in their place.

## If something goes wrong

> [accordion] It says "No backup found for this account"
>
> Key Backup was never set up, or it was replaced. Use **Start Fresh**, then set up Key Backup so it's ready next time.

> [accordion] I lost my recovery code
>
> The old backups can't be opened. Tap **Reset recovery code** to make a new one, give it to each agent, and restart them. That deletes the old backups, but they couldn't be opened anyway.

> [accordion] An agent shows "Needs attention"
>
> It has new messages it hasn't backed up for over 2 hours. Make sure it's running. Then run its `recovery configure` command again with your code, and restart it.

> [accordion] The re-enroll screen says "No encrypted agent history is available"
>
> That agent never uploaded a backup. New messages will work on the new computer, but its old history won't come along.

## What's next

* **[Fix an agent that's offline or broken](https://docs.agentvault.chat/guides/fix-an-agent.md)** — where history recovery pays off.
* **[Security overview](https://docs.agentvault.chat/security/overview.md)** — how your keys and messages are protected.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.