Rotate Ans Identity
rotate_ans_identityEXPERIMENTAL. Issue a NEW identity certificate for a registered agent, keeping the same agent and the same version — so its ans:// name does not change.
Instructions
EXPERIMENTAL. Issue a NEW identity certificate for a registered agent, keeping the same agent and the same version — so its ans:// name does not change. Registering the same version again returns ANS_ALREADY_REGISTERED, so this is the way to change an agent's identity key without burning a version number. The usual reason: the agent was registered with an RSA key and now needs ECDSA P-256 so it can sign things with ES256. The user makes the new key and CSR themselves, exactly as for registration, so the private key never leaves them — NEVER ask for or accept a private key: openssl ecparam -name prime256v1 -genkey -noout -out identity.key then openssl req -new -key identity.key -out identity.csr -subj "/CN=<host>" -addext "subjectAltName=URI:ans://v<version>.<host>", where the URI SAN must be the agent's EXISTING ANS name (same version). The agent must be ACTIVE. IMPORTANT, and tell the user: the previous certificate stays valid until it expires and stays listed in the transparency log, so this is NOT a way to deal with a key that leaked — revoke the agent for that. It also means anything verifying a signature must check WHICH certificate signed it (the x5c in the signature), not merely that a certificate is listed. Use dry_run first to check the CSR without issuing anything.
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>",
"identity_csr_pem": "<identity_csr_pem>"
},
"name": "rotate_ans_identity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | Check the CSR and the agent without issuing a certificate. | |
| agent_id | Yes | The agentId from register_ans_agent or list_ans_agents. | |
| identity_csr_pem | Yes | PEM CSR for the NEW key, made by the user. URI SAN must equal the agent's existing ANS name. |