Skip to content

config: support a provider allowlist #2853

Closed

Description

@tsdevshop

Our use case involves a custom provider, and we'd like to lock down the TUI to just this provider.

Currently, since the provider config is a blocklist, we need to update the config every time the provider list changes. Instead, it would be nice to have an enabled_providers config array, which only enables the providers that are supplied.

In the case of a conflict between enabled and disabled, the disabled option would take priority, to support backwards compatibility.

If this is a desired feature, and not already on the backlog, I'd be happy to have a stab at contributing this.

Activity

  1. changed the title [-]provider allowlist[/-] [+]config: support a provider allowlist[/+] on Sep 29, 2025
  2. self-assigned this
    on Sep 29, 2025
  3. rekram1-node commented on Sep 29, 2025

    @rekram1-node
    Contributor

    @tsdevshop only 1 provider ships by default so if you disable opencode provider and only auth for your custom one(s) it would essentially be what you are asking for, right? (opencode should only be showing providers you are logged into aside from actual opencode provider). You can run opencode auth list to see all the providers you are logged into.

    ex:

    {
      "$schema": "https://opencode.ai/config.json",
      "disabled_providers": ["opencode"],
      "provider": {
        "my-custom-one": { ... }
      }
    }
    
  4. tsdevshop commented on Sep 30, 2025

    @tsdevshop
    Author

    I suppose, but there is nothing to stop consumers authing other providers, and these will then show up in the TUI as available. I'd like to prevent that scenario, if possible.

    A little background - we want all model interactions to go through our internal proxy, rather than directly accessing endpoints. Right now, we support this with a custom provider, and so we'd like to restrict the TUI to this provider only.

  5. rekram1-node commented on Sep 30, 2025

    @rekram1-node
    Contributor

    got it

  6. bogorad commented on Oct 24, 2025

    @bogorad

    possibly related: #3417

  7. benceferdinandy-signifyd commented on Nov 11, 2025

    @benceferdinandy-signifyd

    We have similar concerns and blacklisting is an uphill battle.

  8. rekram1-node commented on Nov 21, 2025

    @rekram1-node
    Contributor

    added in next release fffe20c

  9. jayteaftw commented on Dec 15, 2025

    @jayteaftw

    @rekram1-node Thank you for adding this! However this was hard to come by as I do not think it was ever added to the docs. Maybe it should be added after https://opencode.ai/docs/config/#disabled-providers?

  10. rekram1-node commented on Dec 15, 2025

    @rekram1-node
    Contributor

    /oc use the docs agent to add section under the disabled-providers in config.mdx about allow list for providers

  11. opencode-agent commented on Dec 15, 2025

    @opencode-agent
    Contributor

    Created PR #5586

    New%20session%20-%202025-12-15T21%3A58%3A16.702Z
    opencode session  |  github run

  12. rekram1-node commented on Dec 15, 2025

    @rekram1-node
    Contributor
  13. jayteaftw commented on Dec 15, 2025

    @jayteaftw

    @rekram1-node that was cool! 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions