{"record":{"id":"087e65bea0d834b8","repo":"abhigyanpatwari/GitNexus","slug":"sandbox-dependency-cannot-expose-prebuilt-graph-or","errorCode":null,"errorMessage":"sandbox dependency cannot expose prebuilt graph or harness data: {value}","messagePattern":"sandbox dependency cannot expose prebuilt graph or harness data: (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"critical","filePath":"eval/workflow_bench/sanitized_graph.py","lineNumber":103,"sourceCode":"    \"\"\"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:\n        metadata = None\n    if metadata is not None:\n        if stat.S_ISDIR(metadata.st_mode):\n            raise SandboxError(f\"target-controlled {name} must not be a directory\")\n        path.unlink()\n    descriptor = os.open(\n        path,\n        os.O_WRONLY | os.O_CREAT | os.O_EXCL | getattr(os, \"O_NOFOLLOW\", 0),\n        0o600,\n    )\n    try:","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/sanitized_graph.py#L85-L121","documentation":"Information-leak guard for sandbox_dependencies, symmetric to error 554. For each dependency Mapping, both its 'source' and 'target' strings are checked by _is_restricted_path; either pointing at '.gitnexus', HIDDEN_HARNESS_PATH, or a descendant rejects the dependency. This blocks mounting a prebuilt graph or harness/oracle tree via the dependency mechanism.","triggerScenarios":"A sandbox_dependencies entry has source or target equal to or under .gitnexus/ or the hidden harness path. Non-Mapping entries are silently skipped; only Mapping items with string source/target are scanned.","commonSituations":"Author mounts a shared graph directory as a dependency to skip re-indexing; a target path was chosen to mirror the repo layout and accidentally lands under .gitnexus/; copying a dependency template that referenced harness paths.","solutions":["Change the source/target so neither component starts with .gitnexus and neither is the hidden harness path or beneath it.","If you need shared code, put it outside .gitnexus and reference that path.","Re-read the isolation contract: dependencies must not expose prebuilt graph or oracle/harness data.","Audit every dependency entry's source and target with the same _is_restricted_path rule."],"exampleFix":"# before\nsandbox_dependencies:\n  - source: .gitnexus/cache\n    target: .gitnexus/cache\n# after (drop the dependency; the graph is rebuilt in-sandbox)\nsandbox_dependencies: []","handlingStrategy":"validation","validationCode":"from pathlib import PurePosixPath\nfrom collections.abc import Mapping\n\nHIDDEN_HARNESS_PATH = \"eval/workflow_bench\"\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 = []\nfor item in task.get(\"sandbox_dependencies\", []):\n    if not isinstance(item, Mapping):\n        continue\n    for field in (\"source\", \"target\"):\n        v = item.get(field)\n        if isinstance(v, str) and is_restricted(v):\n            bad.append((field, v))\nif bad:\n    raise SystemExit(f\"dependencies leak graph/harness data: {bad}\")","typeGuard":"from pathlib import PurePosixPath\nfrom collections.abc import Mapping\n\ndef dependencies_are_clean(deps) -> bool:\n    for item in deps:\n        if not isinstance(item, Mapping):\n            continue\n        for field in (\"source\", \"target\"):\n            value = item.get(field)\n            if not isinstance(value, str):\n                continue\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 \"dependency cannot expose prebuilt graph\" in str(exc):\n        log.error(\"a dependency source/target points at .gitnexus/ or harness paths\")\n    raise","preventionTips":["Never point a dependency source/target at .gitnexus/ or harness paths.","Keep shared dependency trees outside .gitnexus/.","Run validate_no_prebuilt_graph_assets on every task 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-12T23:17:12.415Z"}