---
title: "agents rotate"
description: "Rotate an agent credential's secrets"
canonical: "https://pgbeam.com/docs/cli/agents/rotate"
last-updated: "2026-09-14T19:37:21.000Z"
---

# agents rotate

> Rotate an agent credential's secrets

URL: https://pgbeam.com/docs/cli/agents/rotate

Generate a new Postgres password and MCP token for an existing credential, keeping its id, username, name, and policy. Connections using the old password are dropped within seconds. The new secrets are shown once and cannot be retrieved again, so update your agent before its next call. A ready-to-paste MCP client config is printed alongside the secrets.

## Usage

## Options

Option

Description

Required

Default

`<id>`

Agent credential ID

Yes

-

`--client <value>`

MCP client to emit config for: claude (default), claude-desktop, cursor, vscode, cline, windsurf, or all

No

`claude`

All global options (`--token`, `--profile`,
`--project`, `--org`, `--json`, `--no-color`, `--no-trunc`, `--debug`) are
also available on this command.

## Examples

## Output

Prints the new connection string, MCP URL, MCP token, and a ready-to-paste MCP client config once. With --json, returns the full secrets object.