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): source policy markers from tinytools
Steven Enamakelfaeaf0fcc2f5
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rsindex 4518a51120..77e0fe4bbc 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs@@ -29,7 +29,8 @@ use crate::security::credentials::HttpCredential;use crate::security::credentials::HttpCredentialsStore;use crate::security::SecurityPolicy;#[cfg(test)]-use crate::security::{GateDecision, POLICY_BLOCKED_MARKER};+use crate::security::GateDecision;+use tinytools::status::POLICY_BLOCKED_MARKER;use tinybox_bus::CommandClass;// The live Composio catalog and probe moved to `composio::catalog` -- the domaindiff --git a/crates/openhuman-core/src/flows/tinyflows/caps/tier.rs b/crates/openhuman-core/src/flows/tinyflows/caps/tier.rsindex a01310d462..ccece634ab 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::{GateDecision, SecurityPolicy, POLICY_BLOCKED_MARKER};+use crate::security::{GateDecision, SecurityPolicy};+use tinytools::status::POLICY_BLOCKED_MARKER;use tinybox_bus::CommandClass;/// Hard autonomy-tier gate for an *acting* flow node (Phase 2).diff --git a/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs b/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rsindex 0e41283654..2abad5502a 100644--- a/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs+++ b/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs@@ -1,5 +1,6 @@use super::*;-use crate::security::{AutonomyLevel, POLICY_BLOCKED_MARKER};+use crate::security::AutonomyLevel;+use tinytools::status::POLICY_BLOCKED_MARKER;use tempfile::TempDir;fn security(autonomy: AutonomyLevel) -> Arc<SecurityPolicy> {diff --git a/crates/openhuman-core/src/security/mod.rs b/crates/openhuman-core/src/security/mod.rsindex fdb24074a4..b7193b1d99 100644--- a/crates/openhuman-core/src/security/mod.rs+++ b/crates/openhuman-core/src/security/mod.rs@@ -47,7 +47,6 @@ pub use policy::ToolOperation;pub use policy::{ensure_openhuman_scratch_dir, openhuman_scratch_dir};#[allow(unused_imports)]pub use policy::{TrustedAccess, TrustedRoot};-pub use policy::{POLICY_BLOCKED_MARKER, POLICY_DENIED_MARKER};#[allow(unused_imports)]pub use {pairing::ensure_core_rpc_token_for_bind, pairing::is_public_bind, pairing::CoreBindTokenError,diff --git a/crates/openhuman-core/src/security/policy/command_checks.rs b/crates/openhuman-core/src/security/policy/command_checks.rsindex 8b95e71b31..712a348443 100644--- a/crates/openhuman-core/src/security/policy/command_checks.rs+++ b/crates/openhuman-core/src/security/policy/command_checks.rs@@ -2,7 +2,8 @@ use std::path::{Path, PathBuf};#[cfg(test)]use super::types::CommandRiskLevel;-use super::types::{AutonomyLevel, GateDecision, SecurityPolicy, POLICY_BLOCKED_MARKER};+use super::types::{AutonomyLevel, GateDecision, SecurityPolicy};+use tinytools::status::POLICY_BLOCKED_MARKER;#[cfg(test)]use crate::util::floor_char_boundary;use tinybox_bus::CommandClass;diff --git a/crates/openhuman-core/src/security/policy/enforcement.rs b/crates/openhuman-core/src/security/policy/enforcement.rsindex ed9c2a9e93..cc6907117c 100644--- a/crates/openhuman-core/src/security/policy/enforcement.rs+++ b/crates/openhuman-core/src/security/policy/enforcement.rs@@ -2,8 +2,8 @@ use std::path::Path;use super::types::{ActionTracker, AutonomyLevel, SecurityPolicy, ToolOperation, TrustedAccess, TrustedRoot,- POLICY_BLOCKED_MARKER,};+use tinytools::status::POLICY_BLOCKED_MARKER;use std::sync::Arc;use tokio::sync::OnceCell;diff --git a/crates/openhuman-core/src/security/policy/mod.rs b/crates/openhuman-core/src/security/policy/mod.rsindex f411af440d..5ef37682cc 100644--- a/crates/openhuman-core/src/security/policy/mod.rs+++ b/crates/openhuman-core/src/security/policy/mod.rs@@ -16,8 +16,7 @@ pub(crate) use path_checks::{};pub use types::{tool_result_artifacts_dir, ActionTracker, AutonomyLevel, CommandRiskLevel, GateDecision,- SecurityPolicy, ToolOperation, TrustedAccess, TrustedRoot, POLICY_BLOCKED_MARKER,- POLICY_DENIED_MARKER,+ SecurityPolicy, ToolOperation, TrustedAccess, TrustedRoot,};#[cfg(test)]diff --git a/crates/openhuman-core/src/security/policy/path_checks.rs b/crates/openhuman-core/src/security/policy/path_checks.rsindex bcafe0df41..30f7297e27 100644--- a/crates/openhuman-core/src/security/policy/path_checks.rs+++ b/crates/openhuman-core/src/security/policy/path_checks.rs@@ -1,6 +1,7 @@use std::path::{Path, PathBuf};-use super::types::{SecurityPolicy, TrustedAccess, POLICY_BLOCKED_MARKER};+use super::types::{SecurityPolicy, TrustedAccess};+use tinytools::status::POLICY_BLOCKED_MARKER;use super::types::{ACCOUNT_CONFIG_FILE, ARTIFACTS_DIR, ARTIFACT_TOOL_RESULTS_DIR, WORKSPACE_INTERNAL_DIRS,WORKSPACE_INTERNAL_FILES,diff --git a/crates/openhuman-core/src/security/policy/types.rs b/crates/openhuman-core/src/security/policy/types.rsindex 045101258e..f7c7cf4d50 100644--- a/crates/openhuman-core/src/security/policy/types.rs+++ b/crates/openhuman-core/src/security/policy/types.rs@@ -7,24 +7,6 @@ use std::sync::Arc;use std::time::Instant;use tokio::sync::OnceCell;-/// Stable, machine-recognizable marker prefixing a **permanent** policy-/// rejection: the identical `(tool, args)` call can never succeed in the-/// current tier (read-only blocking a write, a forbidden/credential path, a-/// disallowed high-risk or hidden-execution command, an off-allowlist command).-/// The agent harness's repeated-failure middleware-/// ([`crate::agent::tinyagents::middleware::RepeatedToolFailureMiddleware`])-/// detects this and halts on the **first verbatim repeat** rather than-/// reiterating a provably-futile call. Kept short and bracketed so it survives the-/// `Error: …` wrapping the tool layer adds and is easy to grep in logs.-pub const POLICY_BLOCKED_MARKER: &str = "[policy-blocked]";--/// Stable marker prefixing a **this-turn denial** — the user answered "no" to-/// an approval prompt, or the prompt timed out / its channel dropped. Unlike a-/// block this isn't permanent across turns, but re-issuing the *same* call this-/// turn just re-prompts the user, so the harness records it in the circuit-/// breaker and stops the agent from re-asking the identical call.-pub const POLICY_DENIED_MARKER: &str = "[policy-denied]";-/// How much autonomy the agent has#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]#[serde(rename_all = "lowercase")]diff --git a/crates/openhuman-core/src/tools/impl/filesystem/gate_tests.rs b/crates/openhuman-core/src/tools/impl/filesystem/gate_tests.rsindex 316850a3b7..ad40e3abb7 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/gate_tests.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/gate_tests.rs@@ -16,7 +16,8 @@ use tinytools_std::filesystem::{GitOperationsTool, GlobTool, GrepTool, ListFilesTool,};-use crate::security::{AutonomyLevel, SecurityPolicy, POLICY_BLOCKED_MARKER};+use crate::security::{AutonomyLevel, SecurityPolicy};+use tinytools::status::POLICY_BLOCKED_MARKER;fn policy(dir: &Path, autonomy: AutonomyLevel, max_actions_per_hour: u32) -> Arc<SecurityPolicy> {Arc::new(SecurityPolicy {diff --git a/crates/openhuman-core/src/tools/ops_tests_domain_family_tests.rs b/crates/openhuman-core/src/tools/ops_tests_domain_family_tests.rsindex 212d23aff1..49d2a7add9 100644--- a/crates/openhuman-core/src/tools/ops_tests_domain_family_tests.rs+++ b/crates/openhuman-core/src/tools/ops_tests_domain_family_tests.rs@@ -85,7 +85,8 @@ async fn all_tools_executes_stock_family_against_fake_backend() {/// needed to reach the `can_act()` check in each tool.#[tokio::test]async fn readonly_acting_tools_carry_policy_blocked_marker() {- use crate::security::{AutonomyLevel, POLICY_BLOCKED_MARKER};+ use crate::security::AutonomyLevel;+ use tinytools::status::POLICY_BLOCKED_MARKER;let tmp = TempDir::new().unwrap();let sec = Arc::new(SecurityPolicy {