service: managed service keeps the auth password in plaintext in service.json - no passwordFile/env-only mode · Issue #57772 · anomalyco/opencode · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
service: managed service keeps the auth password in plaintext in service.json - no passwordFile/env-only mode #57772
The managed background service (opencode service) stores its auth password in plaintext inside service.json by design, and there is no passwordFile or env-only mode for the managed service — so the service credential cannot be kept out of a config file on disk. OPENCODE_SERVER_PASSWORD is documented for serve/web standalone mode but does not remove the plaintext from the managed service's private configuration.
Environment
opencode version: v2.0.32
OS: Windows_NT 10.0.26300 (win32 x64)
Terminal: Unavailable (headless/agent context; terminal variables not set)
Shell: cmd.exe (ComSpec), agents run under PowerShell 7
Install/channel: latest
Active plugins: -opencode.browser, openchamber-agent-tool
Reproduction
Set up the managed service and set its password: opencode service set password <secret>.
Inspect ~/.config/opencode/service.json.
The password field holds the secret in plaintext.
Expected Behavior
The managed service should support at least one of:
a passwordFile key in the service configuration, pointing at a separate (permission-restricted) file holding the secret, or
env-based resolution for the managed service (honoring OPENCODE_SERVER_PASSWORD in managed mode the way standalone serve does), or
a documented mode where service.json never contains the plaintext.
Actual Behavior
The plaintext password is stored inside service.json (documented as "the private service configuration"). There is no passwordFile/env-only mode for the managed service: setting the env var and a managed-service env block does not stop the plaintext from being written into the file by opencode service set password.
Additional Context
Workarounds we applied (all verified working, none removes the plaintext from the file):
rotated the password after a partial disclosure;
ACL-restricted service.json to the user account (NTFS);
stored the secret in a separate user-only-ACL file plus the user environment variable for defense in depth;
added the env var to the managed service's env block.
This is a hardening/feature request, not a security incident report: the request is a supported way to run the managed service without the plaintext password inside service.json.
Thanks for the detailed write-up. I think this is a duplicate of #52156. That issue asks for file-based password input (OPENCODE_PASSWORD_FILE) and also for opencode service set password_file, matching the service's existing password key. That is the passwordFile option you describe for the managed service.
Related issues, ordered from most to least likely to match:
For context: in v2 the managed service (serve --service) is designed to take its password from service.json. OPENCODE_PASSWORD/OPENCODE_SERVER_PASSWORD only apply to standalone servers, which is why setting them doesn't change what opencode service set password writes.
Please add your use case (Windows, NTFS ACLs, wanting no plaintext in service.json) to #52156. The bot will close this issue as a duplicate in 1 day unless you reply explaining how your request is different.
Activity
opencode-agent commentedon Oct 21, 2026
Thanks for the detailed write-up. I think this is a duplicate of #52156. That issue asks for file-based password input (
OPENCODE_PASSWORD_FILE) and also foropencode service set password_file, matching the service's existingpasswordkey. That is thepasswordFileoption you describe for the managed service.Related issues, ordered from most to least likely to match:
OPENCODE_PASSWORD_FILEand apassword_fileservice config key, so the managed service's password can live in a separate file instead of plaintext inservice.jsonservice.jsonand the auth scheme)For context: in v2 the managed service (
serve --service) is designed to take its password fromservice.json.OPENCODE_PASSWORD/OPENCODE_SERVER_PASSWORDonly apply to standalone servers, which is why setting them doesn't change whatopencode service set passwordwrites.Please add your use case (Windows, NTFS ACLs, wanting no plaintext in
service.json) to #52156. The bot will close this issue as a duplicate in 1 day unless you reply explaining how your request is different.