deepseek-ai/deepseek-harness · error · Error

terminal-bash: sandbox mode "${policy.mode}" requires a ctx.

Error message

terminal-bash: sandbox mode "${policy.mode}" requires a ctx.sandbox provider in the execution world

What it means

Error "terminal-bash: sandbox mode "${policy.mode}" requires a ctx.sandbox provider in the execution world" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/terminal/terminal-bash/src/index.ts:97

    BASH_SILENCE_DEPRECATION_WARNING: '1',
  }
}

/**
 * The pwsh prompt function that emits the shared OSC `133;D;` + BEL marker
 * before every prompt, mirroring bash's PROMPT_COMMAND. `[char]27`/`[char]7`
 * build the control bytes at runtime because raw ESC characters in submitted
 * input are unreliable under PSReadLine.
 */
export const PWSH_PROMPT_SETUP =
  "function prompt { [Console]::Write([char]27 + ']133;D;' + [int]$LASTEXITCODE + [char]7); '" + CONTROLLED_PROMPT + "' }"

function spawnArgv(ctx: Context, config: ResolvedConfig, policy: SandboxExecutionPolicy): string[] {
  const argv = [config.shellPath, ...config.shellArgs]
  if (policy.mode === 'danger-full-access') return argv
  const sandbox = ctx.get('sandbox')
  if (sandbox === undefined) {
    throw new Error(`terminal-bash: sandbox mode "${policy.mode}" requires a ctx.sandbox provider in the execution world`)
  }
  // Re-state the discriminant because object spread does not preserve its narrowed type.
  return sandbox.confine(argv, { ...policy, mode: policy.mode }).argv
}

// TODO(pty-initialize-race-home): Fold this outer abort race into
// LocalPtySession.initialize when the send-state consolidation lands; the
// session already owns the send lifecycle the race protects.
async function startupSession(
  session: LocalPtySession,
  dialect: ShellDialect,
  signal?: AbortSignal,
): Promise<void> {
  const start = async (): Promise<void> => {
    if (dialect === 'bash') {
      await session.initialize(signal)
      return
    }

View on GitHub (pinned to b150a551b8)

Solutions

  1. Compose a ctx.sandbox provider in the execution world, or use an unsandboxed mode.

When it happens

Trigger: Thrown at packages/terminal/terminal-bash/src/index.ts:97 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/59c0ff7e9e14cbee. Report an issue: GitHub.