Skip to content

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

fix(policy): allow all paths when policy is disabled

Steven Enamakelda2521c65847
diff --git a/crates/openhuman-core/src/security/policy/path_checks.rs b/crates/openhuman-core/src/security/policy/path_checks.rs
index 84a9624da8..29f686a4d1 100644
--- a/crates/openhuman-core/src/security/policy/path_checks.rs
+++ b/crates/openhuman-core/src/security/policy/path_checks.rs
@@ -54,11 +54,22 @@ impl SecurityPolicy {
return false;
}
- // Credential stores are never reachable, even via a trusted-root grant.
+ // Credential stores are never reachable, even via a trusted-root grant,
+ // and never via a disabled policy either — that floor is the one path
+ // rule `enabled = false` keeps.
if Self::is_always_forbidden(expanded_path) {
return false;
}
+ // With the policy disabled, containment (`workspace_only`,
+ // `forbidden_paths`, trusted roots, the workspace-internal boundary) is
+ // inert; the host's container/jail is what bounds the agent. The
+ // traversal and null-byte checks above are correctness, not policy, so
+ // they stay.
+ if !self.enabled {
+ return true;
+ }
+
// A trusted root grants access to its subtree, taking precedence over
// workspace_only and forbidden_paths. Read-vs-write is enforced by the
// operation-specific validators (validate_path / validate_parent_path).
@@ -517,6 +528,9 @@ impl SecurityPolicy {
if Self::is_always_forbidden(resolved) {
return false;
}
+ if !self.enabled {
+ return true;
+ }
let workspace_root = self.workspace_root_sync();
resolved.starts_with(&workspace_root)
|| self.is_within_trusted_root(resolved, require_write)
@@ -537,6 +551,9 @@ impl SecurityPolicy {
resolved.display()
));
}
+ if !self.enabled {
+ return Ok(());
+ }
// Trusted roots may override user-configured forbidden paths, but never
// the core-managed workspace-state boundary.
if self.is_workspace_internal_path(resolved) {