fix(secrets): drop retired org-level guard from SetGlobal (global vendor keys are tenant-owned) #2002

Merged
hongming merged 1 commits from fix/setglobal-drop-retired-org-billing-guard into main 2026-05-29 04:38:15 +00:00
Owner

internal#718 retired the org-level billing rung; SetGlobal still gated global vendor-key writes on the legacy MOLECULE_LLM_BILLING_MODE env, blocking a byok tenant from storing its own MINIMAX_API_KEY at global scope. Removes the org-level guard (the provision-time provider-matched strip already enforces per-workspace usage); deletes dead org-env helpers; converts the obsolete rejection test to a positive allowed-path test. Build + full handlers tests green.

internal#718 retired the org-level billing rung; SetGlobal still gated global vendor-key writes on the legacy MOLECULE_LLM_BILLING_MODE env, blocking a byok tenant from storing its own MINIMAX_API_KEY at global scope. Removes the org-level guard (the provision-time provider-matched strip already enforces per-workspace usage); deletes dead org-env helpers; converts the obsolete rejection test to a positive allowed-path test. Build + full handlers tests green.
hongming added 1 commit 2026-05-29 04:26:29 +00:00
fix(secrets): drop retired org-level guard from SetGlobal — global vendor keys are tenant-owned
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 11s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 5s
CI / Python Lint & Test (pull_request) Successful in 7s
CI / Detect changes (pull_request) Successful in 7s
E2E API Smoke Test / detect-changes (pull_request) Successful in 7s
E2E Chat / detect-changes (pull_request) Successful in 8s
Harness Replays / detect-changes (pull_request) Successful in 7s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 8s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 7s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 11s
Lint no tenant GITEA or GITHUB token write / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 5s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 6s
qa-review / approved (pull_request) Failing after 15s
gate-check-v3 / gate-check (pull_request) Successful in 15s
security-review / approved (pull_request) Failing after 7s
sop-checklist / na-declarations (pull_request) N/A: (none)
verify-providers-gen / Regenerate providers artifact and fail on drift (pull_request) Successful in 31s
sop-checklist / all-items-acked (pull_request) Successful in 6s
sop-checklist / review-refire (pull_request) Has been skipped
sop-tier-check / tier-check (pull_request) Successful in 4s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m3s
CI / Canvas (Next.js) (pull_request) Successful in 6s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 4s
E2E Chat / E2E Chat (pull_request) Successful in 12s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m4s
Harness Replays / Harness Replays (pull_request) Successful in 15s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 6s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2m29s
CI / Platform (Go) (pull_request) Successful in 7m12s
CI / all-required (pull_request) Successful in 11m6s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
audit-force-merge / audit (pull_request) Successful in 4s
2cf7d006a9
internal#718 retired the org-level LLM billing rung (billing is resolved
per-workspace now). SetGlobal still called the legacy org-env guard
rejectPlatformManagedDirectLLMBypass, which reads MOLECULE_LLM_BILLING_MODE and
400s any vendor/oauth key write when the (legacy) org default is
platform_managed. That blocked setting a tenant's own MINIMAX_API_KEY (or any
custom-provider key) at global scope on a byok tenant — agents-team hit "direct
Hermes custom provider secrets are blocked for platform-managed LLM workspaces".

A global secret is the tenant's OWN shared credential. The provision-time
provider-matched strip (workspace_provision, core#2000) already removes any
global cred a given workspace's resolved provider does not accept, and the
platform-managed path strips bypass keys at provision too — so a platform-managed
workspace can never USE a non-matching global vendor/oauth key. The SetGlobal
org-env gate was redundant belt-and-suspenders keyed off the retired rung.

- SetGlobal: remove the org-level guard call.
- Delete the now-dead legacy helpers platformManagedLLMMode +
  rejectPlatformManagedDirectLLMBypass (org-env shims; the per-workspace
  successors rejectPlatformManagedDirectLLMBypassForWorkspace /
  platformManagedLLMModeForWorkspace remain and still gate per-workspace writes).
- Tests: convert the obsolete platform-managed rejection test into
  TestSetGlobal_AllowsTenantOwnedVendorKeyDespiteLegacyOrgEnv (asserts the global
  write SUCCEEDS even with the legacy env still set to platform_managed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
core-lead approved these changes 2026-05-29 04:26:56 +00:00
core-lead left a comment
Member

APPROVED — drops retired org-level SetGlobal guard; provision-time strip enforces per-workspace usage. Build + handler tests green.

APPROVED — drops retired org-level SetGlobal guard; provision-time strip enforces per-workspace usage. Build + handler tests green.
core-be approved these changes 2026-05-29 04:26:56 +00:00
core-be left a comment
Member

APPROVED — secrets-write boundary review: global = tenant-owned cred; per-workspace guard + strip remain. internal#718 aligned.

APPROVED — secrets-write boundary review: global = tenant-owned cred; per-workspace guard + strip remain. internal#718 aligned.
hongming merged commit 3f15c1448d into main 2026-05-29 04:38:15 +00:00
Sign in to join this conversation.
No Reviewers
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2002