{"record":{"id":"06e86f6d30798250","repo":"deepseek-ai/deepseek-harness","slug":"tool-fs-the-mounted-filesystem-confines-but-ctx-s","errorCode":null,"errorMessage":"tool-fs: the mounted filesystem confines but ctx.sandboxPolicy is missing","messagePattern":"tool-fs: the mounted filesystem confines but ctx\\.sandboxPolicy is missing","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-fs/src/sandbox.ts","lineNumber":48,"sourceCode":"}\n\n/**\n * The filesystem escalation API: advertisement gating, per-call policy\n * resolution, the one-approved wider retry, and denial-marker mapping. A pure\n * product of `ctx` at plugin apply time.\n */\nexport class FsSandboxController {\n  /** The escalation targets this composition advertises (`[]` when no confining backend is mounted). */\n  readonly escalationModes: readonly SandboxMode[]\n  /** Shared per-session policy resolver, required by a confining backend. */\n  private readonly policy: SandboxPolicyService | undefined\n\n  constructor(private readonly ctx: Context) {\n    const defaultMode = ctx.fs.sandboxMode\n    this.escalationModes = defaultMode === undefined ? [] : ESCALATION_TARGETS\n    this.policy = defaultMode === undefined ? undefined : ctx.get('sandboxPolicy')\n    if (defaultMode !== undefined && this.policy === undefined) {\n      throw new Error('tool-fs: the mounted filesystem confines but ctx.sandboxPolicy is missing')\n    }\n  }\n\n  /**\n   * The escalation schema fields for a mutating tool's `parameters`. Call it\n   * only under a confining backend (guard on {@link escalationModes}); the\n   * enum pins the closed target vocabulary, the strict-wider check happens per\n   * call at execution.\n   * @returns the two escalation parameter specs.\n   */\n  schemaFields(): EscalationSchemaFields {\n    return {\n      sandbox_permissions: {\n        type: 'string',\n        enum: [...this.escalationModes],\n        description: 'The wider sandbox mode this file operation needs. Only valid as a one-shot retry '\n          + 'of an operation the sandbox just denied; requires justification and user approval.',\n      },","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-fs/src/sandbox.ts#L30-L66","documentation":"Error \"tool-fs: the mounted filesystem confines but ctx.sandboxPolicy is missing\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-fs/src/sandbox.ts:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}