Docker: verifier log mounts are chmod 777 (no sticky), so rewardkit sandboxed graders die before writing a reward
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
The fix sits in environments/base.py, in _ensure_dirs_command and _empty_dirs_command where chmod 777 is applied to the verifier log mounts, with _reset_dirs_command also named. Start by reading how these commands build the mkdir/chmod string, then reproduce the rewardkit parent-trust check in a root container with /logs at 777 versus 1777. Done means the mounts and their parents are sticky (1777) and a sandboxed rewardkit grader writes its reward file under the local Docker path.
Written by the indexing model from the issue text.
Description
The bug
On the local Docker path, Harbor prepares the verifier log mounts with chmod 777 (no sticky bit), and harbor-rewardkit>=0.2.x refuses to start a sandboxed programmatic grader under a parent directory that is group/other-writable unless it is sticky. The grader dies before it can write a reward file, and Harbor reports RewardFileNotFoundError. Symptom: the trial errors with no reward at all, which looks like a task/verifier failure rather than a runner bug.
Two sides of the contract:
harbor-rewardkit==0.2.4(the version pinned intests/pyproject.tomlof the affected tasks) —sandbox.py:private_paths: tuple[Path, ...] = (Path("/tests"), Path("/logs/verifier")) … owners = {_secure_directory(path, 0o700) for path in self.private_paths} … # _open_directory(path, trusted=True, create=True): # "every parent must be root-owned and not writable by others, or sticky like /tmp" if trusted and (parent.st_uid != 0 or (parent.st_mode & 0o022 and not parent.st_mode & stat.S_ISVTX)): raise PermissionError(f"Untrusted parent directory of {path}")- Harbor 0.27.0
environments/base.pycreates exactly those mounts with a non-stickychmod 777:command = f"mkdir -p {create_args}" if chmod: command += f" && chmod 777 {create_args}"
Measured state inside a failing verifier container (<task>__<id>__verifier__trial-main-1, uid 0, no bind mount involved):
/ uid=0 mode=755
/logs uid=0 mode=777 ← parent of /logs/verifier, not sticky
/logs/verifier uid=0 mode=777
→ rewardkit.sandbox.WorkerSetupError: Invalid private path: Untrusted parent directory of /logs/verifier → no reward.txt/reward.json → harbor.verifier.verifier.RewardFileNotFoundError.
Reproduction (no task, no agent, no model token)
Extract the harbor-rewardkit==0.2.4 sdist (sha256 3e8db9a5cd0dace49a3f0dbad7b52ad4edb4baca3b20446b421af2e34cad87ab) and run rewardkit's own guard in a root Linux container, varying only the parent mode:
harbor 777 -> PermissionError: Untrusted parent directory of /logs/verifier
sticky 1777 -> ACCEPTED
default 755 -> ACCEPTED
import importlib.util, sys
from pathlib import Path
spec = importlib.util.spec_from_file_location("rk_sandbox", "/rk/sandbox.py")
rk = importlib.util.module_from_spec(spec); sys.modules["rk_sandbox"] = rk; spec.loader.exec_module(rk)
rk._secure_directory(Path("/logs/verifier"), 0o700) # with /logs chmod'd 777
Exposure, measured over a full pinned Terminal-Bench 4.1.0 tree
harbor run -p tasks --agent oracle -k 1 -n 2 -r 0 (66 tasks): with the unpatched runner, html-js-filter errored with RewardFileNotFoundError; 17 of 68 tasks invoke the sandboxed rewardkit runner (python -I -m rewardkit /tests --max-concurrent-programmatic …). Exposure is per-task (e.g. production-planning, same runner, passed unpatched), so it is not always fatal — but when it fires it is indistinguishable from a broken task.
After patching the chmods as below, all 17 sandboxed-runner tasks came back clean at reward 1.0, including 5/5 stable repeats on html-js-filter (175/177/178 s, ±2 %). A single earlier attempt at this dataset on the same host class ended with 66/66 trials errored, which this bug explains cleanly.
Proposed fix
Make the log mounts sticky, like /tmp, and cover the parent directories too, since rewardkit validates the whole parent chain:
_ensure_dirs_command:chmod 777 …→chmod 1777 …, pluschmod 1777onPath(d).parentfor each mount target._empty_dirs_command: same substitution.- (The third
chmod 777site in_reset_dirs_commandappears unused in 0.27.0.)
This is exactly the state rewardkit's own docstring blesses ("or sticky like /tmp"), keeps the world-writability Harbor needs for non-root verifier users, and changes no task content, no scoring and no agent-visible state.
Alternatives considered: relaxing rewardkit's parent-trust rule (weaker — it is a real privilege-escalation guard, and it is right); not bind-mounting log dirs locally and falling back to docker compose cp (bigger change, slower); requiring Modal (upstream CI's layout differs, and cloud-only is unusable for local single-tenant runs).
Environment
- harbor 0.27.0 (PyPI; newest at time of writing — 0.26.0 carries the same
chmod 777sites) - harbor-rewardkit 0.2.4 (pinned by the tasks)
- Terminal-Bench tag
v4.1.0=4070d6cef56a7d20cb5dc98d5e10ada88a6b9440 - Docker 29.8.2 (API 1.56) via OrbStack 2.2.5 on macOS/arm64;
--env docker,-k 1,--agent oracle(no model involved)
Adjacent (different root cause, same log-directory theme): #3579, #1632, #2551.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 1.9k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 156
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from harbor-framework/harbor
-
Trial runs the agent's `populate_context_post_run` on the event loop, so trials that end together stall the orchestrator for secondsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
harbor-framework/harbor#4652 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
harbor-framework/harbor#4494 · 1 comment ·
Maintainers usually reply within 1 day
-
step workdir upload resets the work folder's owner and permissions in ModalPossibly taken @Sauvi72 claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
harbor-framework/harbor#4487 · 3 comments ·
Maintainers usually reply within 1 day
-
Compare and Pareto hide total token usage when the cached token count is missingPossibly taken @Aafimalek claimed this 10 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
harbor-framework/harbor#4448 ·
Maintainers usually reply within 1 day
-
Viewer trial file listing returns 500 when a trial contains a dangling symlinkPossibly taken @lx6800 claimed this 10 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
harbor-framework/harbor#4429 ·
Maintainers usually reply within 1 day
All issues in harbor-framework/harbor
Similar issues
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwisePossibly taken @abdulwaarith0 claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
MakazhanAlpamys/Soup#3690 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug data-types native-format
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ClickHouse/clickhouse-connect#1320 ·
Maintainers usually reply within 1 day
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
future-agi/future-agi#6392 ·
Maintainers usually reply within 1 day