Codex does not support default: deny; it falls back to ask silently.
Permission Policiespublic
Last verified 25 Nov 2026
DigitalOcean Harness Runtime provides managed, hardware-isolated microVM sandboxes with built-in tools such as Chromium to run harnesses and execute arbitrary code. Rich lifecycle APIs preserve conversational history and working state across sessions, letting you pause, resume, and fork work to control costs and adapt to the nonlinear nature of agentic workflows. Scale complete agents such as Claude Code or use sandboxes independently for code execution, all through the same service. See What You Can Build for example use cases.
A permission policy is the permissions block of a Harness Runtime environment spec. It decides what the agent may do without interruption, what requires your approval, and what is blocked outright. The policy is the enforcement mechanism for agent behavior. Prompts, instructions, and tool selection shape what the agent tries; only the policy determines what it is allowed to complete.
Policy Decisions
| Decision | Behavior |
|---|---|
allow |
The agent performs the action immediately. |
ask |
The agent stops and waits for your approval. |
deny |
The action is blocked. The agent is told no and may try another approach. |
permissions.default sets the decision for any action no rule matches. Omitting it resolves to ask, except on a sandbox with no harness, where it resolves to allow. Set it explicitly so the intended posture is visible in the spec, and prefer a restrictive default with targeted allow rules over a broad allow.
Omitting the permissions block entirely is different from setting a default. With no block, Harness Runtime sends no policy and the agent keeps whatever built-in default it ships with, which varies by adapter. A sandbox with no harness has no agent to keep a default, so attached do.actions tools are allowed without approval.
Rule Targets
A rule names the kind of action it applies to. Harness Runtime uses a taxonomy of built-in action types, including bash, file.read, file.write, web.fetch, the git.* operations, and mcp.
A rule can also name a specific tool on a specific MCP server by qualifying it with the server, as in do.actions/action_code, or name a versioned Toolbelt, as in do.actions/toolbelt:read-only@1. Qualified rules are how you express policy for Action Gateway tools.
Rules match literally. A deny on one command does not block a different command that accomplishes the same thing, and a deny on one path does not cover another route to the same file. Write a rule for each form you intend to control, then confirm the result on a live session before relying on it.
How a Decision Is Reached
For actions the agent takes natively, Harness Runtime evaluates rules in order:
- If more than one rule matches, the last matching rule in the list wins, and its decision applies.
- If no rule matches, the action uses
permissions.default.
Action Gateway evaluates its own tools differently, using most-specific matching rather than order. Do not assume rule order controls the outcome for a gateway-qualified rule.
Where Rules Are Enforced
Two different enforcement points read your policy, and they behave differently on the same decision.
Unqualified rules are enforced inside the sandbox, at the agent. This is where ask produces an interactive approval request you can answer.
Rules qualified with do.actions/ apply to the Action Gateway session attached to your agent. Gateway rules apply whether a tool is preloaded and called directly or reached through a meta tool.
For the claude-code and codex adapters, an explicit ask rule or permissions.default: ask delegates approval to Action Gateway. The gateway pauses the tool call, and the adapter presents an approval request. OpenCode and Cursor handle approvals through Harness Runtime instead. Verify approval behavior with the adapter you deploy; do not assume all adapters support the same prompts. See Configure Agent Permissions.
Enforcement Modes
A rule can declare how strictly it must be applied. strict requires the enforcement point to be able to guarantee the decision. best-effort accepts enforcement by the agent’s own cooperation. Deny rules default to strict; other rules default to best-effort.
A strict rule that the chosen adapter cannot hard-enforce fails the session at creation rather than starting an agent that would silently ignore it. This is intentional: a policy you believe is enforced but is not is worse than a session that refuses to start.
Filesystem and Network Access
Beyond per-action rules, the policy sets two sandbox-level controls.
permissions.filesystem is either read-only or workspace-write, with an optional list of additional writable paths. This is enforced by the sandbox rather than by the agent, so it holds even if the agent attempts a write another way.
permissions.network narrows outbound access for the agent. It can only restrict within the session’s egress policy. It never widens it, so a host an egress allowlist excludes stays unreachable no matter what the policy says.
Changing a Session’s Policy
A session’s policy is set when the session starts, and on some adapters you can replace it on an existing session, running or paused. The new policy replaces the old one in full and takes effect from the agent’s next tool call. It does not restart the agent, except on langgraph, which restarts when its do.actions/<tool> rules or default change because it reads the Action Gateway endpoint only when it starts. Live permission changes are available only on sessions created after the feature was released.
Which parts can change depends on where the adapter enforces the policy. claude-code and opencode accept changes to default and to bash, file.read, file.write, mcp, and do.actions/<tool> rules. openhands accepts changes to default and to bash, file.read, file.write, and web.fetch rules, but not mcp or do.actions/<tool> rules. hermes and langgraph enforce changes at Action Gateway, so only do.actions/<tool> rules with allow or deny, and a default of allow or deny, can change. codex accepts changes to default and to bash and do.actions/<tool> rules, with allow, ask, or deny, but not file.read, file.write, web.fetch, or mcp rules, and it does not restart. On openhands, while the session uses do.actions tools, default can’t change, because the change would move the session to a new Action Gateway endpoint that openhands can’t pick up while running. On crewai, cursor, and every other adapter, the policy can’t change on an existing session. permissions.filesystem and permissions.network never change on an existing session on any adapter. If a new policy leaves them out, the session keeps the ones it has.
For native rules the last matching rule wins, so the order of the rules is part of the policy. Action Gateway matches do.actions/<tool> rules by specificity, so their order doesn’t change the outcome, but moving any rule still counts as a change. Only the parts that differ from the current policy are checked, and a removed rule is checked like an added one: a rule of a type the adapter can’t change has to stay, so removing the whole policy with permissions: {} is refused while the policy has one. A request with any change the adapter can’t apply is refused in full, so the session never runs with a partly applied policy. See Change Permissions.
What Is Not a Permission Boundary
Several things look like access controls and are not.
allowed_toolson an agent skill is advisory. It documents which tools a skill expects to use. It does not grant them and does not restrict them.- Tool selection is not disposition. Attaching a narrower set of MCP tools reduces what the agent can discover, but the permission policy still decides whether an attached tool runs.
- Instructions and prompts are guidance. An agent can be argued out of an instruction. It cannot be argued out of a deny rule.
- A policy does not reduce a credential’s scope. If a token can delete a repository, a deny rule in one session does not change that. Grant least-privilege scopes at the provider.
For the syntax and the full field list, see the environment spec reference. For worked examples, see Configure Permissions.