Skip to content

Stop mentioning API keys on the Account card; audit confirms BYOK is gone (T16) - #216

Merged
Programcode merged 3 commits into
mainfrom
fix/t16-hide-byok
Oct 23, 2026
Merged

Programcode merged 3 commits into
mainfrom
fix/t16-hide-byok

Conversation

@Programcode

Copy link
Copy Markdown
Owner

T16: users are no longer offered bring-your-own-key (BYOK). The audit found that the app already stopped offering it in January 2026. The one thing left was a line on the Settings Account card ("API keys are managed securely on the server."). This PR replaces that line in EN, HU and ES. No code, Edge Function or migration changes.

What changed

settings.accountDesc in src/locales/{en,hu,es}.json now describes what the Account card holds:

  • EN: "How you sign in, and a copy of everything you saved."
  • HU: "Hogyan jelentkezel be, és másolat minden mentett adatodról."
  • ES: "Cómo inicias sesión y una copia de todo lo guardado en tu cuenta."

SettingsPage.tsx is untouched, to stay clear of T6 (fix/t6-usage-pricing). T6 has no locale hunk within ten lines of this key.

Where BYOK stands

  • UI and copy. Nothing in settings, onboarding, model pickers, upsells, pricing, the landing page, guides, error messages, index.html or public/ offers or mentions user keys, in any of the three locales (including src/locales/tools/). A bad-key error from a provider shows "not configured correctly. Please inform the site admin." A paste-your-key form existed only in the pre-Supabase prototype, from 2026-01-23 (78931c85) to 2026-01-29 (86205bdc), and it kept keys in localStorage.
  • No legacy toggle. The app has no legacy or advanced setting. "Legacy" appears only as the legacy_free billing tier, so there was nothing to put BYOK behind.
  • Existing saved keys. No current code path reads a user's key, so nobody's setup can break:
    • public.api_keys: app code only ever deleted rows and never inserted any, and no Edge Function has ever read the table. This PR leaves the table, its rows, its RLS policy and its grants alone.
    • user_settings.feature_configs: normalizeFeatureConfig keeps only provider, model and reasoning effort, which is already the case on main.
    • localStorage debate-trainer-settings: the store still copies an old prototype apiKeys value through, and nothing reads it. This PR doesn't touch it, per "don't delete stored keys".
  • Edge Functions. Every provider key they use comes from the server environment (OPENROUTER_API_KEY, EXA_API_KEY, ELEVENLABS_API_KEY). The "BYOK" in _shared/cost.ts and _shared/provider-routing.ts is DebateLab's own Anthropic key attached to its OpenRouter account, not a user feature, so it stays. No functions to deploy.

Verification

All local; CI on this head is the separate signal.

  • npm run verify at a7132d0c: exit 0. Vitest 586/586 (81 files), collaboration 30/30, Deno 457 passed / 0 failed, Playwright desktop Chromium smoke 47/47.
  • verify-debatelab in fake mode, recipes/account.spec.ts and recipes/model-defaults.spec.ts: 8/8 on desktop-chromium and 8/8 on mobile-chromium. They cover Settings language sync, data export, account deletion and the model pickers.
  • Settings driven in the real app as a fresh demo user in EN, HU and ES. The page text has no "API key", "API-kulcs" or "claves API" in any locale.
  • An independent Claude (Opus) review found no Critical, High or Medium issues. Its Low (ambiguous HU wording) and Nit (ES tense) are fixed in the second commit.

Screenshots

Settings at 1280 and 375 px, from the pr-assets/t16-hide-byok branch (not for merge):

No other page changed.

Follow-ups (not in this PR)

  • public.api_keys is still writable by any signed-in user for their own rows (authenticated grants plus the api_keys_all policy), even though nothing reads it. The 2026-10-08 security report already proposes dropping it once production row counts are checked. A non-destructive first step is revoking client grants.
  • The Lock icon on the Account card suited the old key line better than it suits sign-in and data export. That's T6's file, so I left it.
  • .claude/skills/verify-debatelab/features/usage-limits.md:3 still says calls on our own key add only OpenRouter's fee. cost.ts and docs/architecture.md now count the full charge.

🤖 Generated with Claude Code

Programcode and others added 2 commits October 23, 2026 06:50
The Account card described itself as "API keys are managed securely on
the server", a leftover from the prototype that let users paste their own
provider keys. Nothing in the app offers that any more, so describe what
the card holds: how you sign in and a copy of your data. EN, HU and ES.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Hungarian line could be read as "a copy of your sign-in"; say how you
sign in and offer a copy of your saved data. The Spanish line now reuses
"lo guardado en tu cuenta" from the Your data row, which reads the same in
Spain and Latin America.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 23, 2026 07:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 91e1e85 and f9cbfcd.

📒 Files selected for processing: 3
  • src/locales/en.json
  • src/locales/es.json
  • src/locales/hu.json
+-----------------------------------------------+
| Get your code reviewed, or the bunny gets it. |
+-----------------------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

Comment @coderabbitai help to get the list of available commands.

@Programcode
Programcode merged commit ed6b1c5 into main Oct 23, 2026
2 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants