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
refactor(security): import CommandClass from tinybox_bus
Steven Enamakel7515371cb1ef
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs b/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rsindex 62db1e97f0..80dd532fd0 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs@@ -83,7 +83,8 @@ use tinyagents_harness::host::security_gate::{GateDecision, ToolCallRequest};use crate::agent::tinyagents::policy_denial::PolicyDenial;use crate::security::approval::{redact_args, summarize_action, ApprovalGate, GateOutcome};-use crate::security::policy::{CommandClass, GateDecision as PolicyGateDecision, SecurityPolicy};+use crate::security::policy::{GateDecision as PolicyGateDecision, SecurityPolicy};+use tinybox_bus::shell::CommandClass;use crate::tools::agent_policy::{ToolPolicyAction, ToolPolicySession};use tinytools::{PermissionLevel, Tool};diff --git a/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rsindex d53461db51..b2df0e688e 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs@@ -69,7 +69,7 @@ fn req(tool_name: &str, args: serde_json::Value) -> ToolCallRequest {#[cfg(feature = "modules")]fn shell_context(args: &serde_json::Value,- class: crate::modules::tinybox::contract::CommandClass,+ class: tinybox_bus::shell::CommandClass,hidden_execution: bool,literal_words: &[&str],) -> serde_json::Value {@@ -80,7 +80,7 @@ fn shell_context(fn shell_context_for_args(request_arguments: &serde_json::Value,effective_arguments: &serde_json::Value,- class: crate::modules::tinybox::contract::CommandClass,+ class: tinybox_bus::shell::CommandClass,hidden_execution: bool,literal_words: &[&str],) -> serde_json::Value {@@ -118,7 +118,7 @@ fn shell_context_for_args(#[cfg(feature = "modules")]fn shell_analysis(- class: crate::modules::tinybox::contract::CommandClass,+ class: tinybox_bus::shell::CommandClass,hidden_execution: bool,literal_words: &[&str],) -> serde_json::Value {@@ -227,7 +227,7 @@ async fn a_read_class_shell_command_runs_without_a_prompt() {&req(SHELL_TOOL, args.clone()),Some(&shell_context(&args,- crate::modules::tinybox::contract::CommandClass::Read,+ tinybox_bus::shell::CommandClass::Read,false,&["ls", "-la"],)),@@ -292,7 +292,7 @@ fn shell_policy_uses_the_effective_arguments_bound_by_the_harness() {let context = shell_context_for_args(&request_arguments,&effective_arguments,- crate::modules::tinybox::contract::CommandClass::Write,+ tinybox_bus::shell::CommandClass::Write,false,&["touch", "output"],);@@ -320,7 +320,7 @@ async fn a_read_class_shell_command_still_runs_in_read_only_mode() {&req(SHELL_TOOL, args.clone()),Some(&shell_context(&args,- crate::modules::tinybox::contract::CommandClass::Read,+ tinybox_bus::shell::CommandClass::Read,false,&["ls", "-la"],)),@@ -339,7 +339,7 @@ async fn a_write_shell_command_is_blocked_outright_in_read_only() {&req(SHELL_TOOL, args.clone()),Some(&shell_context(&args,- crate::modules::tinybox::contract::CommandClass::Write,+ tinybox_bus::shell::CommandClass::Write,false,&["rm", "-rf", "/tmp/x"],)),@@ -364,7 +364,7 @@ async fn hidden_execution_is_blocked_below_the_full_tier() {&req(SHELL_TOOL, args.clone()),Some(&shell_context(&args,- crate::modules::tinybox::contract::CommandClass::Write,+ tinybox_bus::shell::CommandClass::Write,true,&["echo"],)),@@ -387,7 +387,7 @@ fn the_declared_category_can_only_raise_the_command_class() {&full,&json!({ "command": "touch f" }),&shell_analysis(- crate::modules::tinybox::contract::CommandClass::Write,+ tinybox_bus::shell::CommandClass::Write,false,&["touch", "f"],),@@ -400,7 +400,7 @@ fn the_declared_category_can_only_raise_the_command_class() {&full,&json!({ "command": "touch f", "category": "destructive" }),&shell_analysis(- crate::modules::tinybox::contract::CommandClass::Write,+ tinybox_bus::shell::CommandClass::Write,false,&["touch", "f"],)@@ -414,7 +414,7 @@ fn the_declared_category_can_only_raise_the_command_class() {&full,&json!({ "command": "curl https://example.invalid", "category": "read" }),&shell_analysis(- crate::modules::tinybox::contract::CommandClass::Network,+ tinybox_bus::shell::CommandClass::Network,false,&["curl", "https://example.invalid"],)@@ -432,7 +432,7 @@ fn a_missing_command_argument_classifies_as_read_rather_than_panicking() {&supervised,&json!({}),&shell_analysis(- crate::modules::tinybox::contract::CommandClass::Read,+ tinybox_bus::shell::CommandClass::Read,false,&[],),diff --git a/crates/openhuman-core/src/flows/ops/approval_manifest.rs b/crates/openhuman-core/src/flows/ops/approval_manifest.rsindex 796e3aae03..7bacff57c9 100644--- a/crates/openhuman-core/src/flows/ops/approval_manifest.rs+++ b/crates/openhuman-core/src/flows/ops/approval_manifest.rs@@ -35,7 +35,8 @@ use super::*;/// listing them would request grants that are never checked.pub async fn compute_approval_manifest(config: &Config, graph: &WorkflowGraph) -> Vec<Value> {use crate::flows::tinyflows::caps::classify_composio_action_for_tier;- use crate::security::{CommandClass, GateDecision, SecurityPolicy};+ use crate::security::{GateDecision, SecurityPolicy};+ use tinybox_bus::shell::CommandClass;let security =SecurityPolicy::from_config(&config.autonomy, &config.workspace_dir, &config.action_dir);diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/code.rs b/crates/openhuman-core/src/flows/tinyflows/caps/code.rsindex 749d74c3c5..c0f18e542b 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/code.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/code.rs@@ -16,7 +16,8 @@ use super::*;use crate::agent::harness::definition::SandboxMode;use crate::config::Config;use crate::sandbox::{execute_in_sandbox, resolve_sandbox_policy};-use crate::security::{CommandClass, SecurityPolicy};+use crate::security::{SecurityPolicy};+use tinybox_bus::shell::CommandClass;/// [`CodeRunner`] adapter running sandboxed user code via/// `crates/openhuman-core/src/sandbox/ops.rs` (`resolve_sandbox_policy` +diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs b/crates/openhuman-core/src/flows/tinyflows/caps/http.rsindex 01719f265a..c9c314913f 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/http.rs@@ -19,7 +19,8 @@ use tinyflows::error::{EngineError, Result};use super::*;use crate::config::{Config, HttpRequestConfig};use crate::security::credentials::{HttpCredential, HttpCredentialsStore};-use crate::security::{CommandClass, SecurityPolicy};+use crate::security::{SecurityPolicy};+use tinybox_bus::shell::CommandClass;use crate::tools::http_request_tool;use tinytools::Tool as _;diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rsindex e1bbe80d2b..d939166a71 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs@@ -27,7 +27,8 @@ use crate::flows;#[cfg(test)]use crate::security::credentials::HttpCredential;use crate::security::credentials::HttpCredentialsStore;-use crate::security::{CommandClass, SecurityPolicy};+use crate::security::{SecurityPolicy};+use tinybox_bus::shell::CommandClass;#[cfg(test)]use crate::security::{GateDecision, POLICY_BLOCKED_MARKER};diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/tier.rs b/crates/openhuman-core/src/flows/tinyflows/caps/tier.rsindex cf911a0f6b..63b5a6baa1 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/tier.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/tier.rs@@ -8,7 +8,8 @@use serde_json::Value;use tinyflows::error::{EngineError, Result};-use crate::security::{CommandClass, GateDecision, SecurityPolicy, POLICY_BLOCKED_MARKER};+use crate::security::{GateDecision, SecurityPolicy, POLICY_BLOCKED_MARKER};+use tinybox_bus::shell::CommandClass;/// Hard autonomy-tier gate for an *acting* flow node (Phase 2).///diff --git a/crates/openhuman-core/src/security/policy/command_checks.rs b/crates/openhuman-core/src/security/policy/command_checks.rsindex 5480f6afdc..69c70919ec 100644--- a/crates/openhuman-core/src/security/policy/command_checks.rs+++ b/crates/openhuman-core/src/security/policy/command_checks.rs@@ -2,12 +2,10 @@ use std::path::{Path, PathBuf};#[cfg(test)]use super::types::CommandRiskLevel;-use super::types::{- AutonomyLevel, GateDecision, SecurityPolicy, POLICY_BLOCKED_MARKER,-};-use tinybox_bus::shell::CommandClass;+use super::types::{AutonomyLevel, GateDecision, SecurityPolicy, POLICY_BLOCKED_MARKER};#[cfg(test)]use crate::util::floor_char_boundary;+use tinybox_bus::shell::CommandClass;#[cfg(test)]use tinybox_core::shell::classify::{classify_segment, has_hidden_execution};#[cfg(test)]diff --git a/crates/openhuman-core/src/security/policy/proptest_tests.rs b/crates/openhuman-core/src/security/policy/proptest_tests.rsindex 096aac4fb1..579c0bb02e 100644--- a/crates/openhuman-core/src/security/policy/proptest_tests.rs+++ b/crates/openhuman-core/src/security/policy/proptest_tests.rs@@ -5,7 +5,8 @@//! handful of fail-closed invariants that must hold for *all* inputs, not just//! the hand-enumerated cases in `policy_tests.rs`.-use super::types::{CommandClass, SecurityPolicy};+use super::types::SecurityPolicy;+use tinybox_bus::shell::CommandClass;use proptest::prelude::*;proptest! {diff --git a/crates/openhuman-core/src/tools/impl/filesystem/gate.rs b/crates/openhuman-core/src/tools/impl/filesystem/gate.rsindex 3ae735ce0e..06714ed8ff 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/gate.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/gate.rs@@ -11,6 +11,7 @@ use async_trait::async_trait;use tinytools_std::filesystem::FsGate;use crate::security::policy::{TrustedAccess, TrustedRoot};+use tinybox_bus::shell::CommandClass;use crate::security::{AutonomyLevel, CommandClass, GateDecision, SecurityPolicy};/// Clone `security` and scope it to `root`, a run's workspace descriptor root.diff --git a/crates/openhuman-core/src/tools/impl/network/gate.rs b/crates/openhuman-core/src/tools/impl/network/gate.rsindex 3ff0260a33..c91fa42d4e 100644--- a/crates/openhuman-core/src/tools/impl/network/gate.rs+++ b/crates/openhuman-core/src/tools/impl/network/gate.rs@@ -10,7 +10,8 @@ use tinytools_std::network::NetGate;use crate::security::egress::{emit_external_transfer, local_only_tool_block, DataKind, EgressDescriptor,};-use crate::security::{CommandClass, GateDecision, SecurityPolicy};+use crate::security::{GateDecision, SecurityPolicy};+use tinybox_bus::shell::CommandClass;/// Build the egress descriptor for an outbound HTTP request (privacy epic S2,/// #4436). The host is the destination; a request body carries tool argumentsdiff --git a/crates/openhuman-core/src/tools/impl/system/shell_tests.rs b/crates/openhuman-core/src/tools/impl/system/shell_tests.rsindex a77e83592b..a372564f88 100644--- a/crates/openhuman-core/src/tools/impl/system/shell_tests.rs+++ b/crates/openhuman-core/src/tools/impl/system/shell_tests.rs@@ -1,7 +1,8 @@use super::super::shell_platform::{PYTHON_UTF8_DEFAULTS, SAFE_ENV_VARS};use super::*;use crate::agent::host_runtime::{NativeRuntime, RuntimeAdapter};-use crate::security::{AutonomyLevel, CommandClass, SecurityPolicy};+use crate::security::{AutonomyLevel, SecurityPolicy};+use tinybox_bus::shell::CommandClass;fn test_security(autonomy: AutonomyLevel) -> Arc<SecurityPolicy> {Arc::new(SecurityPolicy {diff --git a/crates/openhuman-core/src/tools/native_ops.rs b/crates/openhuman-core/src/tools/native_ops.rsindex fe1e692068..f32b043fd4 100644--- a/crates/openhuman-core/src/tools/native_ops.rs+++ b/crates/openhuman-core/src/tools/native_ops.rs@@ -5,7 +5,8 @@ use crate::agent::host_runtime::{NativeRuntime, RuntimeAdapter};use crate::config::Config;use crate::core::bus::BUS;use crate::core::events::DomainEvent;-use crate::security::{CommandClass, SecurityPolicy};+use crate::security::{SecurityPolicy};+use tinybox_bus::shell::CommandClass;use crate::tools;use crate::tools::native_ops_types::{ExecuteToolOutcome, RuntimeToolSummary};use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolScope};