
This post explains how Studio and OpenCode handle permissions; it is not an installation guide. If you are new to Studio, Chapter 06 of the platform guide covers starting a session, connecting and saving a snapshot. The screenshots show the Vietnamese interface; the same controls appear in the English interface.
A coding agent such as OpenCode can read a repository, edit files, run commands and check the result. To do that, it needs access to Git, sometimes the platform API and an LLM model. The usual approach is to put a token in an environment variable or a configuration file inside the container. That is convenient, but it leaves a long-lived token next to the agent: the token can be read, written to a log, copied into a repository, or used for something outside the intended task.
Studio handles this with a credential broker. The agent still has permission to work, but it does not hold the token. The token stays with the broker and is attached only when a service is called, within the permissions of that token.
Studio opens an interactive application on workspace compute and displays it in the browser. Data stays in the workspace bucket; the session exists only while the job runs. When the session ends, a snapshot can save the home directory back to the workspace so work can continue later.
The point for this post: Studio is not just a terminal. It is an environment where data, compute and access permissions sit in one place. The credential broker is the layer between the agent and external services.
The diagram below shows the permission flow inside a Studio session:
Figure 1 — The agent calls the broker inside the session; the broker attaches the credential when calling Git, Platform API or an LLM provider. The token does not enter the agent's environment.
How it works, at the level needed here:
.git-credentials, .netrc, .git/config or shell history.One detail can be confusing: in the check below, the agent calls the broker directly and receives HTTP 200 without carrying a credential. That does not mean the broker is publicly open. The broker listens only inside the session; the session boundary authenticates the request, and the token is attached when the broker reaches an external service.
OpenCode is a coding agent that runs in the Studio terminal. It can read files, search a codebase, edit code, run commands and inspect errors. In the screenshot below, the opencode tab is open in the terminal:
Figure 2 — OpenCode runs in the Studio terminal. The agent can read files and run commands; the token is not in its environment.
OpenCode is where you choose the provider and model. Configuration can live in opencode.json or be selected through OpenCode's model interface. On the managed Studio path, the provider credential is supplied by the broker; you do not paste the key into the chat, terminal or repository. The agent only sees the provider and model name. This applies to the provider API token, the platform token and the Git token.
For now, start with a free model in OpenCode. The screenshot uses a free model; no provider account is needed to become familiar with the workflow. Free models have limits on quality and speed, so they fit experimentation, learning and non-sensitive tasks.
| Component | Agent sees | Note |
|---|---|---|
| Files in the workspace | Yes | Within the session's access |
| Terminal and shell commands | Yes | Within the session |
| Git remote | Broker endpoint | Not the token |
| Platform API | Through the broker | Within the platform token's scope |
| LLM provider | Provider and model | Key held by the broker/Studio |
| Token value | No | Not in env, files or repo |
.git-credentials, .netrc |
No token | The broker replaces these files |
The screenshot below is the agent checking its own environment:
Figure 3 — The agent checks .git/config, .git-credentials, .netrc, environment variables and token-like strings in the repo. Result: no token; the Git remote is routed through the broker.
The broker does not expand permissions. If a token can only read one repository, the agent cannot push to another repository. If a platform token has one scope, the agent can only do what that scope allows. For tighter limits, issue a read-only token or a token for one repository.
That is why token permissions still need review before running an agent. The broker reduces token exposure; it does not replace permission review. A broad token still gives the agent broad permission, even when the token never appears in the terminal.
Working rule: grant the least permission and the shortest lifetime that still lets the job run; use a separate token per repository or purpose; revoke it when it is no longer needed. The agent should only work with the data and repositories that token actually needs.
A coding agent is most useful when it sits next to the data and the code. In Studio, the agent can:
None of these need the agent to hold a long-lived token. They need the agent to have just enough permission, in a session that can end and be revoked. The credential broker makes access a property of the session, rather than a key left behind in the container.
opencode.For Git or the Platform API, the agent uses the broker instead of a token in the environment. If an action is refused, check the token's scope before widening it.
Coming soon: an LLM provider in Vietnam and a full sandbox. Vieomics is working with an LLM provider in Vietnam. When that is complete, Studio will move toward a full sandbox with new features, designed to keep prompts and data within Vietnam's legal scope. We will announce when it is available.
Until then, the free model is the right way to become familiar with the workflow. Avoid putting sensitive or personal data into an external provider before the configuration and agreements are in place. The compliance scope depends on the provider, the data and the configuration; we will publish it clearly when the service launches.
Can the agent read the token by running env?
No. The token is not placed in the agent's environment variables.
Can the agent use the token to push code?
Yes, if the token has push permission. The broker passes the permission through; it does not expand it. To block pushes, issue a read-only token.
Does the broker replace token permission review?
No. The broker reduces the chance of token exposure; the token still decides what the agent can do. Review its scope and lifetime.
Is the free model enough?
It is enough to try the workflow and learn how the agent behaves. For long tasks, higher quality or sensitive data, wait for the in-country provider and the full sandbox.
opencode, choose a free model and try a small task.

