{"record":{"id":"3fe04ea866ae0b8e","repo":"HKUDS/Vibe-Trading","slug":"manifest-path-manifest-path-is-outside-the-runti","errorCode":null,"errorMessage":"manifest path {manifest_path} is outside the runtime root and the allowed run roots; place the manifest under one of them (e.g. next to the runs it lists)","messagePattern":"manifest path (.+?) is outside the runtime root and the allowed run roots; place the manifest under one of them \\(e\\.g\\. next to the runs it lists\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/tools/strategy_discovery_tool.py","lineNumber":459,"sourceCode":"    runtime root or an allowed run root (same containment discipline as the\n    run_dir entries it names).\n\n    Raises:\n        ValueError: With an operator-facing message when the path escapes the\n            allowed roots, the file is missing or unreadable, is not valid\n            JSON, or has the wrong shape. The agent tool and the CLI share\n            this helper so both surfaces report the same failure the same\n            way.\n    \"\"\"\n    manifest_path = Path(str(path)).expanduser()\n    try:\n        resolved_manifest = manifest_path.resolve()\n    except (OSError, RuntimeError) as exc:\n        raise ValueError(\n            f\"manifest path {manifest_path} could not be resolved: {exc}\"\n        ) from exc\n    if not _manifest_path_allowed(resolved_manifest):\n        raise ValueError(\n            f\"manifest path {manifest_path} is outside the runtime root and \"\n            \"the allowed run roots; place the manifest under one of them \"\n            \"(e.g. next to the runs it lists)\"\n        )\n    try:\n        raw = manifest_path.read_text(encoding=\"utf-8\")\n    except OSError as exc:\n        raise ValueError(\n            f\"manifest file {manifest_path} is missing or unreadable \"\n            f\"({exc.strerror or 'I/O error'})\"\n        ) from exc\n    try:\n        parsed = json.loads(raw)\n    except json.JSONDecodeError as exc:\n        raise ValueError(\n            f\"manifest file {manifest_path} is not valid JSON: {exc.msg} \"\n            f\"at line {exc.lineno} column {exc.colno}\"\n        ) from exc","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/tools/strategy_discovery_tool.py#L441-L477","documentation":"After resolving the manifest path, load_manifest checks it against _manifest_path_allowed(): the resolved path must live under the runtime root or one of the configured allowed run roots. Paths outside these roots are rejected via ValueError. This is a sandbox/path-traversal guard keeping manifest loading inside approved directories.","triggerScenarios":"Passing an absolute path like \"/etc/evil/manifest.json\" or a relative one like \"../../outside/manifest.json\" whose resolved location escapes the runtime root and allowed run roots; using /tmp paths that are not allowlisted.","commonSituations":"Operators pointing at a manifest stored next to unrelated run outputs outside the sandbox; CI copying manifests to arbitrary temp dirs; relative paths resolved against an unexpected CWD that lands outside allowed roots.","solutions":["Move the manifest under the runtime root or one of the allowed run roots (the error suggests placing it next to the runs it lists)","Check _manifest_path_allowed / the tool's configuration to see which roots are allowed, and extend the allowlist if legitimate","Use a path relative to the runtime root rather than absolute paths elsewhere on disk"],"exampleFix":"# before\ncore(manifest_path=\"/home/me/manifest.json\", ...)\n# after\n# copy next to the runs it references, inside an allowed run root\ncore(manifest_path=\"runs/2024-06-01/manifest.json\", ...)","handlingStrategy":"validation","validationCode":"from pathlib import Path\nfrom agent.src.tools.strategy_discovery_tool import _manifest_path_allowed\nif not _manifest_path_allowed(Path(manifest_path).resolve()):\n    raise ValueError(\"manifest must live under the runtime root or an allowed run root\")\ncore(manifest_path=manifest_path, ...)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep manifests next to the run directories they reference","Don't reference absolute paths outside the configured run roots"],"tags":["strategy-discovery","manifest","path-allowlist","sandbox"],"backgroundTag":"path-outside-allowed-root","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}