Launch: Configure and verify workspace BYOK#92

openedOct 12, 2026bySScreen

Launch verification (2026-10-26)

Owner decision: Screen will perform Gemini live testing. The agent will make no further Gemini requests. The prior failed run stays recorded; owner testing has not yet been reported successful.

Added and deployed support for Gemini, OpenAI, OpenRouter and xAI/Grok. Owners can save/remove encrypted keys and choose provider/model IDs for default runs and retries. Queued runs keep their selected provider/model; missing selected-provider keys reject before quota. All four credential paths and both new adapters pass tests. A privately supplied Gemini key made one bounded production test with gemini-2.5-flash-lite; it failed with provider_error and consumed one Relay run. The key was removed and test Workspace AI disabled. A successful Gemini call is still unproven; OpenAI, OpenRouter and xAI live calls are untested. Keep open for provider verification and independent secure encryption-secret backup. No secret or private generated content is recorded here.


AI uses encrypted workspace-owned provider keys with no Relay provider-key fallback. Configure the deployment encryption secret and verify the customer setup flow before advertising AI as available.

Blocked by: #90, #91

Done when

  • Set AI_BYOK_ENCRYPTION_KEY in the intended Convex environment using a random 32-byte secret encoded as 64 hexadecimal characters.
  • Securely back up the encryption secret and document that replacing or losing it requires owners to re-enter keys.
  • A Workspace Owner can save, replace and remove Gemini, OpenAI, OpenRouter and xAI keys.
  • Editors, Viewers and unrelated accounts cannot manage keys, and public queries never expose key material.
  • With workspace consent enabled, verify one default run using a dedicated customer-owned Gemini key.
  • If better-model retries are offered, verify a retry with a dedicated customer-owned OpenAI key.
  • A missing selected-provider key rejects a new run before consuming quota; removing a key before execution prevents a provider call.
  • Confirm the UI explains provider billing and the existing monthly run limits.

Live provider verification must use approved test credentials and a bounded spending budget. Never put keys or the encryption secret in this issue, logs or screenshots.

References

convex/aiCredentials.ts, convex/aiGeneration.ts, src/features/settings/workspace-ai-settings.tsx, docs/architecture/ai-foundation.md

Main branch review (2026-10-19)

Reviewed 17cd594.

Status: BYOK implementation is complete; deployment setup and paid-provider verification remain. Owner key save/replace/removal, encrypted storage, restricted public projections, and worker key/consent rechecks exist in convex/aiCredentials.ts. convex/aiCredentials.test.ts covers ownership, encryption binding, replacement/removal, and queued-work revocation; convex/aiRuns.test.ts covers rejecting a missing key before quota is consumed. These tests are included in successful main CI run.

src/features/settings/workspace-ai-settings.tsx explains provider billing, encryption, consent, and monthly usage. Checked implementation items below refer to main and automated tests, not a verified production provider call.

Still required: set and securely back up the production encryption secret, then record a bounded Gemini run and any offered OpenAI retry with approved customer-owned test keys. No keys were read, changed, or used for paid calls during this review.


Mirrored issue: https://github.com/Zns-Nexus/Relay/issues/17