Skip to content

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

fix(security): invert default for SecurityPolicy::enabled

Steven Enamakel589188afb897
diff --git a/crates/openhuman-core/src/security/policy/types.rs b/crates/openhuman-core/src/security/policy/types.rs
index aeeb0597a1..5bdd4dd582 100644
--- a/crates/openhuman-core/src/security/policy/types.rs
+++ b/crates/openhuman-core/src/security/policy/types.rs
@@ -239,6 +239,10 @@ pub struct SecurityPolicy {
/// a host genuinely wants no path policy at all.
///
/// Set `[autonomy] enabled = true` to restore the full policy.
+ ///
+ /// Note the asymmetry with [`Default`]: a policy built from config defaults
+ /// to disabled, a policy built with no config at all defaults to enabled.
+ /// See the comment on the `Default` impl below.
pub enabled: bool,
pub autonomy: AutonomyLevel,
/// Data-egress posture (Privacy Mode) — DISTINCT from `autonomy`, which
@@ -320,7 +324,15 @@ pub struct SecurityPolicy {
impl Default for SecurityPolicy {
fn default() -> Self {
Self {
- enabled: false,
+ // Deliberately the opposite of `AutonomyConfig::default()`, which is
+ // `false`. That one is the *shipped* default, chosen once, from
+ // config, at the single `from_config` chokepoint. This one is the
+ // fallback for a `SecurityPolicy` built without any config at all —
+ // bare `SecurityPolicy::default()` constructions in tests, examples
+ // and a handful of internal call sites — and there fail-closed is
+ // right: a policy nobody configured should not be a policy nobody
+ // enforces.
+ enabled: true,
autonomy: AutonomyLevel::Supervised,
privacy_mode: PrivacyMode::Standard,
workspace_dir: PathBuf::from("."),