Skip to content

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

test(security): add egress enforcement and type tests

Steven Enamakelb68a2b61d169
diff --git a/crates/openhuman-core/src/security/egress/enforce_tests.rs b/crates/openhuman-core/src/security/egress/enforce_tests.rs
index e7889704c3..45d6fa4b9a 100644
--- a/crates/openhuman-core/src/security/egress/enforce_tests.rs
+++ b/crates/openhuman-core/src/security/egress/enforce_tests.rs
@@ -77,14 +77,14 @@ fn local_only_allows_local_runtime() {
#[test]
fn local_only_allows_control_plane_integration() {
// LocalOnly + an exempt control-plane integration path → allowed.
- let pricing = EgressDescriptor::integration("/agent-integrations/pricing");
+ let pricing = EgressDescriptor::integration("/pricing").with_control_plane(true);
assert!(!local_only_blocks(PrivacyMode::LocalOnly, &pricing));
}
#[test]
fn local_only_blocks_user_data_integration() {
// LocalOnly + a user-data integration path → blocked.
- let execute = EgressDescriptor::integration("/agent-integrations/composio/execute");
+ let execute = EgressDescriptor::integration("/tools/execute");
assert!(local_only_blocks(PrivacyMode::LocalOnly, &execute));
}
diff --git a/crates/openhuman-core/src/security/egress/types_tests.rs b/crates/openhuman-core/src/security/egress/types_tests.rs
index b9eb3907ba..a6832be167 100644
--- a/crates/openhuman-core/src/security/egress/types_tests.rs
+++ b/crates/openhuman-core/src/security/egress/types_tests.rs
@@ -41,6 +41,8 @@ fn integration_shape_targets_backend() {
assert!(d.is_external);
assert_eq!(d.reason, EgressReason::Integration);
assert_eq!(d.data_kinds, vec![DataKind::Metadata]);
+ assert!(!d.control_plane, "unclassified integration is fail-closed");
+ assert!(d.with_control_plane(true).control_plane);
}
#[test]