Skip to content

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

fix(tools): remove unused re-export and add MCP security policy test

Steven Enamakel7c2fa71add35
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/mod.rs b/crates/openhuman-core/src/agent/subagent_host/ops/mod.rs
index 0cc943e656..e38ee6410a 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/mod.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/mod.rs
@@ -24,7 +24,6 @@ mod pause_checkpoint;
// The checkpoint filename validator, shared with `continue_subagent`: the
// model-authored `task_id` must be rejected at the tool boundary as well as at
// the write, so the read path cannot traverse either.
-pub(crate) use graph::run_agent_turn_request_via_default_graph;
pub(crate) use pause_checkpoint::is_safe_task_id;
mod prompt;
mod provider;
diff --git a/crates/openhuman-core/src/tools/impl/network/mcp_server_tools_tests.rs b/crates/openhuman-core/src/tools/impl/network/mcp_server_tools_tests.rs
index a5a2c2ddf3..042d1ce18d 100644
--- a/crates/openhuman-core/src/tools/impl/network/mcp_server_tools_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/network/mcp_server_tools_tests.rs
@@ -124,6 +124,35 @@ async fn a_call_reaches_the_server_and_its_output_is_scrubbed() {
assert_eq!(result.text(), "goals for [redacted]");
}
+#[tokio::test]
+async fn act_policy_denial_prevents_configured_server_call() {
+ let mock = server().await;
+ let dir = tempfile::tempdir().unwrap();
+ let config = config(dir.path(), &format!("{}/mcp", mock.uri()), |_| {});
+ let registry = warmed(&config).await;
+ let denied = Arc::new(SecurityPolicy {
+ enabled: true,
+ autonomy: crate::security::AutonomyLevel::ReadOnly,
+ ..SecurityPolicy::default()
+ });
+ let tools = configured_server_tools(&config, &registry, &denied, &HashSet::new());
+ let read = tools
+ .iter()
+ .find(|tool| tool.name() == name("readGoals"))
+ .unwrap();
+
+ let result = read.execute(json!({ "list": "work" })).await.unwrap();
+ assert!(result.is_error);
+ assert!(result.text().contains("read-only mode"), "{}", result.text());
+ assert_eq!(tools_list_requests(&mock).await, 1);
+ let calls = mock.received_requests().await.unwrap_or_default();
+ assert!(!calls.iter().any(|request| {
+ serde_json::from_slice::<Value>(&request.body)
+ .map(|body| body["method"] == "tools/call")
+ .unwrap_or(false)
+ }));
+}
+
#[tokio::test]
async fn expose_direct_and_direct_tools_are_honoured() {
let mock = server().await;