#5968 [GUI] Bypass mode has no way to obtain Windows administrator rights: the sandbox ladder tops out at the app's own token

closed · @xvcezrqpbxtpzblrt · 1 commentaires · Sur GitHub

Setup & installNVIDIA / CUDAModels & quantsDocumentationWindows

Description

Area: [GUI] (the desktop app). Delivery: Desktop app (Windows). Reproduction status: Reproduced locally (see the last section for the one claim that is static analysis).

Strata version: Strata 0.2.13 · agent component @deepseek-ai/dsh 0.2.1-alpha.3 (installed record: `{"component":"deepseek-harness","version":"0.2.1-alpha.3","commit":null,"builtAt":"2026-10-16T17:45:39.441Z"}`) · engine 0.1.59-windows-x86_64-cuda-cuda13 · Node v24.12.0

Graphics card, memory and system: NVIDIA GeForce RTX 3080 Ti Laptop GPU 16 GB · 64 GB RAM · 12th Gen Intel Core i7-12800HX · Windows 11 Pro build 26300.9974

Model, size and settings: Qwen3.8-Flash-Next IQ3_S (two-part GGUF, PLE split, MTP draft) · max-context 393216 with yarn rope-scale 1.5, kv k8v4, spec 4 · pictures on. The model is not what this report is about; the behaviour is on the agent side and does not depend on it.

## Problem

In an agent chat, when a task needs Windows administrator rights (a machine-wide registry value, a service, a protected folder), the assistant has no way to obtain them and no way to ask me for them. Two things compose into a dead end:

- The third entry of the Mode menu, "Bypass permission checks" (`绕过权限检查`, sub-line "skip permission prompts"), sets the approval policy to `never`, and the agent component resolves **every** ask to `rejected` before it dispatches it — so no Approve/Deny card ever appears in the chat.
- The escalation ladder the tools may use has exactly two rungs above the floor (`workspace-write`, `danger-full-access`), and that third mode already starts the session at the top rung. `danger-full-access` only means "no file sandbox": the command then runs with the same rights the Strata process itself holds — for a per-user install, a normal non-elevated token. A Windows privilege error is therefore not one rung above `danger-full-access`; there is nothing above it, and the retry the tool vocabulary invites is refused.

The menu entry reads as "bypass the checks", including the checks the operating system makes, while what it actually does is close the app's own question channel — which is the only asking channel the tools have.

## Reproduce

Windows 11, Strata Desktop 0.2.13 installed per user (the installer needs no elevation), started normally, i.e. non-elevated — the default. The account is a member of the local Administrators group (verified with `net localgroup administrators`), so UAC elevation is available on this machine in principle.

1. Open an agent chat, set the Mode menu to the third entry ("Bypass permission checks").
2. Ask the assistant to run exactly this PowerShell command (`StrataProbeXyz` is my throwaway probe name, not a Strata string):

   ```powershell
   New-Item -Path 'HKLM:\SOFTWARE\StrataProbeXyz' -Force | Out-Null; 'wrote HKLM key'
   ```

   Actual, verbatim:

   ```
   wrote HKLM key
   [stderr]
   New-Item: Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\StrataProbeXyz' is denied.
   ```

   The first line is the command's own echo and is wrong here: the write was refused, nothing was created, and no key is left on the machine.

3. Ask it to retry that same call once with the escalation argument the tools offer (`sandbox_permissions: "workspace-write"` plus a justification).

   Actual, verbatim:

   ```
   Error: sandbox escalation to "workspace-write" is not strictly wider than this call's current "danger-full-access" mode
   ```

Across both attempts: no approval card appeared in the chat, Strata raised no Windows consent prompt, and the assistant finished by reporting that the computer did not allow it.

## Expected

A chat should be able to obtain administrator rights for one action and stay inside the chat: either a request I can answer, or the Windows consent prompt, with the failure — including my "Cancel" — reported back honestly.

## Evidence

**The operating system is not the obstacle.** Control probe from the same `pwsh` tool the chats use, same session: a throwaway script started with `Start-Process pwsh -Verb RunAs`. The Windows consent prompt appeared, I accepted it, and the elevated child wrote back `admin_in_token=True groups=S-1-5-32-544` (Administrators enabled in its token). Nothing inside the agent is permitted to make that request.

**Where the behaviour is defined** — all open-source, quoted as I read it.

Strata repository, `main`, the clone I made for this report (`git clone --depth 1` of this repository):

