mrg.bench¶
The RL-gym harness: declare a Sandbox, run a sandboxed agent, and let promotes
be brokered to silicon internally. Promotes are ungated unless you pass a
guard=.
manhattan_reasoning_gym.bench ¶
Trusted-side harness for running sandboxed agents against silicon (step 4).
This package runs OUTSIDE the sandbox container. You declare a :class:Sandbox
with your isolation + silicon params and call .run(); it launches the
untrusted container under a locked-down profile and brokers the agent's
promote-to-silicon requests internally. Nothing here runs untrusted agent code.
No promote gating is imposed by default — the agent decides what to promote, and
an operator can pass guard= if they want a check.
Sandbox ¶
A locked-down place to run a sandboxed agent, with a wired-up silicon path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
Sequence[str | Path]
|
files copied into the container's |
()
|
isolation
|
str | SandboxProfile
|
|
'locked'
|
silicon
|
str | SiliconFn
|
|
'auto'
|
api_key
|
str | None
|
passed to the cloud silicon backend. Stays in this trusted process — never in the container. |
None
|
api_url
|
str | None
|
passed to the cloud silicon backend. |
None
|
sys_clk_freq
|
int | None
|
passed to the cloud silicon backend. |
None
|
guard
|
Guard | None
|
optional |
None
|
image
|
str | None
|
override the sandbox docker image. |
None
|
Source code in _code/src/manhattan_reasoning_gym/bench/sandbox.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | |
run ¶
Launch the agent in the container and broker its promotes to silicon.
Creates a throwaway workspace, copies :attr:files in, runs
python /work/<entrypoint> under the isolation profile while an
internal loop answers promotes, then tears the workspace down.
Source code in _code/src/manhattan_reasoning_gym/bench/sandbox.py
SandboxResult
dataclass
¶
Outcome of a :meth:Sandbox.run.
Source code in _code/src/manhattan_reasoning_gym/bench/sandbox.py
SandboxProfile
dataclass
¶
The docker run constraints applied to the container.
Defaults are the locked-down profile: no egress, dropped capabilities,
read-only root, bounded memory/cpu/pids. Only the workspace mount and tmpfs
are writable. Use .locked() / .dev() for the named presets.
Source code in _code/src/manhattan_reasoning_gym/bench/launcher.py
argv ¶
argv(*, command: list[str], workspace: Path | str | None = None, mounts: tuple[tuple[str, str, str], ...] = ()) -> list[str]
Build the full docker run argv for one invocation.
workspace (if given) is mounted read-write at /work. mounts are
extra (src, dst, mode) bind mounts.
Source code in _code/src/manhattan_reasoning_gym/bench/launcher.py
locked
classmethod
¶
The default profile — for UNTRUSTED agent code and benchmark eval.
No network, no credentials, read-only root, dropped caps. Reproducible
and benchmark-valid. overrides tweak individual fields if needed.
Source code in _code/src/manhattan_reasoning_gym/bench/launcher.py
dev
classmethod
¶
TRUSTED experimentation only — relaxed, WITH internet.
For a developer (or your own agent) poking around on your machine with
your own key: network on, writable root, and your host MRG_API_KEY
forwarded in so mrg.cloud works directly.
Do NOT run untrusted agent code in this profile, and do NOT treat its results as benchmark scores — internet access makes them non-reproducible by definition.
Source code in _code/src/manhattan_reasoning_gym/bench/launcher.py
run_sandbox ¶
run_sandbox(command: list[str], *, workspace: Path | str | None = None, profile: SandboxProfile | None = None, mounts: tuple[tuple[str, str, str], ...] = (), timeout: int = 1800) -> subprocess.CompletedProcess[str]
Run command in the sandbox container (locked profile by default).