DeepSeek Harness: Sandbox and Filesystem Restrictions
DeepSeek Harness resolves a file-effect policy for each capability call, but the process sandbox and the filesystem tool enforce it through different providers. Check both paths: a workspace name or a read-before-write guard alone does not establish a filesystem boundary.
DeepSeek Harness: what does the policy actually cover?
The sandbox reference defines three modes for filesystem effects. read-only asks a confined backend to deny writes; workspace-write permits writes under the workspace root and the backend's promised temporary area; danger-full-access bypasses confinement. Network and process visibility are outside this vocabulary. POSIX runners allow the required /dev/null sink even in read-only mode. The Windows ACL runner reports partial enforcement because of its documented ambient ACL gaps.
A normal tool call resolves the root from the calling session's immutable cwd. For an agentless call, deployment configuration supplies the fallback. The policy resolver also considers the mode: an approved explicit override takes precedence over the session's last sandbox/mode event, which takes precedence over the deployment default. The result belongs to this call; another call can have a different policy without changing provider-wide state.
| Layer | Role | What to check |
|---|---|---|
| Policy resolver | Selects the call's mode and root | Session, override and root |
| Process sandbox | Wraps a subprocess for confined execution | Backend and enforcement completeness |
| Filesystem provider | Resolves targets and performs file operations | Whether it enforces the passed policy |
| Observation policy | Adds read-before-write and freshness decisions | Whether the optional plugin is mounted |
| Host permissions | Kernel access to the underlying resource | Actual account, ACLs and error |
DeepSeek Harness: how does a subprocess receive the boundary?
For a confined mode, the process consumer passes an argument vector and resolved policy to ctx.sandbox.confine. The provider returns the replacement argument vector to spawn and an enforcement fact. The local provider has Linux bwrap/Landlock, macOS Seatbelt and Windows ACL restricted-token backends; a remote provider can operate in a paired remote execution world. These are implementations of a common seam, not identical operating-system guarantees.
The reported enforcement is either full or partial. Full means the backend governs the file effects promised by that mode; partial means it cannot enforce every promised effect. The reference names older Landlock ABIs and Windows hard-link, unconfined-read and AppContainer-ACL boundaries as partial cases. A consumer needing an absolute promise must reject or surface that distinction rather than silently treating partial as full.
If no usable backend is available for a confined policy, SANDBOX_UNAVAILABLE is reported. Silent unconfined passthrough is forbidden by the documented provider contract. A runner can also fail before the requested command executes. Its failure rules combine a nonzero exit and matching diagnostic evidence, while denial signatures describe a command blocked by the running sandbox. An exit code alone does not establish which occurred. danger-full-access is different: its consumer launches the original arguments without calling the confinement service.
DeepSeek Harness: what happens to direct filesystem calls?
The filesystem reference describes a separate service, provider, optional observation policy and model-facing tools. A supplied path is resolved into a backend target. Its targetKey is opaque; its displayPath can be a local path, a workspace-relative path or a remote URI. A displayed name alone is not proof of the execution-world target.
The writeText and editText contracts accept a per-call sandboxPolicy. A sandbox-enforcing backend can fence these mutations; the bare backend ignores that argument. Therefore the existence of a policy resolver or a process sandbox does not prove that the direct file provider enforces the same policy. Identify the provider actually serving the operation. Similarly, restrictions described for writes and edits must not be assumed to be a general read confidentiality boundary.
The optional observation plugin addresses another question: has this owner observed the target, and is the version still current? With the policy present, an unobserved target can yield FS_NOT_OBSERVED; a changed version can yield FS_STALE_VERSION. The guard prevents a particular stale or unobserved mutation, not all unauthorized file effects. Without the observation plugin, the bare seam permits unguarded create-or-overwrite and literal edits.
DeepSeek Harness: how should I investigate a rejected edit?
- Record the requested operation, target, session and actual provider. Confirm the root and whether the operation is a subprocess or a direct filesystem tool call.
- Inspect the resolved mode and any approved call-specific override. For confined subprocesses, check the backend and whether it reports full or partial enforcement.
- Read the error in its own layer.
FS_SANDBOX_DENIEDis a policy refusal by a sandbox-enforcing filesystem backend;FS_PERMISSION_DENIEDis a host-kernel refusal. A runner failure is different from a successfully enforced denial. - If the error is
FS_NOT_OBSERVEDorFS_STALE_VERSION, inspect or re-read the target and reassess the requested change. Do not treat freshness failures as proof that the sandbox blocked a write. - If a wider operation is truly required, review its scope and applicable approval before retrying. Verify the resulting change and restore unintended effects through the deployment's normal recovery process.
For example, a write outside the root can be rejected by an enforcing file backend even if the user can write there in another process. Conversely, a host ACL can deny a target inside the root. The same pathname can thus produce different evidence at different layers. A command that fails during sandbox initialization does not tell you whether its intended file edit would have passed policy.
Consider two requests against the same project. An agent may ask a shell to run a program that writes a report, or invoke a direct file edit. The first needs the process runner's confined argument vector and enforcement report; the second goes through the filesystem provider and its policy argument. Investigate each operation on its own terms. Even if both use the same root, their backends can implement different enforcement guarantees.
A version check adds a third axis. Suppose a file was read, then another actor changed it before an edit. A guarded edit checks the expected version before literal matching, so a stale error takes precedence over a text-match failure against newer contents. If the target was observed absent, a guarded create can reject a file that appeared in the meantime. These checks help avoid overwriting a change that the editor did not observe; they do not decide whether the location falls inside a sandbox boundary.
When recording an investigation, keep the policy mode, root, operation type, provider and exact error together. A useful comparison changes one factor at a time: for instance, compare a direct edit with a subprocess only after confirming both refer to the intended target. Do not use an unrestricted retry as a diagnostic shortcut when a read-only inspection can establish the active configuration.
DeepSeek Harness: what are the limits and safety boundaries?
A mode describes file effects, not network isolation. Partial enforcement is a meaningful limitation, and danger-full-access explicitly bypasses confinement. Check the active backend, platform and process environment instead of assuming that the name of a preset proves its behavior. Never replace a confined policy with full access merely to suppress an unexplained error.
The optional observation policy does not establish trust in file content or decide whether an edit is appropriate. A successful write also does not prove the right workspace or target was selected. Inspect the actual operation and review the result. Logs and file contents can contain sensitive information; remove it before sharing diagnostics.
A policy denial also differs from a provider failing to resolve or launch the runner. Preserve the original diagnostic and, for a subprocess, the backend's reported enforcement. If the runner never started the command, inspecting the expected output file cannot tell you whether the command would have been allowed. If the command ran and a file effect was denied, inspect the policy root and target before deciding whether a different authorized workflow is needed. This distinction prevents an infrastructure failure from being reported as a successful sandbox restriction.
DeepSeek Harness: what do these terms mean?
- Sandbox mode: a per-call vocabulary for permitted filesystem effects.
- Workspace root: the boundary used for workspace-write, normally derived from the session's immutable cwd.
- Enforcement: the provider's full or partial report for its promised file effects.
- Observation guard: an optional check of target presence and version before a mutation.
- Filesystem target: a provider-resolved identity, which need not be a local pathname.
Frequently asked questions
Does the process sandbox constrain every file tool?
No. Direct file operations depend on their actual filesystem provider and whether it enforces the policy.
Does read-only mode block network access?
The sandbox mode describes file effects; network and process visibility are outside its vocabulary.
What does partial enforcement mean?
The active backend cannot enforce every file effect promised by the mode.
Sources
Every claim in this article was checked against the sources below. Community discussions are user reports, not official behavior.
This is an independent community article, not official DeepSeek documentation. Listing a plugin in the registry is not a security review.