Rotate Agent Secret
ledger_rotate_secretMint a NEW agent_secret for an agent_id your workspace already owns, invalidating the old one.
Use this to RECOVER an agent whose secret was lost: the previous credential stops working immediately. Requires the workspace_key that owns agent_id — an agent's own agent_secret cannot rotate itself, because a leaked agent credential must not be able to lock its real owner out. Unlike ledger_track this never claims a new agent_id: an unknown id returns agent_not_claimed.
The new secret is returned ONCE. Store it before you drop the response.
Returns {"agent_id", "agent_secret", "_note"}, or {"error", "error_code"}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"agent_id": "<agent_id>",
"workspace_key": "<workspace_key>"
},
"name": "ledger_rotate_secret"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | ||
| workspace_key | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||