feat(grid-agent): add chat and IM interactions (#123)
This commit is contained in:
@@ -225,3 +225,34 @@ fn authenticated_uuid_not_message_text_controls_im_authority() {
|
||||
.expect("decision");
|
||||
assert_eq!(result.disposition, PolicyDisposition::Denied);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn interaction_intent_capability_filter_can_only_narrow_origin_allowed_tools() {
|
||||
let authorized = id("11111111-1111-4111-8111-111111111111");
|
||||
let audit = Arc::new(MemoryPolicyAudit::new(16).expect("audit"));
|
||||
let gateway = PolicyGateway::new(
|
||||
BTreeSet::from([authorized]),
|
||||
vec![tool("inspect", true), tool("move", false)],
|
||||
PolicyLimits::default(),
|
||||
audit,
|
||||
)
|
||||
.expect("gateway");
|
||||
let context = PolicyRequestContext::new(
|
||||
ActionOrigin::instant_message(authorized),
|
||||
"intent-session",
|
||||
"intent-correlation",
|
||||
)
|
||||
.expect("context");
|
||||
let informational = gateway.tools_for_capability_set(
|
||||
&context,
|
||||
100,
|
||||
&BTreeSet::from([Capability::Informational]),
|
||||
);
|
||||
assert_eq!(informational.len(), 1);
|
||||
assert_eq!(informational[0].name.as_str(), "inspect");
|
||||
assert!(
|
||||
gateway
|
||||
.tools_for_capability_set(&context, 100, &BTreeSet::new())
|
||||
.is_empty()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user