name: mike-azure-credential-boundary description: Preserve the organisation-wide external-provider credential model in MikeAzureDev and MikeOssAzure while retaining compatibility with upstream Mike's per-user BYO-key design. Use during upstream syncs, provider integrations, Key Vault or /install work, Settings/API-key changes, credential error handling, and reviews of userApiKeys, userSettings, LLM clients, CourtListener, or MCP connector scope.
Mike Azure Credential Boundary
Use this boundary before changing how an external service obtains credentials. It is an intentional Azure product divergence, not a general rule for upstream Mike.
Product boundary
- Original/upstream Mike is multi-user and multi-tenant. It may let each user supply personal provider keys.
- MikeAzureDev and MikeOssAzure represent one customer installation shared by
its users. External-provider credentials belong to the organisation and are
managed once through
/installand Azure Key Vault. - Users may choose enabled models and features. They must not read, create, replace, delete, or override organisation provider secrets.
- User-created MCP connectors remain per-user. Their OAuth tokens and credentials are not organisation provider keys.
Apply the organisation rule to Anthropic, Gemini, Kimi K3, Mistral AI, OpenAI, OpenRouter, CourtListener, and Azure OpenAI. Use these canonical Key Vault names:
| Provider | Required secret names |
|---|---|
| Anthropic | anthropic-api-key |
| Gemini | gemini-api-key |
| Kimi K3 | moonshot-api-key |
| Mistral AI | mistral-api-key |
| OpenAI | openai-api-key |
| OpenRouter | openrouter-api-key |
| CourtListener | courtlistener-api-token |
| Azure OpenAI | azure-openai-endpoint, azure-openai-api-key |
Implementation rules
- Resolve provider credentials server-side through the existing environment/Key Vault abstraction. Never send a secret value to the frontend.
- Keep Settings provider pages read-only. Show configured/not-configured
status, the canonical secret name, and one route to
/install. - Preserve compatibility fields in response shapes only when needed by an
upstream merge; return
nullfor credential values and expose booleans for availability. - Reject known-provider writes to legacy user routes with HTTP 403 and
code: "organisation_api_key_required". The detail must tell an administrator to use/installand name the exact secret. - Missing-credential failures in LLM and external-service clients must give the same administrator action. Do not tell ordinary users to paste a key.
- Retain the encrypted
user_api_keysmachinery while it helps upstream compatibility or rollback, but do not call it from Azure user-facing provider routes. Remove it only through an explicit migration decision. - Do not apply this rule to MCP connector credentials without a separate product decision.
Change workflow
When adding or syncing a provider:
- Classify the credential as organisation provider, per-user connector, or another explicitly documented scope.
- For organisation providers, update the
/installmanifest and Key Vault mapping first. - Update backend resolution, configured-status APIs, frontend status UI, and missing-credential errors as one coherent change.
- Record intentional divergence in backend/migrations/UPSTREAM_SYNC_LOG.md so a later upstream merge does not restore personal-key behavior.
- Update Marketplace upgrade/operator documentation when administrators gain a new required check or action.
Required verification
- Route test: personal provider PUT/PATCH attempts return the exact 403 code and administrator guidance.
- Resolution test: the provider client uses the organisation secret.
- Privacy test: profile and status responses never contain secret values.
- UI test: the settings page contains no provider-key inputs or save/remove
controls and links to
/install. - Error test: an absent credential names the correct Key Vault secret and
directs the administrator to
/install. - Run the affected backend and frontend suites, builds, and Marketplace packaging checks before release.