{"record":{"id":"0b6db37ad84b06b9","repo":"abhigyanpatwari/GitNexus","slug":"sandbox-copy-cannot-import-prebuilt-graph-or-harne","errorCode":null,"errorMessage":"sandbox_copy cannot import prebuilt graph or harness data: {value}","messagePattern":"sandbox_copy cannot import prebuilt graph or harness data: (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"critical","filePath":"eval/workflow_bench/sanitized_graph.py","lineNumber":92,"sourceCode":"\ndef _is_restricted_path(value: str) -> bool:\n    relative = PurePosixPath(value)\n    if relative.is_absolute() or not relative.parts or \"..\" in relative.parts:\n        return False\n    return (\n        relative.parts[0] == \".gitnexus\" or relative == HIDDEN_HARNESS_PATH or HIDDEN_HARNESS_PATH in relative.parents\n    )\n\n\ndef validate_no_prebuilt_graph_assets(task: Mapping[str, Any]) -> None:\n    \"\"\"Reject declarations that could reintroduce an unsanitized graph/oracle.\"\"\"\n\n    sandbox_copy = task.get(\"sandbox_copy\", [])\n    if not isinstance(sandbox_copy, list):\n        raise SandboxError(\"sandbox_copy must be a list\")\n    for value in sandbox_copy:\n        if isinstance(value, str) and _is_restricted_path(value):\n            raise SandboxError(f\"sandbox_copy cannot import prebuilt graph or harness data: {value}\")\n\n    dependencies = task.get(\"sandbox_dependencies\", [])\n    if not isinstance(dependencies, list):\n        raise SandboxError(\"sandbox_dependencies must be a list\")\n    for item in dependencies:\n        if not isinstance(item, Mapping):\n            continue\n        for field in (\"source\", \"target\"):\n            value = item.get(field)\n            if isinstance(value, str) and _is_restricted_path(value):\n                raise SandboxError(f\"sandbox dependency cannot expose prebuilt graph or harness data: {value}\")\n\n\ndef _replace_control_file(root: Path, name: str, payload: bytes) -> None:\n    path = root / name\n    try:\n        metadata = path.lstat()\n    except FileNotFoundError:","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/sanitized_graph.py#L74-L110","documentation":"Information-leak guard. Each string in sandbox_copy is checked by _is_restricted_path: an entry whose first component is '.gitnexus', or that equals or sits under HIDDEN_HARNESS_PATH, is rejected. The point is to stop a task from importing a prebuilt graph or harness/oracle tree into the sandbox, which would let an arm query cached answers and invalidate the benchmark.","triggerScenarios":"A task lists 'sandbox_copy: [.gitnexus/...]' or copies anything under the hidden harness path. Even an apparently innocent '.gitnexus/meta.json' is rejected because it is a graph asset.","commonSituations":"Author tries to seed an arm with a known-good graph to save indexing time; copies a whole repo subtree that happens to contain .gitnexus/; a fixture path collides with the hidden harness path.","solutions":["Remove any restricted path from sandbox_copy; the graph must be rebuilt inside the sandbox, not copied in.","If you copied a parent directory, enumerate only the non-restricted children explicitly.","Confirm the harness path you used is not HIDDEN_HARNESS_PATH or one of its ancestors.","Re-read the benchmark isolation contract: prebuilt graph/oracle data must never enter sandbox_copy."],"exampleFix":"# before\nsandbox_copy:\n  - .gitnexus/meta.json\n  - src/\n# after\nsandbox_copy:\n  - src/","handlingStrategy":"validation","validationCode":"from pathlib import PurePosixPath\n\nHIDDEN_HARNESS_PATH = \"eval/workflow_bench\"  # use the harness constant in real code\n\ndef is_restricted(value: str) -> bool:\n    rel = PurePosixPath(value)\n    if rel.is_absolute() or not rel.parts or \"..\" in rel.parts:\n        return False\n    return (rel.parts[0] == \".gitnexus\"\n            or rel == PurePosixPath(HIDDEN_HARNESS_PATH)\n            or PurePosixPath(HIDDEN_HARNESS_PATH) in rel.parents)\n\nbad = [v for v in task.get(\"sandbox_copy\", []) if isinstance(v, str) and is_restricted(v)]\nif bad:\n    raise SystemExit(f\"sandbox_copy leaks graph/harness data: {bad}\")","typeGuard":"from pathlib import PurePosixPath\n\ndef sandbox_copy_is_clean(values) -> bool:\n    for value in values:\n        rel = PurePosixPath(value)\n        if rel.is_absolute() or not rel.parts or \"..\" in rel.parts:\n            continue\n        if rel.parts[0] == \".gitnexus\":\n            return False\n    return True","tryCatchPattern":"try:\n    validate_no_prebuilt_graph_assets(task)\nexcept SandboxError as exc:\n    if \"cannot import prebuilt graph\" in str(exc):\n        log.error(\"sandbox_copy must not include .gitnexus/ or harness paths\")\n    raise","preventionTips":["Never list .gitnexus/ or harness paths in sandbox_copy.","Let the harness build the graph in-sandbox; do not seed it.","Review every sandbox_copy entry against _is_restricted_path before submission."],"tags":["sandbox","oracle-leak","task-spec","security","workflow-bench","gitnexus"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}