From 7962ae71497019f90395087b2a63863b15075f42 Mon Sep 17 00:00:00 2001 From: sergiopaniego Date: Wed, 25 Nov 2026 17:34:27 +0100 Subject: [PATCH 1/2] Download the ThinkingBox benchmark from the public copy microsoft/thinkingbox-data now returns 404, so the environment could not fetch its data. Microsoft's ThinkingBox post links the benchmark to MrSergSanch/thinkingbox-data, which has the pinned commit. The bundle and manifest hashes still pin the exact thinkingbox-bench-v1.0 release. --- docs/source/environments/thinkingbox.md | 19 +++++++++++-------- envs/thinkingbox_env/README.md | 19 +++++++++++-------- envs/thinkingbox_env/models.py | 4 +++- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/docs/source/environments/thinkingbox.md b/docs/source/environments/thinkingbox.md index df4fbc128b..4a99cc3154 100644 --- a/docs/source/environments/thinkingbox.md +++ b/docs/source/environments/thinkingbox.md @@ -86,11 +86,14 @@ because tasks are selected deterministically by UID. Concurrent sessions are stacked independent environment instances, one trajectory per instance; they are not multiplexed trajectories. -Executable assets come from the pinned `thinkingbox-bench-v1.0` release in -[`microsoft/thinkingbox-data`](https://github.com/microsoft/thinkingbox-data). -The [Hugging Face `microsoft/ThinkingBox-Bench` -dataset](https://huggingface.co/datasets/microsoft/ThinkingBox-Bench) is a -viewer-friendly representation, while GitHub remains the executable source. +Executable assets come from the pinned `thinkingbox-bench-v1.0` release, +downloaded from +[`MrSergSanch/thinkingbox-data`](https://github.com/MrSergSanch/thinkingbox-data), +the copy linked from Microsoft's +[ThinkingBox post](https://huggingface.co/blog/microsoft/thinkingbox). The +environment checks the bundle against its pinned SHA-256, so it only accepts +that release. `microsoft/thinkingbox-data` and the Hugging Face +`microsoft/ThinkingBox-Bench` viewer dataset are not public at the moment. ## Configuration @@ -131,9 +134,9 @@ Please cite the paper if ThinkingBox is useful in your experiments. for Agents in Stateful Business Workflows](https://arxiv.org/abs/2608.19741) - Framework: [`microsoft/thinkingbox`](https://github.com/microsoft/thinkingbox) - Executable benchmark: - [`microsoft/thinkingbox-data`](https://github.com/microsoft/thinkingbox-data) -- Viewer dataset: - [`microsoft/ThinkingBox-Bench`](https://huggingface.co/datasets/microsoft/ThinkingBox-Bench) + [`MrSergSanch/thinkingbox-data`](https://github.com/MrSergSanch/thinkingbox-data) + (`microsoft/thinkingbox-data` is not public at the moment) +- Blog post: [ThinkingBox on Hugging Face](https://huggingface.co/blog/microsoft/thinkingbox) ```bibtex @misc{li2026successisntreliabilitythinkingbox, diff --git a/envs/thinkingbox_env/README.md b/envs/thinkingbox_env/README.md index 0b4289e8cd..e40c058d3d 100644 --- a/envs/thinkingbox_env/README.md +++ b/envs/thinkingbox_env/README.md @@ -97,11 +97,14 @@ because tasks are selected deterministically by UID. Concurrent sessions are stacked independent environment instances, one trajectory per instance; they are not multiplexed trajectories. -Executable assets come from the pinned `thinkingbox-bench-v1.0` release in -[`microsoft/thinkingbox-data`](https://github.com/microsoft/thinkingbox-data). -The [Hugging Face `microsoft/ThinkingBox-Bench` -dataset](https://huggingface.co/datasets/microsoft/ThinkingBox-Bench) is a -viewer-friendly representation, while GitHub remains the executable source. +Executable assets come from the pinned `thinkingbox-bench-v1.0` release, +downloaded from +[`MrSergSanch/thinkingbox-data`](https://github.com/MrSergSanch/thinkingbox-data), +the copy linked from Microsoft's +[ThinkingBox post](https://huggingface.co/blog/microsoft/thinkingbox). The +environment checks the bundle against its pinned SHA-256, so it only accepts +that release. `microsoft/thinkingbox-data` and the Hugging Face +`microsoft/ThinkingBox-Bench` viewer dataset are not public at the moment. ## Configuration @@ -142,9 +145,9 @@ Please cite the paper if ThinkingBox is useful in your experiments. for Agents in Stateful Business Workflows](https://arxiv.org/abs/2608.19741) - Framework: [`microsoft/thinkingbox`](https://github.com/microsoft/thinkingbox) - Executable benchmark: - [`microsoft/thinkingbox-data`](https://github.com/microsoft/thinkingbox-data) -- Viewer dataset: - [`microsoft/ThinkingBox-Bench`](https://huggingface.co/datasets/microsoft/ThinkingBox-Bench) + [`MrSergSanch/thinkingbox-data`](https://github.com/MrSergSanch/thinkingbox-data) + (`microsoft/thinkingbox-data` is not public at the moment) +- Blog post: [ThinkingBox on Hugging Face](https://huggingface.co/blog/microsoft/thinkingbox) ```bibtex @misc{li2026successisntreliabilitythinkingbox, diff --git a/envs/thinkingbox_env/models.py b/envs/thinkingbox_env/models.py index e72debbac1..7856ca20d9 100644 --- a/envs/thinkingbox_env/models.py +++ b/envs/thinkingbox_env/models.py @@ -15,7 +15,9 @@ DATA_BUNDLE_SHA256 = "16803d95d161ca06309d95f0dbbcbbb7b3fdf8a61e2b4eacfe920781b12f18ff" DATA_MANIFEST_PATH = "releases/thinkingbox_bench_v1/testlist_thinkingbox_bench_v1.yaml" DATA_ARCHIVE_URL = ( - f"https://codeload.github.com/microsoft/thinkingbox-data/tar.gz/{DATA_COMMIT}" + # microsoft/thinkingbox-data is not public. This is the copy Microsoft's + # ThinkingBox post links, DATA_BUNDLE_SHA256 checks it is the pinned release. + f"https://codeload.github.com/MrSergSanch/thinkingbox-data/tar.gz/{DATA_COMMIT}" ) From 9c6f14cce405b4ea89a2c4c988b50165bfea1df6 Mon Sep 17 00:00:00 2001 From: sergiopaniego Date: Wed, 25 Nov 2026 17:46:01 +0100 Subject: [PATCH 2/2] Do not extract bytecode the ThinkingBox bundle hash skips _bundle_sha256 ignores __pycache__, .pyc and .pyo, but extraction wrote them to the cache, so an archive could carry unverified bytecode next to the bundled servers. Extraction now skips them, so everything it writes is covered by the pinned hash. --- envs/thinkingbox_env/benchmark_data.py | 4 ++++ tests/envs/test_thinkingbox_env.py | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/envs/thinkingbox_env/benchmark_data.py b/envs/thinkingbox_env/benchmark_data.py index c8912a1149..62ec40c6d8 100644 --- a/envs/thinkingbox_env/benchmark_data.py +++ b/envs/thinkingbox_env/benchmark_data.py @@ -305,6 +305,10 @@ def _extract_archive(archive: Path, destination: Path) -> None: relative_parts = path.parts[1:] if not relative_parts or relative_parts[0] not in _ALLOWED_TOP_LEVELS: continue + # _bundle_sha256 does not hash bytecode, so never extract it: an + # unverified .pyc next to the bundled servers could be imported. + if "__pycache__" in relative_parts or path.suffix in {".pyc", ".pyo"}: + continue if ( member.issym() or member.islnk() diff --git a/tests/envs/test_thinkingbox_env.py b/tests/envs/test_thinkingbox_env.py index 10e252fa5e..17c3deeee6 100644 --- a/tests/envs/test_thinkingbox_env.py +++ b/tests/envs/test_thinkingbox_env.py @@ -1753,6 +1753,31 @@ def test_archive_extraction_keeps_safe_members_beneath_destination( assert not (destination / "README.md").exists() +def test_archive_extraction_skips_bytecode_the_bundle_hash_ignores( + tmp_path: Path, +) -> None: + archive = tmp_path / "bytecode.tar.gz" + payload = b"bytes" + with tarfile.open(archive, "w:gz") as output: + for name in ( + "root/servers/tool.py", + "root/servers/__pycache__/tool.cpython-312.pyc", + "root/dataset/case.pyc", + "root/dataset/case.pyo", + ): + member = tarfile.TarInfo(name) + member.size = len(payload) + output.addfile(member, io.BytesIO(payload)) + + destination = tmp_path / "out" + _extract_archive(archive, destination) + + assert (destination / "servers/tool.py").read_bytes() == payload + assert not (destination / "servers/__pycache__").exists() + assert not (destination / "dataset/case.pyc").exists() + assert not (destination / "dataset/case.pyo").exists() + + def test_archive_extraction_rejects_resolved_target_escape(tmp_path: Path) -> None: archive = tmp_path / "symlink-parent.tar.gz" payload = b"bad"