---
title: "What to Do When Your .mcp.json Is Compromised | AgentRQ Guidelines"
url: https://agentrq.com/guidelines/security/compromised-mcp-json
description: "Your .mcp.json leaked? Reset the AgentRQ workspace ID to revoke its MCP token and keep your tasks, or purge the workspace. Step by step."
---

Checked November 14, 2026 | [All Security guides](https://agentrq.com/guidelines/security/)

# What to Do When Your .mcp.json Is Compromised

If a `.mcp.json` file with your AgentRQ workspace in it was committed to a public repository, pasted into a chat, shared in a screenshot or copied off a machine you no longer trust, treat the workspace token inside it as leaked. Go to the workspace's **Settings**, open **Danger Zone**, and click **Reset ID**. The screenshots below show every click. That gives the workspace a new ID and revokes every token issued for the old one, while keeping all your tasks and history. If you would rather throw the workspace away entirely, **Purge Workspace** revokes the token too, but deletes everything in it.

This page is one of our [security guidelines](https://agentrq.com/guidelines/security/). It was checked against the AgentRQ source on November 14, 2026.

## Why a Leaked .mcp.json Matters

The `.mcp.json` that the workspace's **Setup** tab gives you holds its MCP URL, and that URL ends in `?token=...`. The token is how the [workspace MCP server](https://agentrq.com/docs/mcp-tools) knows a caller is your agent. Whoever has it can do what your agent can do in that workspace: read and reply to tasks, create new ones, read and change the workspace's memory and skills, write Pano docs, and ask to run the site tools you shared with it.

The token is bound to the workspace ID and nothing else. It does not expire on its own, and there is no separate token to rotate. Changing the ID is what revokes it.

## Step by Step: Open the Danger Zone

Open the workspace in [AgentRQ](https://app.agentrq.com). Each screenshot below marks the one button to click next, numbered in order.

**1. Click the Settings gear** at the top right of the workspace, next to **New Task**.

![Step 1: the AgentRQ workspace page, with an arrow pointing at the Settings gear icon at the top right, next to New Task](https://agentrq.com/assets/guidelines/security-reset-1-open-settings.png)

**2. Choose the Danger Zone tab**, the red tab at the bottom of the settings menu.

![Step 2: workspace Settings, with an arrow pointing at the Danger Zone tab at the bottom of the left menu](https://agentrq.com/assets/guidelines/security-reset-2-danger-zone.png)

The Danger Zone shows two ways out. Pick one.

## Option 1 (Recommended): Reset the Workspace ID

**3. Click Reset ID** on the **Reset Workspace ID** card.

![Step 3: the Danger Zone tab, with an arrow pointing at the Reset ID button on the Reset Workspace ID card](https://agentrq.com/assets/guidelines/security-reset-3-reset-id.png)

**4. Click Reset ID again** in the dialog to confirm.

![Step 4: the Reset Workspace ID confirmation dialog, with an arrow pointing at the red Reset ID button](https://agentrq.com/assets/guidelines/security-reset-4-confirm.png)

What happens:

- → The workspace gets a new ID, and every token issued for the old ID stops working at once. Any agent, script or person using the leaked `.mcp.json` is cut off.
- → Everything in the workspace is kept: tasks with their whole threads, attachments, memory, skills and settings all move to the new ID in a single step. If anything fails along the way, nothing changes and the old ID stays as it was.
- → The workspace's MCP URL changes, so your own agents are cut off too, until you set them up again.
- → Links to the workspace and its tasks change, because they contain the ID. Old bookmarks and shared links stop working.

**5. Copy the new .mcp.json.** After the reset, AgentRQ takes you straight to the new ID's **Setup** tab. Pick your agent's tab, such as **Claude**, and click **Copy Config**. Replace the old `.mcp.json` with it in every directory where an agent runs for this workspace, then restart those agents.

![Step 5: the Setup tab after the reset, showing the new .mcp.json with the new workspace ID, with an arrow pointing at Copy Config](https://agentrq.com/assets/guidelines/security-reset-5-copy-mcp-json.png)

## Option 2: Purge the Workspace

After steps 1 and 2 above:

**3. Click Purge Permanent** on the **Purge Workspace** card.

![Option 2, step 3: the Danger Zone tab, with an arrow pointing at the red Purge Permanent button](https://agentrq.com/assets/guidelines/security-purge-1-purge.png)

**4. Click Delete** in the dialog, only if you are sure you want the workspace gone.

![Option 2, step 4: the Purge Workspace confirmation dialog, with an arrow pointing at the red Delete button](https://agentrq.com/assets/guidelines/security-purge-2-confirm.png)

What happens:

- → The workspace is deleted, so its ID and every token issued for it stop working, exactly like a reset.
- → Everything in it is deleted too: tasks, messages, attachments, memory, skills and configuration. This cannot be undone.
- → A workspace with forks cannot be purged until each fork is merged back into it.

Choose this only if you no longer need anything in the workspace, or you want to start over from a clean one. Otherwise, reset the ID.

## Reset ID vs Purge at a Glance

|  | Reset Workspace ID | Purge Workspace |
| --- | --- | --- |
| Revokes the leaked token | Yes, immediately | Yes, immediately |
| Keeps tasks, memory and skills | Yes | No, all deleted |
| MCP URL | Changes, set agents up again | Gone |
| Task and workspace links | Change | Gone |
| Can be undone | The old ID cannot come back | No |
| When to use it | Almost always | You want the workspace gone |

## After the Reset: Clean Up the Leak

Revoking the token stops further access. These steps close the rest of the gap:

1. **Remove the old file everywhere.** Replace `.mcp.json` on every machine and in every directory that had it. The old one no longer works, but there is no reason to keep it around.
2. **Scrub it from git.** If the file was committed, deleting it in a new commit leaves it in the history. Treat the history as public for good, which is why revoking comes first, and add `.mcp.json` to `.gitignore` so it is not committed again.
3. **Look at what changed.** Skim the workspace's recent tasks and replies, its memory and its skills for anything you or your agents did not write. A skill or memory entry is read by every agent that works in the workspace, so an injected instruction there matters more than a stray task.
4. **Check the other workspaces from the same file.** One `.mcp.json` can list several MCP servers. Reset each AgentRQ workspace that appears in the leaked file, not just the first one.

## How to Keep .mcp.json From Leaking Again

- → Keep `.mcp.json` out of version control. Add it to `.gitignore` in every repository where an agent runs.
- → Keep the token itself out of the file. Claude Code expands environment variables in `.mcp.json`, so the URL can end in `?token=${AGENTRQ_TOKEN_MY_PROJECT}` with the value set in your shell profile. Our [token security guide](https://agentrq.com/docs/howto-token-rotation) shows how.
- → Do not paste the file, or the MCP URL, into chats, issues or screenshots. The token is the part after `?token=`.
- → Run agents from a machine set up with `agentrqd` where you can. The workspace Setup tab starts an agent on a connected machine in one click, with no config file to copy around.
- → Give each project its own workspace, so one leaked file exposes one workspace's tasks and not all of them.

## FAQ

### Does archiving the workspace revoke the token?

No. Archiving makes the workspace read-only and pauses connections, but keeps the same ID, so unarchiving it brings the leaked token back to life. Reset the ID or purge the workspace instead.

### Do I lose my tasks when I reset the workspace ID?

No. Tasks, their threads, attachments, memory, skills and settings all move to the new ID. Only the ID, the MCP URL and the links change.

### Can I go back to the old workspace ID?

No. The old ID is retired, which is the point: a token issued for it can never work again.

### My agents stopped working after the reset. What now?

That is expected. Open the workspace's **Setup** tab, copy the new `.mcp.json` into the agent's directory in place of the old one, and restart the agent.
