{"record":{"id":"4a725c9dfc4930ce","repo":"Hmbown/CodeWhale","slug":"codewhale-terminal-receipt-sandbox-did-not-match-launch","errorCode":null,"errorMessage":"Codewhale terminal receipt sandbox did not match launch","messagePattern":"Codewhale terminal receipt sandbox did not match launch","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"integrations/verifiers-codewhale/codewhale_harness/harness.py","lineNumber":234,"sourceCode":"            argv.extend([\"--max-turns\", str(self.config.max_turns)])\n        if self.config.disabled_tools:\n            argv.extend([\"--disallowed-tools\", \",\".join(self.config.disabled_tools)])\n        if system:\n            argv.extend([\"--append-system-prompt\", system])\n        argv.extend([\"--\", str(prompt or \"\")])\n\n        result = await runtime.run_program(argv, env)\n        if result.exit_code == 0:\n            receipt = _parse_stream_receipt(result.stdout)\n            terminal = receipt[\"terminal\"]\n            if terminal.get(\"provider\") != \"openai\":\n                raise RuntimeError(\"Codewhale terminal receipt did not use provider openai\")\n            if terminal.get(\"model\") != ctx.model:\n                raise RuntimeError(\"Codewhale terminal receipt model did not match rollout\")\n            if terminal.get(\"approval_posture\") != \"auto_tools\":\n                raise RuntimeError(\"Codewhale terminal receipt did not confirm auto tools\")\n            if terminal.get(\"sandbox_posture\") != sandbox:\n                raise RuntimeError(\"Codewhale terminal receipt sandbox did not match launch\")\n            if receipt[\"events\"].get(\"error\", 0) != 0:\n                raise RuntimeError(\"Codewhale successful run contained an error event\")\n            if terminal.get(\"status\") != \"completed\":\n                raise RuntimeError(\"Codewhale terminal receipt did not report completion\")\n            if terminal.get(\"termination_reason\") != \"resolved\":\n                raise RuntimeError(\"Codewhale terminal receipt was not resolved\")\n            trace.info[\"codewhale\"] = receipt\n        return result\n\n\ndef _has_version(output: str, version: str) -> bool:\n    return (\n        re.search(\n            rf\"(?<![0-9A-Za-z.+-]){re.escape(version)}(?![0-9A-Za-z.+-])\",\n            output,\n        )\n        is not None\n    )","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/integrations/verifiers-codewhale/codewhale_harness/harness.py#L216-L252","documentation":"The receipt's sandbox_posture must equal the sandbox value the harness computed for the launch (the literal config.sandbox, or 'workspace-write'/'external-sandbox' when sandbox='auto' resolves by runtime type). A mismatch means the binary ran under a different isolation level than the rollout declared.","triggerScenarios":"launch() with config.sandbox set (or auto-resolved) where the binary reports a different sandbox_posture — e.g. the binary lacks sandbox support, ignored --sandbox, or fell back to a default because the requested mode is unavailable in the runtime.","commonSituations":"Auto-resolution surprise: expecting 'auto' to appear in the receipt instead of the resolved value; a custom binary without sandbox support; runtime type changed between subprocess and isolated, changing the resolved posture.","solutions":["Compare terminal.sandbox_posture in the receipt with the resolved sandbox ('workspace-write' on subprocess runtimes, 'external-sandbox' in isolated runtimes)","Set config.sandbox explicitly to the posture your runtime supports instead of 'auto'","Ensure the binary is the pinned release that honors --sandbox"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = await harness.launch(ctx, trace, runtime, endpoint, secret, mcp_urls)\nexcept RuntimeError as e:\n    if \"sandbox did not match launch\" in str(e):\n        # compare receipt sandbox_posture with resolved sandbox; set config.sandbox explicitly\n        ...\n    else:\n        raise","preventionTips":["Set config.sandbox explicitly rather than relying on 'auto' resolution","Know the resolved mapping: subprocess -> workspace-write, isolated -> external-sandbox","Use sandbox-capable pinned binaries"],"tags":["receipt","sandbox","verification"],"backgroundTag":"unexpected-api-response-shape","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}