- `apps/host/server/agent/profile.mjs` lines 34-42: `bypass` = `danger-full-access` + `never`; `manual` = `danger-full-access` + `ask`.
- `apps/host/server/agent/README.md` line 61: "Bypass … Full access without prompts, as before."
- `apps/host/src/locales/zh.json` lines 173 and 1697: "绕过权限检查" / "跳过权限提示".

The pinned agent component (`apps/host/server/agent/README.md` lines 6-8: "a separate, pinned component (`DSH 0.2.1-alpha.3`, commit `57190202`, MIT)"). I read line numbers in the published source of that component at its newest tag `dsh-v0.2.2-rc.3` (2026-11-13), because the `BUNDLE.json` of the copy installed here records no commit:

- `packages/sandbox/sandbox/src/escalation.ts` lines 64 and 77: `WIDER_MODES` and `ESCALATION_TARGETS` — the whole ladder is `read-only → workspace-write → danger-full-access`. No rung represents an OS privilege level.
- same file lines 215-217: the "not strictly wider" throw I hit.
- same file line 122 and its parameter description: "retry this exact … once with `sandbox_permissions` … the approval prompt asks the user" / "the retry asks the user for approval". At the top rung that promise cannot be kept: under `never` the approval resolves `rejected`, and any target is refused as not wider.
- `packages/shell/pwsh-sandbox/src/index.ts` lines 99-104: for `danger-full-access` the command runs with no confinement wrapper and reports `sandbox.denied: false`, so a Windows access error carries no sandbox marker and is distinguishable from a sandbox denial only by its own Windows text.
- `packages/interaction/user-approval/src/index.ts` line 301: `if (this.effectivePolicy(session) === 'never') return 'rejected'`, with line 64: "`'never'` — never prompt anyone: every ask resolves `'rejected'`".
- The component's own published test snapshot shows the dead end even when a person **is** asked: `snapshots/acp/escalation-rejected/session.v4.jsonl` carries `{"type":"approval/policy","data":{"policy":"ask"}}`, then `approval/asked` with reason `escalate sandbox to danger-full-access: …`, then `{"outcome":"rejected"}`, then a tool result beginning `Error: the user rejected escalating this command to "danger-full-access"; …`, and the model replies "… I will not retry and will not work around it — just explain in one short sentence and stop."

I also grepped the whole staged component as installed here (23,413 files) for `RunAs`, `ShellExecute`, `consent`, `elevat`: the only hits are the Windows installer, an NSIS `RunAsUser` call, and comments about files an elevated installer left behind. There is no code path in which a tool call asks Windows for administrator rights.

**Workaround used today:** start Strata itself elevated before the task, so the child commands already hold the rights; or have the assistant write a script and then I right-click it and choose "Run as administrator", which loses the chat's view of the result. The control probe above shows the elevated-launch workaround works.

## Reproduction status

Reproduced locally for both verbatim errors above, in my own Strata 0.2.13 in the third mode.

One claim is **unconfirmed static analysis** (code read, not run): what the first mode (Manual) shows for the same task. `manual` and `bypass` share `danger-full-access`, so the "not strictly wider" refusal should apply there too, and the card it can produce would be about widening the sandbox rather than about administrator rights.

## Suggestions (scope is yours to decide)

- One rung above `danger-full-access`, resolved through the approval service the tools already use and executed through the OS elevation mechanism, so the consent prompt is the human gate, with cancellation and failure reported as their own outcomes. Under the third mode the app-level question could be skipped and the consent prompt left as the only gate — a consent prompt already *is* a human decision, so this does not contradict "no prompts" the way closing the whole asking channel does.
- If elevation is out of scope, at least make the refusal non-misleading: the "not strictly wider" error should state that the call already runs with this user's full rights and that the failure is a Windows privilege problem, not a sandbox problem, instead of leaving the model to report "no permission".
- Smaller and separate, yours to ignore: the Chinese label of the third entry ("绕过权限检查 / 跳过权限提示") collides with the app's own Approve/Deny card, which is also called "权限"; and in the second mode a policy refusal shows a card without buttons (`apps/host/server/agent/events.mjs` line 202 explains why). Saying "this mode closed the asking channel" on that card would be worth it.

## Logs

Engine diagnostics logs are not relevant here, since this is agent-side behaviour. The agent component log for the run is a single line, `dsh web: http://127.0.0.1:<port>/?token=[redacted]` (already replaced inside the file). I did not attach a session record: it contains my chat content and this machine's folder names. Say so if a transcript restricted to the two steps above would help, and I will produce one for just this reproduction.

Sur le site

Liens install, modèles, releases.