Skip to content

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

feat(config): register action sandbox as a trusted root

Steven Enamakel8e1b191a2662
diff --git a/crates/openhuman-core/src/config/ops/agent.rs b/crates/openhuman-core/src/config/ops/agent.rs
index 74095d2041..ef4f04f526 100644
--- a/crates/openhuman-core/src/config/ops/agent.rs
+++ b/crates/openhuman-core/src/config/ops/agent.rs
@@ -340,6 +340,28 @@ pub async fn ensure_agent_dirs(config: &mut Config) {
"[startup] could not create action sandbox dir"
);
}
+ // Creating the action dir is not the same as being allowed to write in it:
+ // `validate_path` only *joins* relative tool paths onto it, and the
+ // permission comes from a trusted root. `SecurityPolicy::from_config` grants
+ // it, and this is the config-side mirror so a persisted config carries the
+ // same grant. Skipped when the action dir sits at or above `workspace_dir`,
+ // where a trusted root would buy a `forbidden_paths` bypass over the whole
+ // workspace.
+ let action_path = action_dir.to_string_lossy().to_string();
+ if !action_path.is_empty()
+ && !config.workspace_dir.starts_with(&action_dir)
+ && !config
+ .autonomy
+ .trusted_roots
+ .iter()
+ .any(|r| r.path == action_path)
+ {
+ config.autonomy.trusted_roots.push(TrustedRoot {
+ path: action_path,
+ access: TrustedAccess::ReadWrite,
+ });
+ }
+
tracing::info!(
workspace = %redact_home(&config.workspace_dir),
action = %redact_home(&action_dir),