Adding or removing an SSH key needs more than an rw token (#14762)

An SSH key opens the whole terminal as its owner, and it stays after the token that added it expires or is revoked. A leaked rw token could once enroll a key of its own and keep that access for good. Now it cannot.

To add or remove a key over the API (POST /api/v1/user/keys, DELETE /api/v1/user/keys/:id), MCP's ssh_keys tool (add, remove) or the Settings › Keys form, you need one of these:

An rw or ro token gets 403 forbidden and nothing is stored or removed. Any token can still list your keys: GET /api/v1/user/keys, or ssh_keys with action: "list". In the terminal, the palette's SSH keys screen adds and removes keys as before: you get there with an SSH key, never a token.

Tests: test/keys-rw-token.test.ts (API and web form, with a fixed key, so it runs without ssh-keygen), test/mcp-ssh-keys.test.ts.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs