PgBeam Docs
agents

agents rotate

Rotate an agent credential's secrets

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 — update your agent before its next call. A ready-to-paste MCP client config is printed alongside the secrets.

Usage

pgbeam agents rotate <id> [flags]

Options

OptionDescriptionRequiredDefault
<id>Agent credential IDYes-
--client <value>MCP client to emit config for: claude (default), cursor, vscode, or allNoclaude

Global options

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

Examples

# Rotate a credential's secrets
pgbeam agents rotate agt_xxx

# Rotate and emit a VS Code MCP config
pgbeam agents rotate agt_xxx --client vscode

# Rotate and capture secrets as JSON
pgbeam agents rotate agt_xxx --json

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.

On this page