[PR #6441] feat(config): add managed settings support for enterprise deployments #11905

Closed
opened 2026-02-16 18:16:50 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6441

State: closed
Merged: Yes


Summary

This adds support for managed settings files that take precedence over all user settings, enabling enterprise administrators to enforce configurations that users cannot override easily

Closes #6358

Managed Settings Locations

Platform Path
macOS /Library/Application Support/opencode/opencode.json
Linux /etc/opencode/opencode.json
Windows %ProgramData%\opencode\opencode.json

Testing

First I generated some tests. I was using env var to inject managed config location. But I think it might compromise the settings. I'm open to suggestions on how to resolve this issue.

Then the manual testing was performed on macos via these commands:

Setup

sudo mkdir -p "/Library/Application Support/opencode/"
sudo bash -c 'cat > "/Library/Application Support/opencode/opencode.json" << EOF                  
{                                                                                                           
  "\$schema": "https://opencode.ai/config.json",
   "tools": {                                                                                                  
        "write": false,                                                                                           
        "bash": false,
        "edit": false
    }                                                                                                       
}                                                                                                         
EOF'

Check

this command should ask for permission when managed settings are present, or simply execute otherwise.

bun dev -p "write a joke to a file in current dir"

Cleanup

sudo rm "/Library/Application Support/opencode/opencode.json"
sudo rmdir "/Library/Application Support/opencode/"
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6441 **State:** closed **Merged:** Yes --- ## Summary This adds support for managed settings files that take precedence over all user settings, enabling enterprise administrators to enforce configurations that users cannot override easily Closes #6358 ## Managed Settings Locations | Platform | Path | |----------|------| | macOS | `/Library/Application Support/opencode/opencode.json` | | Linux | `/etc/opencode/opencode.json` | | Windows | `%ProgramData%\opencode\opencode.json` | ## Testing First I generated some tests. I was using env var to inject managed config location. But I think it might compromise the settings. I'm open to suggestions on how to resolve this issue. Then the manual testing was performed on macos via these commands: #### Setup ``` sudo mkdir -p "/Library/Application Support/opencode/" sudo bash -c 'cat > "/Library/Application Support/opencode/opencode.json" << EOF { "\$schema": "https://opencode.ai/config.json", "tools": { "write": false, "bash": false, "edit": false } } EOF' ``` #### Check this command should ask for permission when managed settings are present, or simply execute otherwise. ``` bun dev -p "write a joke to a file in current dir" ``` #### Cleanup ``` sudo rm "/Library/Application Support/opencode/opencode.json" sudo rmdir "/Library/Application Support/opencode/" ```
yindo added the pull-request label 2026-02-16 18:16:50 -05:00
yindo closed this issue 2026-02-16 18:16:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11905