Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore: files changed crates/openhuman-core/src/sandbox/docker_tests.rs

Steven Enamakel98cc2d2151d4
diff --git a/crates/openhuman-core/src/sandbox/docker_tests.rs b/crates/openhuman-core/src/sandbox/docker_tests.rs
index a097d94386..b887cb1cce 100644
--- a/crates/openhuman-core/src/sandbox/docker_tests.rs
+++ b/crates/openhuman-core/src/sandbox/docker_tests.rs
@@ -69,3 +69,28 @@ fn docker_backend_handle_maps_module_status_truthfully() {
assert_eq!(unavailable.kind, SandboxBackendKind::Docker);
assert_eq!(unavailable.status, SandboxStatus::Error);
}
+
+/// Container-side validation (host network, dangerous mounts) is enforced by
+/// the TinyBox module since contract 1.17; the host adapter must forward the
+/// policy unchanged so the module can refuse it.
+#[cfg(feature = "modules")]
+#[test]
+fn host_network_and_dangerous_mounts_reach_the_module_unfiltered() {
+ let mut policy = test_policy();
+ policy.workspace_root = PathBuf::from("/etc");
+ policy.read_only_mounts = vec![PathBuf::from("/var/run/docker.sock")];
+ policy.docker_overrides = Some(DockerOverrides {
+ network: Some("host".into()),
+ ..DockerOverrides::default()
+ });
+ let request = SandboxExecRequest {
+ command: "true".into(),
+ working_dir: PathBuf::from("/workspace"),
+ env: Default::default(),
+ timeout: std::time::Duration::from_secs(1),
+ };
+ let run = build_docker_request(&policy, &request).expect("adapter forwards policy");
+ assert_eq!(run.workspace, "/etc");
+ assert_eq!(run.network.as_deref(), Some("host"));
+ assert_eq!(run.read_only_mounts, vec!["/var/run/docker.sock".to_owned()]);
+}