The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
feat(agent): apply session tool rules per turn
Steven Enamakelf41ebfc8d26a
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session.rs b/crates/openhuman-core/src/agent/session_host/runtime_session.rsindex a1353326f4..2f1c730d91 100644--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs@@ -93,6 +93,10 @@ struct OpenHumanTurnPrelude {allowed_subagent_ids: std::collections::HashSet<String>,sandbox_mode: crate::agent::harness::definition::SandboxMode,runtime_config: Option<Arc<crate::config::Config>>,+ /// This session's tool-rule layers (`crate::tools::rules::session_rule_set`):+ /// the operator's `[tool_rules]` and the agent definition's layer. Each+ /// turn evaluates them in its own channel/agent/origin context.+ tool_rules: Arc<tinytools::ToolRuleSet>,/// The one authoritative, request-refreshable composition of executable/// tools, policy, and provider schema. Generic runtime owns the immutable/// `ToolSnapshot`; this host surface is the source used to create it.@@ -1021,6 +1025,10 @@ impl OpenHumanSessionHost {.map(|definition| definition.sandbox_mode).unwrap_or(crate::agent::harness::definition::SandboxMode::None),runtime_config: self.runtime_config.clone(),+ tool_rules: Arc::new(crate::tools::rules::session_rule_set(+ self.runtime_config.as_deref(),+ self.resolved_definition().as_deref(),+ )),tool_surface: Arc::new(std::sync::Mutex::new(OpenHumanTurnToolSurface {tools: self.tools.clone(),synthesized_tools: self.synthesized_tools.clone(),@@ -1192,6 +1200,24 @@ impl OpenHumanSessionHost {}options.run_context.data.current_synthesized_tools =Some(current_synthesized_tools);+ if !prelude.tool_rules.is_permissive() {+ let origin = options+ .run_context+ .data+ .origin+ .as_ref()+ .map(crate::agent::turn_origin::AgentTurnOrigin::class);+ let context = crate::tools::rules::rule_context(+ Some(&policy_channel),+ Some(&prelude.agent_definition_id),+ origin.as_deref(),+ );+ options.run_context.data.tool_rules =+ Some(Arc::new(crate::tools::rules::turn_rule_policy(+ prelude.tool_rules.clone(),+ context,+ )));+ }options.run_context.data.tool_policy =Some(crate::agent::tinyagents::ToolPolicyEnforcement {policy: prelude.tool_policy.clone(),