Can admins lock OpenCode settings on staff machines?
Platform and security leads deciding whether staff can run OpenCode with fixed provider, MCP and tool rules can answer the first question yes: OpenCode supports admin-enforced settings through a system config file and, on macOS, through MDM. The Enterprise docs describe this mechanism, and the policy feature set sits with the paid Enterprise plan as described on the OpenCode Enterprise page. This section covers how the policy file is placed on each operating system and how it outranks user and project configuration, with the detailed restriction options covered in the sibling sections on providers, tools and MCP servers.
This page covers the admin-controlled settings path: where the managed file lives, how MDM delivers managed preferences, and what the policy can restrict. It does not cover the plan terms, identity setup or data handling, which have their own sections. Its most important limit is that policies shape what the agent is configured to do, not what it can physically reach. The OpenCode project states in its SECURITY.md that it does not sandbox the agent and that permission prompts are not a security boundary. A locked configuration therefore reduces accidental or policy-violating use, but it does not contain a compromised or manipulated agent. Plan controls such as network egress limits, file access restrictions and host isolation need to come from your own environment.
Before approval, confirm three things with the vendor and in your own test environment: that your Enterprise contract includes the managed settings feature, that your fleet runs client versions that honor the policy statements you intend to use (the docs name version 2.2.3 for integration, MCP, skill and plugin statements and 2.2.6 for web search, with older clients ignoring them), and that a test machine with a deliberately denied provider or blocked tool call actually fails as the policy says. Treat a silently ignored policy as a gap, not a control.
Which admin controls are built in, paid or outside the tool
This table compares each OpenCode admin control against the plan or client version that carries it, whether OpenCode documents it as built in, and what your organization must supply around it. Check the plan and client version before you rely on any control, because some statements are ignored by older clients. The main takeaway is that file and MDM enforcement depend on your own device management and upgrade process.
| Capability | Edition or plan | Built in | Outside component needed |
|---|---|---|---|
| System config file policy on macOS, Linux and Windows | Confirm with OpenCode which plan carries file-based policies | Yes, the policy file outranks user and project configuration | Admin-controlled file placement and file permissions on each staff machine |
| macOS MDM managed preferences for ai.opencode.managed | Confirm with OpenCode which plan carries MDM-delivered policies | Yes, documented for macOS deployment | MDM platform that pushes and enforces the managed preferences |
| Deny all providers and allow one approved gateway | Policies for providers, per the OpenCode Enterprise page | Yes, a denied provider is removed even if the user has credentials | An approved gateway, such as an internal OpenAI-compatible endpoint, that you operate |
| Allow only approved MCP servers | Confirm plan with OpenCode | Yes, integration and MCP statements need client 2.2.3 or later | A reviewed inventory of approved MCP servers and an owner for each |
| Block specific tool calls, such as shell:git push | Confirm plan with OpenCode | Yes, blocked calls fail with Blocked by configuration policy | A list of blocked calls agreed by security and engineering leads |
| Integration, MCP, skill and plugin statements | Client version 2.2.3 or later | Yes, older clients ignore these statements | A client upgrade process that covers every machine before you rely on the statements |
| Web search statements | Client version 2.2.6 or later | Yes, older clients ignore these statements | A client upgrade check and a decision on which staff may use web search |
| Central workspace policies for members | OpenCode Enterprise, per the Enterprise page | Yes, applied to the whole workspace or chosen members | An Enterprise agreement and named workspace administrators |
How the system config file outranks user and project settings
The managed file is the enforcement point for OpenCode policy. Admins place the policy in a system config file at /Library/Application Support/opencode/opencode.json on macOS, /etc/opencode/opencode.json on Linux or %ProgramData%\opencode\opencode.json on Windows, and according to the OpenCode enterprise docs this file outranks user and project configuration. In practice, a developer's personal config or a repository's opencode.json cannot re-enable a provider that the managed file denies. Before rollout, confirm with your own test machines that a project-level config committed to a repository cannot override the managed file, because that is the control most reviewers will ask about first.
On macOS, the same policy can be delivered through MDM as managed preferences for the ai.opencode.managed domain, so the mobile device management profile your team already uses can carry the settings to staff laptops. Pair the deployment with a check that the file is present and unmodified on each endpoint, since a policy that only exists on some machines gives no assurance. Provider denial is the strongest of these controls: a denied provider is removed even when the user already holds credentials for it, so stored keys for an unapproved service stop being usable through OpenCode. Blocked tool calls fail with the message Blocked by configuration policy, which gives the user a clear signal and gives your help desk a recognizable string to search logs for.
Newer policy statements depend on the client version. According to the OpenCode enterprise docs, integration and MCP, skill and plugin policy statements require client version 2.2.3, and web search statements require 2.2.6. Older clients ignore those statements without raising an error, so a policy can look enforced in the file while doing nothing on an outdated install. Ask the vendor or your own inventory to confirm the installed client version on every managed machine, and add a version check to your rollout gate before you rely on MCP or web search restrictions.
Decisions to make before writing the policy file
Each decision below changes what the policy file in opencode.json allows on a staff machine. Settle them together before deployment, because the provider list, the MCP allowlist and the blocked tool calls all depend on the same answer: which models and tools the organization has approved for its code.
Approved providers and gateway
Decide whether staff may reach only an internal OpenAI-compatible gateway or also the public OpenCode Console or Go models. Denying all providers and allowing one approved gateway keeps code and prompts on paths your team operates. A denied provider is removed even when a user already holds credentials for it, so check that the gateway URL and model names match what staff will actually select. Confirm with your gateway owner which logs and retention rules apply on that side.
Enterprise docsFree tier access
Decide whether free models are reachable from managed machines. Free access from a personal account sits outside your contract, so the data terms that apply to paid Console or Go traffic may not cover it. Blocking the free tier through policy keeps usage on approved accounts, but it also removes a route that some staff use for experiments. Check the current data terms for each free model before deciding, because they differ by model.
MCP server allowlist and owner
Define the list of MCP servers that OpenCode may connect to, then name one team that owns additions and removals. Policy can allow only approved servers, so every new server becomes a change request rather than a local install. Record for each server what data it can reach and which credentials it uses. Without a named owner, the list tends to drift as developers test new tools.
Blocked tool call patterns
Choose which tool calls to block by pattern, such as shell:git push for commands that publish code or change shared state. A blocked call fails with the message Blocked by configuration policy, so developers need a documented path to request an exception. Write patterns for the commands your engineers run most, then test them on a staging machine. Remember that permission prompts are not a security boundary, so these rules narrow the risk but do not replace sandboxing.
File or MDM distribution per OS
Choose how the policy reaches each operating system. On Linux the file is /etc/opencode/opencode.json, on Windows it is %ProgramData%\opencode\opencode.json, and on macOS it is /Library/Application Support/opencode/opencode.json, or a managed preference profile for the ai.opencode.managed domain. An MDM profile can be harder for a user to remove, while a file managed by a software tool is simpler to audit. Confirm which mechanism your device management platform can enforce and report on.
Client version floor
Set the minimum OpenCode client version that every managed machine must run. Integration, MCP, skill and plugin statements need version 2.2.3, and web search statements need 2.2.6. Older clients ignore these statements, so a machine on an old build can run tools your policy meant to block. Add a version check to your device inventory, and do not treat the policy as active on a machine until that check passes.
How the policy design changes by fleet and data sensitivity
When every engineer works on company-issued macOS laptops enrolled in one MDM tool, the policy design is the simplest. The admin can publish the policy as managed preferences for the ai.opencode.managed domain, which the enterprise docs describe as the MDM route for macOS, and rely on the device's enrollment state to deliver it. The main work is confirming that the profile reaches every laptop and that the policy is versioned with the rest of the endpoint configuration.
- Profile delivery: Scope the managed preferences to the enrolled device group, not to individual user accounts, so a staff member cannot skip it by switching accounts.
- Provider lockdown: Deny all providers and allow only the approved internal gateway, because a denied provider is removed even when a user holds credentials for it.
- Tool and MCP limits: Allow only the approved MCP servers and block high-impact calls such as
shell:git push, which fail with a Blocked by configuration policy message. - Client version floor: Confirm that every laptop runs a client version that honors the newer statements, since older clients ignore integration, MCP, skill and plugin policy.
- Change control: Treat the profile as a managed configuration item with an owner and a review date.
Before rollout, check the MDM console on a sample laptop to confirm the policy is present and enforced.
A mixed fleet cannot rely on one delivery channel. The enterprise docs place the system config file at /Library/Application Support/opencode/opencode.json on macOS, /etc/opencode/opencode.json on Linux and %ProgramData%\opencode\opencode.json on Windows. Those files outrank user and project configuration, so the same policy content can be distributed through each operating system's existing software deployment tooling. The design task is keeping the three copies identical and detecting drift.
- One source of truth: Keep a single policy document in version control and generate the three platform files from it, rather than editing each file by hand.
- Platform-specific delivery: Use MDM for macOS, and use the configuration management or endpoint tool already in place for Linux and Windows to write the files.
- Permissions on the file: Confirm that standard users cannot modify the system file, since the policy is only meaningful if the user cannot overwrite it.
- Drift checks: Run a scheduled comparison that reports machines where the file is missing, outdated or edited.
- Version parity: Test the client version on each operating system, because a Linux or Windows machine that lags behind the macOS fleet may ignore newer statements.
Confirm with your endpoint team that the file-based route is covered by an existing enforcement and reporting process for each operating system.
Where source code or records fall under a regulatory regime, the policy goal is narrower: every model request should pass through an internal gateway that the organization controls and logs. The provider rules are the main control. The admin denies all providers and allows only an approved OpenAI-compatible gateway, so staff cannot send prompts to a public model even if they hold personal credentials. Model access is then governed by the gateway, not by the desktop client.
- Deny by default: Deny all providers, then allow only the internal gateway, and test that a direct call to a public provider fails.
- Gateway ownership: Confirm who operates the gateway, where it logs requests and how long those logs are kept, since those answers now sit with your organization.
- Tool restrictions: Block shell and push operations that could move regulated code outside the approved repositories, and restrict MCP servers to those that read from approved systems.
- Web search: Review whether web search statements are needed, because they require client version 2.2.6 and widen the data that leaves the environment.
- Evidence: Keep the policy file, the gateway configuration and test results together as readiness evidence for your assessor.
Ask your compliance lead which controls the assessor will expect, and confirm the data path with the gateway operator before approving use.
A managed file on a company laptop is no protection on a contractor's machine or a personal device. The system config file exists only where someone installed it, so the admin cannot assume the policy is present. The safer design starts from the question of which machines can reach internal code and data at all, and treats any unmanaged machine as one where the policy is absent until proven otherwise. The OpenCode project states that its permission prompts are not a security boundary, so policy on the device is not a substitute for access control at the source.
- Access before policy: Restrict repository, database and gateway access by identity, so an unmanaged machine cannot reach regulated systems regardless of local settings.
- Managed-only access paths: Require a managed device, a managed virtual workspace or a controlled gateway for contractor work involving sensitive data.
- Identity-based controls: Where the organization runs Enterprise with SSO, use identity assignment to decide who may use the tool and where the policy applies, and confirm the scope with the vendor.
- Unmanaged detection: Monitor for OpenCode installs on endpoints that are not enrolled, using whatever inventory tooling already exists.
- Contract terms: Put the acceptable-use and device requirements in the contractor agreement.
Confirm with procurement and the vendor what a policy can and cannot enforce when the client is installed outside your management tooling.
Order of work to enforce OpenCode policy in production
This sequence moves OpenCode policy from a contract conversation to enforced settings on staff machines, with a recorded check at each stage so the security team can show what is in force and on which clients. Each step produces evidence that the next step depends on.
Confirm Enterprise scope in writing
Before any configuration work, ask the vendor in writing which plan includes the policy feature set you need: providers, tools, integrations, MCP servers, skills and plugins, applied to the whole workspace or to chosen members. OpenCode Enterprise is the plan the Enterprise page associates with policies, and Go or Console access alone should not be assumed to carry them. Ask for the answer in the order form or a written scope note. Done means a document names the plan, the policy features, and the workspace the policies apply to.
Inventory clients and set version floors
Ask engineering to list every installed OpenCode client across laptops, build agents and desktop installs, including the install method used, since the project lists several (curl script, npm, bun, pnpm, yarn, Homebrew, Arch Linux packages, mise, Nix and a beta desktop app). Record each version. The enterprise docs state that integration, MCP, skill and plugin statements need client version 2.2.3 and web search statements need 2.2.6, and older clients ignore them. Set 2.2.6 as the floor if you rely on web search rules, and block rollout to any machine below the relevant floor. Done means an inventory sheet with a pass or fail per machine against those floors.
Agree provider, MCP and tool-call lists with owners
Name an owner for each list before writing the file. Security typically owns the denied tool calls, platform engineering owns the approved provider and MCP servers, and a named business owner signs off on the free tier decision. For providers, confirm the internal OpenAI-compatible gateway or other approved endpoint, since the docs describe denying all providers and allowing only the approved one. For tool calls, record exact patterns such as shell:git push, as the docs give them. Done means a signed list with an owner, a reason and a review date for each entry.
Stage the policy file on a pilot group per OS
Write the policy file and place it at the system path for each operating system: /Library/Application Support/opencode/opencode.json on macOS, /etc/opencode/opencode.json on Linux, or %ProgramData%\opencode\opencode.json on Windows. The docs state this file outranks user and project configuration. Deploy to a small pilot group on each OS in use, using your normal software distribution tool for Linux and Windows. Confirm on a pilot machine that the file is read and that a user setting cannot override it. Done means a pilot checklist per OS showing the file present, the path correct, and the override test passed.
Deliver the macOS MDM profile
For macOS fleets, deliver the policy as managed preferences for the ai.opencode.managed domain through your MDM, so the settings are enforced by the device management layer rather than by a file a user could replace. Work with the MDM administrator to confirm the profile scope, the target device groups, and the install status reported by the MDM console. Keep the file-based path for machines that the MDM does not cover, and record which method each machine uses. Done means an MDM report showing the profile installed on the intended devices and a list of exceptions.
Test denied providers and blocked tool calls
Run a controlled test with a pilot user who holds valid credentials for a denied provider. Confirm that the denied provider is absent from the model list, even though the user has credentials for it, as the docs describe. Then ask the same user to run a command matching a blocked tool call such as shell:git push and confirm it fails with the message Blocked by configuration policy. Repeat the test for one MCP server that is not on the approved list. Record the session output. Done means a test record for each rule, signed by the reviewer, that shows the expected failure.
Monitor drift and client version rollout
Set a recurring check, owned by IT operations, that compares installed policy files and MDM profile status against the approved version of the policy, and reports any machine that is missing the file, has an older client, or has a modified policy. Track progress toward the 2.2.3 and 2.2.6 floors and re-run the blocked-call test after each policy change or client upgrade. Ask the vendor how policy changes reach existing workspaces and whether the admin console records who changed a policy. Done means a dashboard or report that shows current drift and a dated log of each policy revision.
How managed policy outranks user and project config
The diagram starts with the managed layer, which an admin writes to a system config file or deploys through MDM as managed preferences for the ai.opencode.managed domain. That layer sits above user and project configuration, so the client resolves providers, MCP servers and tool calls against it first. A denied provider is removed even when a user holds credentials for it, and a blocked tool call fails with the message Blocked by configuration policy. Check that your fleet actually receives the managed file and that your client version supports each policy type you rely on.
Managed policy sits above user and project settings and filters what the client may use.
What a security reviewer asks to see for admin policy
This table lists the artifacts a security reviewer should request when approving OpenCode managed settings, with what each artifact should show and where it comes from. Read each row as a request to the admin team, then check the produced evidence against the policy the organization intended to enforce. The main takeaway is that a managed file alone proves little until the deployed copy, the MDM profile and the client versions in use all match it.
| Reviewer request | What to produce | Where it comes from in OpenCode |
|---|---|---|
| Deployed managed file per OS | Copy of the live opencode.json from each OS path, with hash or modification record and the owning account | System config at /Library/Application Support/opencode/opencode.json on macOS, /etc/opencode/opencode.json on Linux, or %ProgramData%\opencode\opencode.json on Windows |
| MDM profile for ai.opencode.managed | Exported profile showing the managed preferences payload, target device groups and deployment status | Managed preferences for the ai.opencode.managed domain on macOS, deployed through MDM |
| Provider allowlist | Written list of approved providers, such as an internal OpenAI-compatible gateway, plus the deny-all setting that blocks the rest | Provider rules in the managed file; a denied provider is removed even if a user holds credentials for it |
| MCP allowlist | Named list of approved MCP servers with owner and review date, and proof that unlisted servers are blocked | MCP server rules in the managed file, applied with integration, skill and plugin policy statements |
| Blocked tool-call list | Specific blocked calls, such as shell:git push, with a test run showing the call fails with Blocked by configuration policy | Tool-call block rules in the managed file |
| Client version inventory against 2.2.3 and 2.2.6 | Device report listing OpenCode client versions, flagging any below 2.2.3 for integration and MCP rules or below 2.2.6 for web search rules | Client version reported by each managed device; older clients ignore the policy statements |
| Enterprise contract statement on policy scope | Signed or quoted contract language confirming that policies apply to the whole workspace or to chosen members | Enterprise plan terms on the OpenCode Enterprise page, which list providers, tools, integrations, MCP servers, skills and plugins as policy-controlled |
Questions buyers ask before approving OpenCode policy controls
How much does OpenCode Enterprise cost for managed policies?
OpenCode Enterprise is priced through a quote, so the public pages do not give a figure that applies to your organization. The Enterprise page lists SSO, SCIM, budgets and policies as included features, but cost depends on the seats you need, whether policies cover the whole workspace or chosen members, and which support terms you request. Model usage is a separate cost. The Console is pay-as-you-go, and the Console docs describe a processing fee of 4.6% plus $0.31 on each credit purchase. Ask for a written quote that separates one-time setup from recurring seat fees, states the term, names who bills for model usage, and lists which client versions and support levels are covered. Compare that quote with the internal effort to deploy and maintain the policy file.
Can OpenCode policies be enforced without MDM?
Yes, but only if your endpoint tooling can place the policy file at the system path and stop standard users from changing it. The enterprise docs describe MDM deployment as managed preferences for the ai.opencode.managed domain on macOS. Elsewhere the policy is a system file: /etc/opencode/opencode.json on Linux and %ProgramData%\opencode\opencode.json on Windows. Policies outrank user and project configuration, so a developer's own settings cannot override them. The key question is write access. If a standard user can edit or delete the file, the control is weak. Confirm with your endpoint management vendor how to deploy and lock these paths, then test that a local change is ignored after a restart.
Can our own team write the OpenCode policy file?
Yes, a platform or security team can write it, because the policy is a JSON file with documented sections for providers, MCP servers, tool calls and integrations. The harder part is confirming the exact keys and their effect in your environment against the docs for your client version. Start from an allowlist: deny all providers, then allow only your approved gateway. Add MCP servers and tool blocks next. Test each rule on a clean machine, including the message users see when a call fails with Blocked by configuration policy. Keep the file in version control, review changes like code, and record which client version you tested. If you want outside help, DeployOpen plans and implements these controls under a fixed-scope agreement with written deliverables. That work covers your policy and evidence, and it does not guarantee how OpenCode behaves in your fleet.
How long does an OpenCode policy rollout take?
No public duration applies to every organization, so the timeline depends on scope you can measure in your own environment. The main drivers are the number of machines and operating systems, whether macOS can use MDM managed preferences while Linux and Windows need a separate file deployment, and how many providers, MCP servers and tool rules you must define. Approvals from security, legal and procurement often take longer than the technical work. Client version also adds work. Integration, MCP, skill and plugin statements require client version 2.2.3, and web search statements require 2.2.6, so an inventory of current builds may come first. Ask any implementation partner for a written scope with deliverables and dates agreed before work starts.
Do OpenCode policies stop a malicious prompt?
No, policies limit which providers, tools and servers the agent can use, but they do not stop a malicious prompt from acting within the rules you allow. The OpenCode SECURITY.md states that the project does not sandbox the agent and that permission prompts are not a security boundary. A blocked call such as shell:git push fails with a configuration message, which helps, but it covers only the rules you wrote. Any action you allow stays reachable through injected instructions in files, web pages or MCP responses. Treat policy as one layer. Restrict providers and MCP servers to approved ones, block high-impact commands, and run the agent under operating system isolation with least-privilege credentials and monitored network egress. Verify each layer with your own adversarial testing.
What happens to users on old OpenCode clients?
Older clients ignore some policy statements, so those controls do not apply to them. The enterprise docs say integration, MCP, skill and plugin policy statements require client version 2.2.3, and web search statements require 2.2.6. A developer on an older build could therefore reach an MCP server or web search that you meant to block, even though the same file still applies its provider and tool rules. Before rollout, inventory client versions across the fleet and set a minimum version through your deployment tooling where that is possible. Then test an older build against your policy file and record the result. Confirm with OpenCode how older clients treat the rest of the file, because the docs you have do not settle that point.
Does DeployOpen resell OpenCode Enterprise?
No, DeployOpen does not resell OpenCode, and it is not an official partner, reseller or certified provider of OpenCode or its maker. DeployOpen is a Chainscore Labs company that plans, implements, hardens and documents self-hosted open-source platforms inside a client's own infrastructure, and it runs security testing, including testing of AI systems and agents. For OpenCode, DeployOpen can help define and implement policy controls, test them and prepare evidence for your review, under a written, fixed-scope agreement. Buy Enterprise access through OpenCode's own process. Before signing, confirm which party invoices you, who supports the policy file, and what the contract says about model data handling.
Where to check each claim in the official sources
Before approving any policy file, check the mechanics in the OpenCode enterprise docs rather than relying on summaries. The docs state where the managed file lives: /Library/Application Support/opencode/opencode.json on macOS, /etc/opencode/opencode.json on Linux, and %ProgramData%\opencode\opencode.json on Windows. They also state that this system file outranks user and project configuration, which is the property your security team needs to confirm on a test machine. On macOS, the same page describes deploying policy through MDM as managed preferences for the ai.opencode.managed domain. Ask your MDM team to confirm that profile delivery and file placement match the docs for each OS version in your fleet. The same page covers the provider and MCP rules, including how a denied provider is removed even when a user holds credentials for it, and the client version floors: integration, MCP, skill and plugin statements need client 2.2.3, and web search statements need 2.2.6. Older clients ignore those statements, so pin a minimum version and verify it on each device.
The OpenCode Enterprise page describes the scope of policy: it controls which providers, tools, integrations, MCP servers, skills and plugins OpenCode can use, and it can apply to the whole workspace or to chosen members. Use that scope statement to decide whether you need a workspace-wide baseline, a narrower group policy, or both, and confirm with the vendor how workspace policy and the local system file interact in your setup. Plan terms, including which features and seat counts your organization receives, are set in the quote rather than on the public pages, so request the policy capabilities in writing as part of the Enterprise scope. Treat the file-based policy as a control on honest configuration, not as a sandbox, since the project's own SECURITY.md says permission prompts are not a security boundary.
How DeployOpen tests and documents OpenCode policy rollouts
DeployOpen plans, implements and documents the managed settings for OpenCode that your organization approves, and tests them against the controls you need to enforce. Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
How we scope
- Confirm which OpenCode plan and client version your staff run, since integration, MCP, skill and plugin statements need a newer client than older versions read.
- List the providers you will allow, including any internal OpenAI-compatible gateway, and which providers must be denied for all users.
- Agree which MCP servers, tool calls and free-tier access are in or out, and who in your organization approves each policy change.
How we build
- Write the system configuration file for macOS, Linux and Windows, placed where it outranks user and project configuration on each platform.
- Prepare MDM profiles that deliver the managed preferences for the ai.opencode.managed domain on macOS, matched to the same policy file.
- Test that denied providers disappear even when a user holds credentials, and that blocked tool calls fail with the configuration policy message.
How we hand over
- Deliver the policy files, MDM profiles and a test record showing each restriction tested on a clean machine and on a managed staff device.
- Document the rollout runbook, the client version floor for each statement and the steps to change a policy without weakening it silently.
- Explain what policies do not cover, including that OpenCode states it does not sandbox the agent and that permission prompts are not a security boundary.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer, so policy files are rechecked when OpenCode releases change behavior.
- Re-test policies after client upgrades, so statements that older clients ignore are confirmed to be enforced on the versions you deploy.
- Your auditors or certification bodies issue any assessment results. DeployOpen prepares the controls and evidence for that review.

