Agent Key Rotation
Rotate the agent key when the private key may have leaked, during scheduled credential rotation, or when moving a customer to a new gateway process.
Steps
- Generate a new key pair.
./onprest-gateway create-agent-secret- Update gateway env.
GATEWAY_AGENT_PUBLIC_KEY=new-base64url-ed25519-public-key- Update agent YAML.
gateway:
agent_private_key: new-base64url-ed25519-private-key- Restart gateway.
- Restart agent.
- Confirm
/healthz,/openapi.json, REST, and MCP.
Expected Behavior
After rotation:
- Old private key connections are rejected.
- New private key connections pass Ed25519 verification.
- gateway fetches fresh OpenAPI metadata from the reconnected agent.
- Existing API key capability authorization remains independent from the agent key.
Compromise Response
If a suspicious agent is already connected, gateway’s one-agent connection limit prevents a second simultaneous agent from replacing it silently. Rotate the key and restart both sides to restore trust in the metadata source.