Skip to content

Conversation

@ibetitsmike
Copy link
Contributor

@ibetitsmike ibetitsmike commented Jan 26, 2026

Summary

  • Adds an opt-in, admin-controlled policy file (via MUX_POLICY_FILE) that is loaded at startup and refreshed every 15 minutes.
  • Enforces policy server-side for:
    • allowed providers + forced base URLs + allowed models (strict JSON allowlists)
    • MCP user-defined servers (stdio vs remote)
    • runtime allowlist (including ssh vs ssh+coder distinction)
    • minimum client version gating (blocks usage when below minimum_client_version)
  • Adds renderer PolicyContext + UI gating (hide/disable disallowed options; block actions rather than auto-switch).
  • Adds documentation page for policy file configuration.

Background

  • Mux deployments often need centrally managed constraints so users cannot enable unsupported providers/models/MCP servers/runtimes.

Implementation

  • PolicyService parses a strict JSON policy file (JSON.parse), validates it with zod, and publishes an effective (normalized) policy via ORPC.
  • Backend services (ProviderService / AIService / WorkspaceService / MCP server manager + MCP endpoints) enforce restrictions.
  • Frontend subscribes to policy changes and filters available UI choices; actions are blocked when current selections become disallowed.

Validation

  • make static-check
  • Added unit tests for policy parsing/version gating and UI helpers.

Risks

  • Policy files are a high-leverage admin control surface; strict schema validation + last-known-good refresh behavior reduce accidental unlocks.

Generated with mux • Model: openai:gpt-5.2 • Thinking: high • Cost: $20.21

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 774cd1446a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ibetitsmike
Copy link
Contributor Author

@codex review

Addressed the outstanding review threads:

  • Treat policy state blocked as deny-all for backend enforcement.
  • Apply runtime allowlist checks to workspace forks.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3efccb87d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +69 to 71
const selectableProviders = visibleProviders.filter(
(provider) => !HIDDEN_PROVIDERS.has(provider)
);

Choose a reason for hiding this comment

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

P2 Badge Filter settings model dropdowns by policy

Policy filtering is only applied to the provider list used for adding custom models here, but the default/compaction model selectors still use the unfiltered getSuggestedModels(config) list later in this component. When an admin policy restricts providers/models, users can still select disallowed models in Settings, and subsequent sends fail with policy_denied. Consider driving those dropdowns from the policy-filtered list (e.g., useModelsFromSettings().models) or filtering allModels against the effective policy.

Useful? React with 👍 / 👎.

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.

1 participant