config: support a provider allowlist #1876

Closed
opened 2026-02-16 17:33:03 -05:00 by yindo · 11 comments
Owner

Originally created by @tsdevshop on GitHub (Sep 29, 2025).

Originally assigned to: @rekram1-node on GitHub.

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.

Originally created by @tsdevshop on GitHub (Sep 29, 2025). Originally assigned to: @rekram1-node on GitHub. 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.
yindo closed this issue 2026-02-16 17:33:03 -05:00
Author
Owner

@rekram1-node commented on GitHub (Sep 29, 2025):

@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": { ... }
  }
}
@rekram1-node commented on GitHub (Sep 29, 2025): @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": { ... } } } ```
Author
Owner

@tsdevshop commented on GitHub (Sep 30, 2025):

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.

@tsdevshop commented on GitHub (Sep 30, 2025): 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.
Author
Owner

@rekram1-node commented on GitHub (Sep 30, 2025):

got it

@rekram1-node commented on GitHub (Sep 30, 2025): got it
Author
Owner

@bogorad commented on GitHub (Oct 24, 2025):

possibly related: https://github.com/sst/opencode/issues/3417

@bogorad commented on GitHub (Oct 24, 2025): possibly related: https://github.com/sst/opencode/issues/3417
Author
Owner

@benceferdinandy-signifyd commented on GitHub (Nov 11, 2025):

We have similar concerns and blacklisting is an uphill battle.

@benceferdinandy-signifyd commented on GitHub (Nov 11, 2025): We have similar concerns and blacklisting is an uphill battle.
Author
Owner

@rekram1-node commented on GitHub (Nov 21, 2025):

added in next release https://github.com/sst/opencode/commit/fffe20cbe5e2b8a4e10ef3f1e2858f05a06b1246

@rekram1-node commented on GitHub (Nov 21, 2025): added in next release https://github.com/sst/opencode/commit/fffe20cbe5e2b8a4e10ef3f1e2858f05a06b1246
Author
Owner

@jayteaftw commented on GitHub (Dec 15, 2025):

@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?

@jayteaftw commented on GitHub (Dec 15, 2025): @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?
Author
Owner

@rekram1-node commented on GitHub (Dec 15, 2025):

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

@rekram1-node commented on GitHub (Dec 15, 2025): /oc use the docs agent to add section under the disabled-providers in config.mdx about allow list for providers
Author
Owner

@opencode-agent[bot] commented on GitHub (Dec 15, 2025):

Created PR #5586

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

@opencode-agent[bot] commented on GitHub (Dec 15, 2025): Created PR #5586 <a href="https://opencode.ai/s/n23Vx1xL"><img width="200" alt="New%20session%20-%202025-12-15T21%3A58%3A16.702Z" src="https://social-cards.sst.dev/opencode-share/TmV3IHNlc3Npb24gLSAyMDI1LTEyLTE1VDIxOjU4OjE2LjcwMlo=.png?model=opencode/claude-opus-4-5&version=1.0.158&id=n23Vx1xL" /></a> [opencode session](https://opencode.ai/s/n23Vx1xL)&nbsp;&nbsp;|&nbsp;&nbsp;[github run](/sst/opencode/actions/runs/20248790353)
Author
Owner

@rekram1-node commented on GitHub (Dec 15, 2025):

added @jayteaftw

@rekram1-node commented on GitHub (Dec 15, 2025): added @jayteaftw
Author
Owner

@jayteaftw commented on GitHub (Dec 15, 2025):

@rekram1-node that was cool! 😀

@jayteaftw commented on GitHub (Dec 15, 2025): @rekram1-node that was cool! :grinning:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1876