Skip to content

bug: API Keys section in Settings has no way to remove saved keys #459

Closed

Description

@romainability

Summary

The API Keys section on the Settings page (Settings.vue:93-296) lets users save and test an Anthropic API Key and a GitHub PAT, but exposes no way to remove either once saved. The only way to delete a saved key today is to call the backend DELETE endpoint directly or edit the DB. Other Settings sections that store secrets/configuration may have the same gap.

Context

Backend DELETE endpoints already exist:

  • DELETE /api/settings/anthropic-api-key → src/backend/routers/settings.py:202 (db.delete_setting('anthropic_api_key'))
  • DELETE /api/settings/github-pat → src/backend/routers/settings.py:368 (db.delete_setting('github_pat'))
  • Generic DELETE /api/settings/{key} → settings.py:1315

The frontend simply never exposes them. In src/frontend/src/views/Settings.vue:93-296, the section renders only Test + Save buttons. There is no Delete/Clear/Remove control, even when the key is already configured (anthropicKeyStatus.configured === true / githubPatStatus.configured === true).

This is not the per-user MCP API Keys page (src/frontend/src/views/ApiKeys.vue) — that one does have revoke/delete (ApiKeys.vue:120, 126). The bug is specifically the platform settings "API Keys" section on /settings.

User impact:

  • Cannot rotate by deletion + re-add (must overwrite, which works for valid keys but doesn't help when the user wants to unconfigure the platform — e.g., move to per-agent subscription auth)
  • Cannot recover from "key saved but I want it gone" without DB access
  • Inconsistent with sibling sections (Subscriptions, Email Whitelist, GitHub Templates) which all expose Remove/Delete

The reporter also suspects similar gaps in other Settings sections — worth a sweep as part of this fix.

Reproduction

  1. Open /settings as an admin user
  2. Scroll to the API Keys section
  3. Save an Anthropic API Key (or GitHub PAT)
  4. Status shows "Configured" — but there is no button anywhere on the row to remove it

Acceptance Criteria

  • API Keys section: Anthropic API Key row shows a Remove/Clear button when anthropicKeyStatus.configured === true, wired to DELETE /api/settings/anthropic-api-key
  • API Keys section: GitHub PAT row shows a Remove/Clear button when githubPatStatus.configured === true, wired to DELETE /api/settings/github-pat
  • Confirmation dialog before deletion (consistent with revokeKey / deleteKey pattern in ApiKeys.vue)
  • After deletion, status returns to "Not configured" without a page reload
  • Audit other Settings sections (Settings.vue) for the same pattern — any section that lets you save a singleton config value but never lets you clear it. Candidates to review:
    • MCP Server URL (#1113) — copy says "Leave empty to auto-detect", which implies clearable; verify it actually is
    • Trinity Prompt (#872) — verify saving an empty value works
    • SSH Access (#1295)
    • Agent Quotas (#1335)
    • Slack Integration tokens (#318) if they're stored as secrets
  • Any other section with the same gap gets the same Remove treatment

Technical Notes

Files:

  • src/frontend/src/views/Settings.vue:93-296 — the API Keys section markup
  • src/backend/routers/settings.py:202, 368 — existing DELETE endpoints (no backend work needed for the two known cases)
  • src/frontend/src/views/ApiKeys.vue:120-126, 482-525 — reference pattern for confirm-then-delete UX

Suggested implementation: copy the confirm-dialog + fetch DELETE pattern from ApiKeys.vue::revokeKey / deleteKey. Add a third button Remove next to Test/Save in each row, conditionally rendered when the key is configured. Reset local state (anthropicKey = '', refresh anthropicKeyStatus) after successful DELETE.

Out of scope: the per-user MCP API Keys page (ApiKeys.vue) — that already has working revoke/delete.

Activity

  1. added
    status-in-progress
    on Apr 24, 2026
  2. self-assigned this
    on Apr 24, 2026
  3. added
    status-in-dev
    and removed
    status-in-progress
    on Apr 28, 2026
  4. added a commit that references this issue on May 4, 2026
  5. added
    complexity-low
    theme-ui-ux
    on Jun 3, 2026
  6. removed
    status-in-dev
    on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-lowpriority-p2theme-ui-uxtype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions