Skip to content

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

test(saas): cover unsafe tool allowlist rejection

Steven Enamakel5c3ec6869de8
diff --git a/tests/saas_mode_e2e.rs b/tests/saas_mode_e2e.rs
index 02504e50c6..de33323767 100644
--- a/tests/saas_mode_e2e.rs
+++ b/tests/saas_mode_e2e.rs
@@ -91,6 +91,25 @@ fn an_unsafe_deployment_is_refused_before_it_binds() {
);
}
+#[test]
+fn an_unsafe_tool_allowlist_is_refused_before_it_binds() {
+ let d = deployment(true);
+ std::fs::write(
+ &d.config,
+ format!(
+ "root = {:?}\ntool_allowlist = [\"coding\", \"host_shell\"]\n\n[sandbox]\nnetwork = \"host\"\n",
+ d.root.display().to_string()
+ ),
+ )
+ .unwrap();
+ let output = core_command(&d, &[]).output().expect("run openhuman-core");
+ assert!(!output.status.success(), "an unsafe allowlist must fail");
+ let stderr = String::from_utf8_lossy(&output.stderr);
+ assert!(stderr.contains("not tool groups"), "{stderr}");
+ assert!(stderr.contains("network `host`"), "{stderr}");
+ assert!(!d.root.join("operator").exists());
+}
+
#[test]
fn saas_mode_without_an_operator_config_is_refused() {
let output = Command::new(env!("CARGO_BIN_EXE_openhuman-core"))