ChatGPTClaudeGrok / X / CursorGemini

DeepSeek Harness Windows 0xC0000142: built-in admin fix

TroubleshootingPublished 2026-10-30Author: DeepSeek Plugin Market
DeepSeek HarnessDSHWindows0xC0000142workspace-writeAdministratorLUA_TOKENsandbox
DeepSeek Harness on Windows exits pwsh and cmd with 0xC0000142 under workspace-write when the account is built-in Administrator; LUA_TOKEN is the cause.

Switch the Windows desktop app to workspace-write and pwsh, cmd, even a plain echo 1 come back as 0xC0000142 with empty stdout and stderr. If the account is the built-in Administrator (SID ending in -500), that is usually enough to close the case: the restricted token is built with LUA_TOKEN, and the built-in Administrator cannot start any restricted process under that flag. The fix, commit bdd75ca1a0c, only went into the alpha line after 0.2.2-alpha.2 — not the rc line. So this is not something you tune away in settings; the order is: identify the account, identify the build, then pick a path (#10630, #11297).

DeepSeek Harness: Identify the account first: a SID ending in -500 is the built-in Administrator

Whether you are on the built-in Administrator is decided by the SID, not the display name: if the last segment of whoami /user is -500, it is the built-in account; a normal administrator gets a random RID that never ends this way.

Work through these three checks instead of guessing from "my account is called Administrator":

  1. Open PowerShell and run whoami /user. A line like DESKTOP-XXX\Administrator S-1-5-21-...-500 means you are on the built-in account; note the -500.
  2. Run whoami /groups and confirm whether the token carries Mandatory Label\High Mandatory Level, and whether DSH is running elevated. With UAC off, the built-in Administrator is usually already High.
  3. Confirm DSH was launched by that same account: Task Manager → Details → locate DeepSeek Harness.exe and compare the "User name" column.

Plenty of people assume "I am in the administrators group" equals the built-in Administrator. They are different things. A normal administrator has a regular user logon token the restricted token can fall back to; the built-in Administrator has no such fallback, which is why the same code works on a colleague's machine and fails on yours.

DSH plugin: Why the built-in Administrator cannot start restricted processes

The root cause is CreateRestrictedToken with LUA_TOKEN: the flag is meant to demote an administrator to a normal user, but the built-in Administrator has no regular logon token to demote to, so the restricted token cannot even create a process and returns 0xC0000142 across the board.

Break the chain into steps:

  1. Under workspace-write, DSH starts child processes through a restricted token and calls CreateRestrictedToken first.
  2. To strip administrator rights from the child, the call includes LUA_TOKEN.
  3. A normal administrator account is demoted to a usable normal-user token, and the process starts.
  4. The built-in Administrator has no normal-user logon path; the demoted token lacks the required logon SID and profile, so the child dies during DLL initialization.
  5. The failure is reported as exit code 0xC0000142, before stdout or stderr can exist, which looks like "the command never ran".

This also explains why read-only sometimes fails while danger-full-access works: the latter does not use a restricted token at all, so it skips the entire chain.

DeepSeek Harness: Version check: the fix only landed in the alpha line after 0.2.2-alpha.2

Commit bdd75ca1a0c removes LUA_TOKEN, but it was only merged into 0.2.2-alpha.2 and later alpha builds; 0.2.0-rc.2, 0.2.1-rc.3, and 0.2.1-rc.4 do not include it, so "upgrade to the latest rc" is not a fix.

Confirm which line you are actually running:

  1. Open the desktop "About" panel, or read package.json inside resources/app.asar in the install directory, and write down the full version.
  2. If it is 0.2.0-rc.x or 0.2.1-rc.x, treat it as "fix not included".
  3. If it is 0.2.2-alpha.2 or a later alpha, verify once more by commit: the app.asar in your installer should be built from the commit that contains Remove LUA_TOKEN.
  4. Do not decide based on "I clicked check for updates" alone; the update channel may still be pinned to the rc line.

The version matrix compresses into one sentence: rc line no, alpha.2 and up yes. That is why the same 0xC0000142 is fixed for some people by upgrading and still reproduces for others after moving to rc.4.

DSH Plugin: Three workable paths: upgrade, switch account, temporarily open up

The shortest path is upgrading to an alpha build that contains the fix; if you do not want an alpha, create a normal administrator account; only if neither works should you temporarily switch to danger-full-access and accept the loss of sandbox isolation.

Path 1: upgrade to 0.2.2-alpha.2 or a later alpha

  1. Back up your profile and the ~/.dsh directory first; alpha format migrations are not guaranteed to be reversible.
  2. Install 0.2.2-alpha.2 or later from the official nightly/alpha channel.
  3. After launch, run whoami /user to confirm you are still on the same account, then switch to workspace-write.
  4. Run echo 1 to verify the 0xC0000142 is gone. If it still fails, you are not hitting LUA_TOKEN — move on to the default DACL or console checks.

Path 2: create a normal administrator account

  1. Open Windows Settings → Accounts → Other users → Add account.
  2. Create a new local account and choose the "Administrator" type; do not enable the built-in Administrator.
  3. Sign out of the current session, sign in as the new account, and reinstall or copy DSH into a directory that account can access.
  4. Launch DSH under the new account, switch to workspace-write, and run echo 1 again.
  5. Once it works, move projects and session data into the new account's DSH_HOME; do not share one session directory between both accounts.

Path 3: temporarily switch to danger-full-access

  1. In the session, run /permission and pick danger-full-access.
  2. Confirm the project is trusted code and that you accept commands no longer being confined by the workspace sandbox.
  3. Finish the urgent task, then switch back to workspace-write or move to a fixed build as soon as possible.
  4. Do not write this mode into your default configuration, or you will forget it is on.

DeepSeek Harness: Do not mistake three other 0xC0000142 causes for this one

The same 0xC0000142 has at least three other common causes: a missing job object/keep-alive group, child processes created with CREATE_NO_WINDOW/CREATE_NEW_CONSOLE, and a path DACL that carries a foreign AppContainer package SID. Each needs a different diagnosis, so do not force one fix onto all of them.

CauseKey signalDirection
LUA_TOKEN + built-in Administratorwhoami /user ends in -500, at least two of three sandbox tiers failUpgrade to alpha / switch to a normal admin account
Default DACL naming a derived-capability SIDOnly workspace-write fails, read-only worksWait for the core fix; use dsh web or open up temporarily
Console creation flagsDesktop fails entirely, dsh web worksUse dsh web, or stop creating a new console
Install directory/path ACL contains a foreign package SID--no-sandbox starts, or --enable-logging shows install_dir_accessRun the bundled diagnose-windows-sandbox-acl.ps1

Keep the diagnosis order fixed: account (SID) → mode (workspace-write vs read-only) → host (desktop vs dsh web) → ACL logs. Change one variable at a time; swapping account, mode, and ACL at once means you never learn which one mattered.

DSH plugin: Cautions: things not to do

Most cases get worse when several things change at once; keep to one variable and one account check.

  1. Do not work around this by disabling UAC. Turning UAC off only makes it easier for the built-in Administrator to start at High integrity; the LUA_TOKEN problem remains.
  2. Do not treat every 0xC0000142 as LUA_TOKEN. Run the account check first, or you will upgrade to an alpha for nothing.
  3. Do not use danger-full-access as a long-term substitute for the fix. It bypasses the whole sandbox, not this one token defect.
  4. Do not share one DSH_HOME between two accounts. Session logs and lock files interfere with each other, and afterwards you cannot tell permissions from concurrent writes.
  5. Back up before upgrading to alpha. Copy the profile, the session directory, and cordis.patch.yml; alpha-line migrations are not guaranteed to be reversible.

If your SID does not end in -500, this article does not apply — jump to the default DACL or console articles instead. If it does end in -500 and you would rather not switch accounts, the least painful route is upgrading to an alpha build that contains bdd75ca1a0c.See DSH plugin: Windows subprocess fails with 0xC0000142 for the related case.

ChatGPTClaudeGrok / X / CursorGemini

FAQ

Every shell in DeepSeek Harness on Windows exits with 0xC0000142 and no output — how do I tell if it is the built-in Administrator?

Start inside DeepSeek Harness with whoami /user and read the last segment of your SID, where -500 means the built-in Administrator. Then run whoami /groups to see whether the token is elevated High integrity. Accounts with SID -500 hit the LUA_TOKEN defect under workspace-write, and at least the two restricted sandbox tiers fail completely.

Why does the built-in Administrator fail to start any restricted child process in DeepSeek Harness at all?

DeepSeek Harness cannot start any restricted child process as the built-in Administrator because Windows CreateRestrictedToken with the LUA_TOKEN flag demotes the token to a restricted one that cannot even create a basic process; the built-in Administrator has no normal user logon token to fall back to, so every child process returns 0xC0000142. It is not a wrong command and not a PATH problem.

Which DeepSeek Harness version fixes this 0xC0000142?

The fix in DeepSeek Harness is commit bdd75ca1a0c (Remove LUA_TOKEN) per the community source check, and it only landed in 0.2.2-alpha.2 and later alpha builds; 0.2.0-rc.2, 0.2.1-rc.3, and 0.2.1-rc.4 do not contain it. Judge by the commit behind your installer, not by the version prefix alone.

Without upgrading to an alpha build, can I still use workspace-write as the built-in Administrator in DeepSeek Harness?

Without an alpha build, DeepSeek Harness still leaves two options as the built-in Administrator: create a normal administrator account and run DSH there, or temporarily switch the sandbox to danger-full-access, which drops workspace isolation and should only be used briefly on trusted projects. Turning off UAC does not bypass this defect.

Same 0xC0000142 in DeepSeek Harness — how do I separate LUA_TOKEN, the default DACL, and console creation issues?

When the same 0xC0000142 appears in DeepSeek Harness, check the account first: SID -500 with all three sandbox tiers failing points to LUA_TOKEN. Then check the mode: only workspace-write failing while read-only works looks like the default DACL. Finally check the host: desktop failing while dsh web works usually means a console/creation flag problem. Test one variable at a time.

Related Terms

LUA_TOKEN
LUA_TOKEN is a Windows flag passed when creating a restricted token to demote an administrator token to normal user rights. On the built-in Administrator account it prevents restricted processes from starting at all, surfacing as a uniform 0xC0000142.— https://github.com/deepseek-ai/deepseek-harness/discussions/10630
0xC0000142
0xC0000142 is the Windows STATUS_DLL_INIT_FAILED exit code, meaning the process failed during initialization. It is commonly caused by restricted tokens, console creation, or rejected DLL initialization, and by itself does not identify the cause; you have to combine account, sandbox mode, and host type.— https://github.com/deepseek-ai/deepseek-harness/discussions/11297
built-in Administrator
The built-in Administrator is the default administrator account created when Windows is installed, and its SID always ends in `-500`. Unlike a normal account that merely belongs to the administrators group, it has no ordinary user logon path, which makes it more susceptible to restricted-token compatibility problems.— https://github.com/deepseek-ai/deepseek-harness/discussions/10630
workspace-write
workspace-write is a DeepSeek Harness sandbox mode that allows writes inside the workspace and read-only access outside it. It isolates work through a combination of restricted tokens and ACLs, so it is more sensitive to Windows account type and token construction than read-only.— https://github.com/deepseek-ai/deepseek-harness

Sources