Does the OpenCode security model meet our review bar for server mode and the agent's tools?
Head of security or platform reviewers should start from a fact that shapes every other decision: the OpenCode security model does not provide a sandbox, and the project says its permission prompts are not a security boundary. The published OpenCode SECURITY.md treats the shell, file and web tools as the main risk surface. Server mode is off unless someone enables it, and when enabled, OPENCODE_SERVER_PASSWORD should be set to require HTTP Basic Auth, otherwise the server runs unauthenticated with a warning. None of the supplied sources says that an enterprise edition changes these facts, so confirm that in writing with the vendor before treating any paid plan as a control.
The decision in front of you is whether an agent with shell execution, file operations and web access can run on your hosts, and under which identity. Answer that for each host class separately: developer laptops, shared build hosts and any machine that holds credentials or production network paths. The project lists API access on a deliberately enabled server, sandbox escapes, external MCP server behavior and malicious config files as out of scope, so those risks land on you by default. Record which team owns the password for server mode, where it is stored and how it rotates.
Because the tool does not enforce its own boundary, the controls that matter must come from outside it. Plan for OS-level isolation such as separate user accounts, containers or virtual machines with restricted credentials, network egress limits, and repository protections that stop unreviewed config files from changing agent behavior. Permission rules are useful for reducing accidental commands, but the permissions documentation notes that commands the shell scanner cannot analyze, such as eval or malformed syntax, need approval as a whole command unless a deny rule applies. Test these controls against your own environment before approval, and treat any gap as a condition of use.
Security controls by OpenCode mode and edition
This table sets OpenCode's documented security controls against its open-source project and its Enterprise edition, and lists what your organization must supply. The supplied sources do not document a security control difference between editions, so read the Enterprise column as a prompt to confirm with the vendor, not as a finding. The main takeaway is that the project's own security policy treats the agent's shell, file and web access as the risk surface and does not treat permission prompts or server authentication as a sandbox.
| Control | Status in the open-source project | Enterprise edition status | What the organization must supply |
|---|---|---|---|
| Threat model | Describes OpenCode as a local AI coding assistant with shell execution, file operations and web access, and treats that power as the main risk surface | Sources do not document a difference. Confirm with the vendor | A written review of who runs the agent, on which machines, and with which credentials |
| Server mode | Off unless deliberately enabled | Sources do not document a difference. Confirm with the vendor | A policy stating whether server mode is permitted and on which hosts |
| HTTP Basic Auth via OPENCODE_SERVER_PASSWORD | Set this variable when server mode is enabled to require HTTP Basic Auth. If unset, the server runs unauthenticated with a warning | Sources do not document a difference. Confirm with the vendor | A managed secret for the password, a rule that it must be set, and a check that the server is not exposed beyond intended networks |
| Permission prompts | Approval prompts for commands and actions. The project states they are not a security boundary | Sources do not document a difference. Confirm with the vendor | Deny and ask rules you define, plus a clear statement to staff that prompts do not contain the agent |
| Shell command analysis | Commands the shell scanner cannot analyze, such as eval or malformed syntax, need approval as a whole command unless a shell deny rule applies | Sources do not document a difference. Confirm with the vendor | Shell deny rules for high-risk commands and testing of how the rules handle unparsed syntax |
| Sandboxing | The project states it does not sandbox the agent | Sources do not document a sandbox. Confirm with the vendor | An isolated runtime such as a dedicated VM or container with restricted credentials and network egress, managed by your team |
| Out of scope: API access on a deliberately enabled server, sandbox escapes, external MCP server behavior, malicious config files | Listed as out of scope in the project's security policy | Sources do not document a difference. Confirm with the vendor | Your own controls for these areas, including review of MCP servers and project config files before use |
What OpenCode's threat model names as the risk surface
OpenCode's own security policy names its shell execution, file operations and web access as the main risk surface. The project's SECURITY.md describes OpenCode as a local AI coding assistant with tools for running shell commands, reading and changing files, and reaching the web. The project treats the power of those tools, rather than any single flaw, as the central concern. For a reviewer, this means the question is not whether the agent can do damage on a developer's machine, but what the agent can reach from that machine and which of those reaches the organization is willing to accept. Read the full policy at the OpenCode SECURITY.md before the review meeting, since it sets the baseline for everything else in this assessment.
The same policy states that OpenCode does not sandbox the agent and that permission prompts are not a security boundary. A prompt that asks a developer to approve a command is a usability and hygiene control. It is not an isolation control, and the tool's own documentation does not present it as one. The residual risk therefore sits with the organization: any command the user approves, and any content the agent reads from a repository, web page or tool output, runs with the developer's own account permissions. Reviewers should confirm with their security team which accounts, credentials, network paths and production consoles are reachable from a developer workstation where OpenCode runs, and decide whether those exposures are acceptable without a sandbox. Where they are not, the controls must come from the environment, such as a separate virtual machine, restricted credentials or network egress limits, and the approval decision should record that choice explicitly.
Where trust boundaries sit in an OpenCode deployment
The diagram starts on the developer machine, where OpenCode runs with shell, file and web tools that the project calls its main risk surface. Two hand-offs matter most: the optional server mode, which is off by default and relies on OPENCODE_SERVER_PASSWORD for HTTP Basic Auth, and the connections to external MCP servers and config files. The dashed items are out of scope in the project's own security policy, so reviewers should treat them as their own controls to design. Check the permissions docs as well, because the project says prompt approvals are not a sandbox.
Trust boundaries and out-of-scope areas in a default OpenCode setup.
What the project puts out of scope and what that leaves to us
OpenCode's security policy places four areas outside what the project treats as its own security responsibility. Each one sits where the agent's reach meets a setting, input or network path that your organization controls, so each card names the control you must own.
API access on an enabled server
Server mode is off unless someone turns it on. The project places API access on a server that was deliberately enabled outside its scope, so exposure is treated as the operator's configuration choice. Set OPENCODE_SERVER_PASSWORD so HTTP Basic Auth protects the server, because without it the server runs unauthenticated and shows a warning. Your team owns the exposure: who holds the password, which networks can reach the listener, and whether any workstation or build host runs the server without a reviewed setting.
Sandbox escapes and permission prompts
OpenCode does not sandbox the agent, and its permission prompts are not a security boundary. Shell execution, file operations and web access run with the signed-in user's rights, so an escape from isolation is not a flaw the project accepts as its own. The permissions docs add that commands the shell scanner cannot analyze, such as eval or malformed syntax, need approval as a whole command unless a shell deny rule applies. Your team must supply isolation through a disposable container or VM, scoped credentials, and limited network egress.
Read the permissions docsExternal MCP server behavior
The project places the behavior of external MCP servers out of scope. Once an agent connects to a server your team did not write, that server's tool descriptions and returned content reach the model and can steer its next action. Keep an approved list of MCP servers, pin the versions you have reviewed, and read what each server exposes before enabling it. The client's permission rules and your review are the only checks you control, so record which servers each project uses so reviewers can trace where a tool came from.
Malicious config files
Project-level configuration can change how the agent behaves inside a repository. A cloned repository or a merged pull request can therefore carry settings that no developer reviewed. The project treats malicious config files as out of scope, which makes hostile configuration an intake problem for your organization. Review changes to agent config files the same way you review code, require approval for shared repositories, and use managed configuration on staff machines. Confirm with the vendor whether project files can override managed settings before you rely on them.
How the review changes by deployment situation
On a single developer laptop, the main risk surface is the agent's own power. OpenCode's SECURITY.md describes it as a local assistant with tools for shell execution, file operations and web access, and the project does not sandbox the agent. The reviewer's question is what the developer's account can reach, not whether the server is exposed.
- Shell and file access: The agent acts with the operating system permissions of the user who launched it, so it can read and change anything that user can.
- Permission prompts: The project states that permission prompts are not a security boundary, so an approval click should not be treated as a control.
- Unanalyzable commands: Per the permissions docs, commands the shell scanner cannot parse, such as eval or malformed syntax, need approval as a whole unless a shell deny rule applies.
- Server mode: Keep it off unless a developer deliberately enables it for a reason.
Before approval, confirm that the team's policy defines which repositories and credentials are reachable from these machines and that developers know server mode is off by default.
When a team runs OpenCode on a shared host and enables server mode, the server becomes a network-reachable entry point. The project's SECURITY.md says server mode is off unless enabled. When enabled, OPENCODE_SERVER_PASSWORD should be set to require HTTP Basic Auth. Otherwise the server runs unauthenticated and prints a warning. API access on a deliberately enabled server is out of scope for the project's security reports, so the team owns that exposure.
- Authentication: Require that
OPENCODE_SERVER_PASSWORDis set on every enabled server before anyone connects. - Network reach: Confirm which networks can reach the port, since the project does not treat API access on an enabled server as a vulnerability.
- Shared agent actions: Anyone who can call the API can direct the agent's shell and file tools on the host.
- Version currency: Check the published advisories and confirm the installed version is past any fix for the flaws listed there.
Before approval, ask the platform team to document the password handling, the listening address and the host account the agent runs under.
Connecting OpenCode to external MCP servers adds inputs and tools that the team did not write. The project lists external MCP server behavior among its out-of-scope items, so the reviewer cannot rely on the project to vet those servers. The agent may also act on instructions that arrive through tool results, which makes the connected servers part of the trust chain.
- Server provenance: Approve only named MCP servers from known owners, and record the version in use.
- Tool scope: Review which tools each server exposes, especially those that run commands, write files or make network calls.
- Malicious config files: The project also places malicious config files out of scope, so repository-level config should be reviewed before a developer opens an untrusted project.
- Permission rules: Use allow, ask and deny rules to narrow what connected tools may do, while remembering the prompts are not a boundary.
Before approval, ask for the list of MCP servers, their owners, and the credentials each one receives.
In regulated or air-gapped environments, the review must match what the project does and does not commit to. The security model places sandboxing and permission prompts outside the protection boundary, so network isolation and host controls around the tool carry the weight. The reviewer should confirm how the install is delivered, since the repository lists several package channels, and how updates reach an offline host.
- Isolation around the host: Define the containment the organization itself provides, such as segmented networks and restricted data stores, because the tool does not supply one.
- Outbound paths: Confirm which model endpoints and web access the agent can reach, and block what is not required.
- Update path: Plan how fixed versions from the advisories are verified and moved into the enclave.
- Enterprise terms: Ask the vendor in writing about the identity, management and data handling features of the plan being considered, and whether they are in scope for your framework.
Before approval, confirm which control owner accepts the residual risk for each item the project places out of scope.
Gaps a security team must cover outside OpenCode
OpenCode's own security policy places the main risk in the agent's shell, file and web powers, and it says permission prompts are not a security boundary. The cards below cover the gaps that the project leaves to the organization, so the controls around the tool need to be designed and owned by your team rather than assumed from the product.
No sandbox around the agent
OpenCode's SECURITY.md states that the project does not sandbox the agent. Commands run with the privileges of the user who started it, so reads of credentials, edits to files and outbound network calls are limited only by that user's access. Plan OS-level isolation such as a dedicated user account, a container or a virtual machine with limited mounts, and confirm with the vendor whether any sandbox feature is planned for your version.
Read the SECURITY.mdPermission prompts are not a boundary
Approval prompts reduce accidental actions but the project says they are not a security boundary. A user who approves a command, or a prompt that is skipped by configuration, gives the agent the same reach as the user. Treat prompts as a workflow aid, and enforce limits with network egress rules, file permissions and credential scoping that do not depend on the agent asking first.
Unanalyzable shell commands need whole-command approval
The permissions documentation says commands the shell scanner cannot analyze, such as eval or malformed syntax, require approval as a whole command unless a shell deny rule applies. Reviewers should confirm how the scanner treats wrapped, nested and piped commands, and whether approvals on a single command carry over to later calls. Pair deny rules with logging of executed commands at the host level.
Permissions docsUnauthenticated server when the password is unset
Server mode is off unless enabled. When it is enabled, the project says OPENCODE_SERVER_PASSWORD should be set to require HTTP Basic Auth, and without it the server runs unauthenticated with a warning. Make the variable a required part of any launch script, bind the listener to localhost or a private interface, and block the port at the host firewall. Confirm how the password is delivered and rotated in your environment.
MCP servers and config files stay out of scope
The project lists external MCP server behavior and malicious config files as out of scope, so a hostile or careless MCP server or project config is not a vendor-handled risk. Review MCP server sources before allowing them, restrict which servers a managed configuration permits, and scan repositories for changed config files before the agent opens them. Ask the vendor how config provenance is verified.
Vulnerability reporting has limits
The SECURITY.md routes reports through the GitHub private advisory tab and states that AI-generated security reports are not accepted. Your security team should therefore build its own intake path for findings, track upstream advisories and patch cadence, and confirm with the vendor the response expectations for your version. Internal testing of the deployment is still needed to validate the controls described here.
Order of review steps before approving OpenCode
This sequence lets a reviewer confirm how OpenCode will be installed and used, close the server mode and host exposure questions, and set the permission and supply chain controls before any staff member runs the agent. Each step ends with a written record the approver can file.
Confirm install method and scope of use
Record which install method the team will use, such as the curl install script, npm, bun, pnpm, yarn, Homebrew, Arch Linux packages, mise, Nix or the beta desktop app, and which machines and user groups will run it. The security engineer or platform owner should pin the approved method and version source so that every workstation gets the same build. The step is done when the approved install paths and the list of in-scope users are written down and signed off by the IT owner.
Verify server mode is off or password protected
Check that the server mode is disabled on every approved machine, since the project's security policy says it is off unless enabled. If the team needs server mode, confirm that OPENCODE_SERVER_PASSWORD is set so that HTTP Basic Auth applies, because without it the server runs unauthenticated and shows a warning. The reviewer should test this with a scan or a request from outside the approved host and file the result. Note that the project lists API access on a deliberately enabled server as out of scope, so the team owns that exposure.
Restrict server reachability to approved networks
Where server mode is enabled, confirm that the listening address and host firewall allow connections only from approved management or developer networks. The network or platform engineer should record the bind address, the firewall rule set and the list of allowed source ranges. The step is complete when a connection attempt from an unapproved network fails and that test is attached to the approval record.
Decide the isolation layer for the agent host
Because the project states that OpenCode does not sandbox the agent and that permission prompts are not a security boundary, the team must choose the boundary itself. Options to evaluate include a dedicated virtual machine, a container with restricted mounts and egress, or a non-privileged user account without access to production credentials. The security lead should document the chosen layer, which files, tokens and network destinations the agent can reach from it, and who approved the choice.
Review shell permission rules and unparsed commands
Review the allow, ask and deny rules that will apply to shell execution, file edits and web access. The permissions documentation says commands the shell scanner cannot analyze, such as eval or malformed syntax, require approval as a whole command unless a shell deny rule applies, so the reviewer should confirm which deny rules block those cases. Test a few commands the team considers high risk and record whether each one is blocked or prompted. The output is a rule file under version control with the test results attached.
Vet MCP servers and config file sources
Inventory every MCP server, plugin and project configuration file the agent may load, and identify who wrote or published each one. The project places external MCP server behavior and malicious config files outside its security scope, so the team must approve these sources itself and block repository-supplied configuration that has not been reviewed. The reviewer should record the approved list and confirm that new servers require a documented review before they are added.
Set a process for vulnerability reports and advisories
Assign an owner to monitor the OpenCode security advisories and to handle reports under the project's disclosure route, which is the GitHub security advisory Report a Vulnerability tab. The project does not accept AI-generated security reports, so the internal process should require a human-verified report before anything is filed upstream. The step is done when the owner, the watch source and the escalation path for a published advisory are recorded and the installed version is compared against the advisory list on a schedule the team sets.
Evidence a security reviewer should request
This table lists the evidence a reviewer should collect before approving OpenCode, what each item shows, and where it comes from. Items from the project's own documents show what OpenCode claims about its design, while the organization's network and host records show whether those claims hold in its environment. Treat the project documents as the baseline and the client records as the proof.
| Evidence item | What it shows | Where it comes from |
|---|---|---|
| SECURITY.md statement on sandboxing | The project states it does not sandbox the agent and that permission prompts are not a security boundary, so host isolation must come from elsewhere. | OpenCode SECURITY.md in the anomalyco/opencode repository |
| Server mode default and password setting | Server mode is off unless enabled, and an enabled server runs unauthenticated unless OPENCODE_SERVER_PASSWORD is set for HTTP Basic Auth. | OpenCode SECURITY.md, plus the configuration on each host where server mode is turned on |
| Out-of-scope list | The project excludes API access on a deliberately enabled server, sandbox escapes, external MCP server behavior and malicious config files from its security response, which shifts those risks to the adopter. | OpenCode SECURITY.md scope section |
| Permissions documentation on unparsed shell commands | Commands the shell scanner cannot analyze, such as eval or malformed syntax, require approval as a whole command unless a shell deny rule applies, so reviewers should test which patterns get through. | OpenCode permissions documentation |
| Organization's network and host configuration records | Whether server mode listens only on localhost, whether ports are reachable from other segments, which user account runs the agent, and whether managed configuration is deployed to each machine. | The client's own firewall rules, endpoint management records and host configuration exports |
| Advisory tracking record | The versions in use on each machine, the advisories published against those versions, and the date each fixed version was deployed, which shows whether the team keeps pace with fixes. | The client's software inventory, compared against the GitHub security advisories for the anomalyco/opencode repository |
Questions reviewers ask about OpenCode security before approval
Does OpenCode have a sandbox that limits what the agent can run?
No. The OpenCode project's security policy states that OpenCode does not sandbox the agent and that permission prompts are not a security boundary. The tool can use shell execution, file operations and web access, and the project treats that power as the main risk surface. Reviewers should therefore treat approval prompts as a usability control for the person at the keyboard, not as containment. Containment has to come from the environment: a dedicated, least-privileged user account, a container or virtual machine with restricted network egress, and no access to production credentials. Ask the engineering team to document where OpenCode runs and which secrets and repositories are reachable from that environment.
Is OpenCode server mode safe to run by default?
Server mode is off unless someone enables it. When it is enabled, the project recommends setting the OPENCODE_SERVER_PASSWORD environment variable so the server requires HTTP Basic Auth. If that variable is not set, the server runs unauthenticated and displays a warning. Reviewers should confirm that no approved workflow enables server mode without the password, that the server is bound only to addresses the team intends to reach, and that any network exposure passes through the organization's usual access controls. The project's policy also places API access on a deliberately enabled server outside its security scope, so the team owns that exposure and its monitoring.
Which risks does the OpenCode project put out of scope?
The security policy lists several categories it does not treat as vulnerabilities in the project itself. These include API access on a server that someone deliberately enabled, sandbox escapes (since the project does not claim a sandbox), behavior of external MCP servers, and malicious configuration files. Each of these needs a control owned by the adopting organization. For MCP servers, restrict which servers may be added and review their tool definitions. For configuration files, review repository-level settings before running the agent in an untrusted checkout, and control who can change shared config. Ask your procurement or security contact to record these as accepted, organization-owned risks in the approval memo.
How does the shell permission system handle commands it cannot parse?
According to the OpenCode permissions documentation, commands the shell scanner cannot analyze, such as those using eval or malformed syntax, require approval as a whole command unless a shell deny rule applies. This is a sensible fallback, but it depends on a person reading the command carefully before approving it. Reviewers should test this behavior in their own environment with a set of obfuscated and malformed commands, confirm which deny rules the team has configured, and decide whether any high-risk commands should be blocked outright rather than left to individual judgment.
Does an OpenCode Enterprise plan change the security model?
The Enterprise page describes SSO, SCIM, budgets and policies as added capabilities. Those features govern who can sign in, who is provisioned and how spending and configuration are managed. They do not change the core fact that the agent is not sandboxed and that permission prompts are not a security boundary. Before assuming any control reduces the risk surface, ask the vendor in writing which settings are enforced centrally, which apply only to managed machines, and how policy is applied to server mode and MCP configuration. Treat any Enterprise commitment that is not written into the contract or the product documentation as unconfirmed.
How do we report an OpenCode vulnerability, and why are AI-generated reports refused?
The OpenCode SECURITY.md file asks reporters to use the Report a Vulnerability tab in the anomalyco/opencode GitHub repository, which is a GitHub security advisory. The same file states that AI-generated security reports are not accepted. Your internal process should therefore require a human to verify any finding, reproduce it, and write the report in their own words before submission. Keep a record of who did that verification. Internal findings from your own testing should follow the same path, and your security team should decide whether to notify the project, your vendor contact or both.
What does outside help cost, and what drives that effort?
DeployOpen does not publish a price list. Scope, deliverables and timelines are agreed in writing before fixed-scope work starts, so a quote follows from that written scope. The effort depends mainly on how many environments OpenCode runs in, whether server mode is used, how many MCP servers and configuration sources are in play, what the sandbox and network design looks like, and how much existing evidence the team already has. Ongoing support, upgrades and continuous testing are offered as retainers. When requesting a quote, ask for the deliverables, the testing method, what the team must provide, and which items are one-time and which recur.
What can our own team do before asking for outside help?
Several steps are within reach of an internal security or platform team. First, write down where OpenCode will run and what it can reach, including repositories, credentials and network paths. Second, decide whether server mode is allowed and, if so, require the server password and restrict network binding. Third, set deny rules for commands your team considers unacceptable and test how unparsed commands behave. Fourth, decide which MCP servers and configuration files are allowed and who approves changes to them. Fifth, define how a suspected vulnerability is verified by a person and reported through the GitHub advisory process. Document each decision so an auditor or reviewer can trace it later.
Where to check each OpenCode security claim
Before approving OpenCode, read the project's own SECURITY.md file. It is the only place where the project states its threat model in one document: it describes OpenCode as a local assistant with shell execution, file operations and web access, names that power as the main risk surface, and lists which behaviors the project treats as out of scope. Compare each of those statements against the controls you plan to rely on. A claim that is out of scope for the project is a risk your team has to own, so write down every out-of-scope item that touches your environment, including server mode, sandbox escapes, external MCP server behavior and malicious config files.
Next, read the OpenCode permissions documentation alongside SECURITY.md. Pay particular attention to the handling of commands the shell scanner cannot analyze, such as eval or malformed syntax. Those commands are approved as a whole unless a shell deny rule applies, so confirm which deny rules your standard configuration sets before you test. Then run your own check of server mode on a test machine: confirm the server is off by default, and confirm OPENCODE_SERVER_PASSWORD is set before any enablement. Record the version you tested.
Both documents change over time, and the project may revise its wording, scope or defaults between your review and your rollout. Re-read the linked pages on the day of approval, note the date and version in your review record, and ask the vendor or the project to confirm any point your risk decision depends on in writing.
How DeployOpen works on OpenCode security model and server mode risks
DeployOpen plans, implements and hardens self-hosted open-source platforms inside the client's own infrastructure, and runs security testing that includes AI systems and agents. For OpenCode, we start from the project's own threat model, then test the deployment against the boundaries the project says it does not enforce.
How we scope
- Written scope defines which machines, networks and developer workflows the OpenCode review covers.
- We confirm whether any team plans to run server mode and who can reach it.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
How we build
- We review how server mode is enabled and whether OPENCODE_SERVER_PASSWORD is set on every instance.
- We test permission rules and shell behavior against commands the scanner cannot analyze.
- We check which MCP servers and config files a developer machine can load and how they are controlled.
How we hand over
- You receive documented findings, configuration baselines and the boundaries the project places out of scope.
- Each control is mapped to the risk it addresses, with the owner who must keep it in place.
- Handover covers the steps your team needs to repeat checks after OpenCode version changes.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer.
- Retainer work can track new OpenCode releases and published security advisories as they appear.
- Confirm with DeployOpen in the quote which support and retesting hours are included in your scope.

