# rotate

Source: https://botpassword.com/docs/intents/rotate

Partly built. rotate (partly built) rotates a granted credential at its provider and stores the new revision: create a new key, store it as pending, verify it,…

**Status: Partly built.** It runs only under a grant with autopilot, for an item the person set up with `bpw rotate configure` (Cloudflare tokens and AWS IAM keys today). Without autopilot the daemon answers `not_implemented`, because the per-use confirmation is planned, not built yet.

## At a glance

*Status: `rotate` is partly built.*

| Property | Value |
|---|---|
| MCP tool | `rotate` ("Rotate a credential") |
| CLI | `bpw agent rotate` |
| Default friction | Today: a grant with autopilot (`bpw grant add --autopilot`, a grant whose only intent is `rotate`). The planned default is a one-time toggle per credential. |
| Delivery | No value is involved: the new key goes straight from the provider into the vault. |

## Parameters

No parameter is required by the schema. Unknown arguments are refused. The descriptions are the tool's own, as `bpw mcp` serves them.

| Name | Type | Required? | Description |
|---|---|---|---|
| `credential` | string | optional | A credential reference (item ID), as list_credentials returns it. Not a secret value. Not empty. |

## Example

*Status: `rotate` is partly built.*

A `tools/call` request, with placeholder references (use the `id` that `list_credentials` returns):

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "rotate",
    "arguments": {
      "credential": "ITEM-EXAMPLE-01"
    }
  }
}
```

The result. The same JSON is also sent as text in `content[0].text`; `isError` is false for `rotated`.

```json
{
  "structuredContent": {
    "outcome": "rotated",
    "detail": "REV-EXAMPLE-02"
  },
  "isError": false
}
```

*Status: `rotate` is partly built.*

## From the command line

*Status: `rotate` is partly built.*

```sh
bpw agent rotate --credential ITEM-EXAMPLE-01
```

`bpw agent <intent>` sends the same request as the MCP tool, through the same policy. Every intent except `status` needs a live agent session, or the answer is `session_required`. Run the harness with `bpw agent run -- <harness>`. On macOS and Linux, an enrolled harness started normally can also be approved in the desktop app or with `bpw session approve`.

## Result fields

Every result is one JSON object. Only `outcome` is always present.

| Field | Type | Meaning |
|---|---|---|
| `outcome` | string | The [typed outcome](/docs/outcomes) code. Always present. |
| `detail` | string | The request ID, rotation step, revision or reason, for the outcomes that carry one. |
| `intent` | string | With `not_implemented`: the intent this build cannot carry out. |
| `reason` | string | With `rejected`: why the call was refused. |
| `message` | string | With `rejected` or `daemon_unavailable`: what was wrong. Never quotes an argument value. |
| `next_step` | string | On a result that is not a plain success: one sentence on what to do now. Fixed text chosen by the outcome code; it never asks for a password or secret and never says to get around a refusal. |

## Outcomes it can return

*Status: `rotate` is partly built.*

- [`rotated`](/docs/outcomes/rotated): `rotate` (partly built) finished: the new key was created, verified and promoted, and the old one is scheduled for revocation after its grace period.
- [`partially_rotated`](/docs/outcomes/partially_rotated): `rotate` (partly built) stopped after some steps.
- [`not_rotated`](/docs/outcomes/not_rotated): The provider refused, or the rotation was abandoned after a failed verify.
- [`needs_human`](/docs/outcomes/needs_human): Something only a person can do stands in the way.
- [`unknown_outcome`](/docs/outcomes/unknown_outcome): A step ended in a way that does not show whether it took effect: a request timed out after it was sent, a connection dropped, or the extension had the value and did not report back.
- [`not_implemented`](/docs/outcomes/not_implemented): Policy allowed the request, and this build has no way to carry it out.
- [`scope_denied`](/docs/outcomes/scope_denied): The most common refusal.
- [`grant_expired`](/docs/outcomes/grant_expired): A grant names this credential for this client, but its lifetime is over.
- [`session_required`](/docs/outcomes/session_required): The call did not come from inside a live agent session: none was presented, it expired, or it is malformed.
- [`vault_locked`](/docs/outcomes/vault_locked): BotPassword on this device is locked, so no credential can be used.
- [`rejected`](/docs/outcomes/rejected): The request was malformed before policy saw it.
- [`daemon_unavailable`](/docs/outcomes/daemon_unavailable): `bpw mcp` or `bpw agent` could not reach `botpasswordd`, the desktop daemon that holds the keys.

See the [outcome reference](/docs/outcomes) for what each one means and what to do next.

*Status: `rotate` is partly built.*

## Limits

- Only Cloudflare tokens and AWS IAM keys can be rotated through their API today. GitHub, Stripe and generic credentials cannot yet.
- Company policy can forbid autopilot for company credentials.
- A step that cannot check provider state answers `unknown_outcome` and is never retried blindly.

## Tool description

What the MCP tool tells the agent, verbatim from `bpw mcp`:

> Rotates a granted credential at its provider and stores the new revision. This tool never accepts or returns secret values. The result is a typed outcome such as success, vault_locked or scope_denied. This build checks the request against BotPassword's policy and then returns not_implemented; it performs no action yet.

## Related

*Status: `change_password` is planned, not built yet.*

- [`request_access`](/docs/intents/request_access): asks the person for a grant on one credential, with the intents, scope, lifetime and a one-line reason.
- [`change_password`](/docs/intents/change_password) (planned, not built yet): is planned, not built yet.
- [Intent catalog](/docs/intents), [MCP server](/docs/mcp-server), [Grants and approvals](/docs/grants-and-approvals)
