Skip to content

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

fix(security): enforce policy checks on all tool invocations

Steven Enamakel5acd78f15d62
diff --git a/crates/openhuman-core/src/security/policy/enforcement.rs b/crates/openhuman-core/src/security/policy/enforcement.rs
index 5f70003c07..37b1901d69 100644
--- a/crates/openhuman-core/src/security/policy/enforcement.rs
+++ b/crates/openhuman-core/src/security/policy/enforcement.rs
@@ -203,7 +203,7 @@ impl SecurityPolicy {
// is ever trusted — never `/tmp` itself. Created here with restrictive
// perms and refused if it exists as a symlink (TOCTOU hardening, since
// `/tmp` is world-writable and the name is predictable).
- match ensure_openhuman_scratch_dir().filter(|_| !saas) {
+ match (!saas).then(ensure_openhuman_scratch_dir).flatten() {
Some(scratch) => {
let scratch_str = scratch.to_string_lossy().to_string();
if trusted_roots.iter().any(|r| r.path == scratch_str) {