Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aegis-runtime-mv/blob/main/tests/policy_guard_tests.rs # aegis-runtime-mv Native Rust agent runtime: Axum WebSocket/SSE/REST gateway, heartbeat scheduler, dependency-aware task workflow, SQLite storage. Attachment of AienOS. Pre-alpha. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aegis-runtime-mv / tests / policy_guard_tests.rs` 19 lines ยท 745 bytes Raw Blame History 1 use aegis::policy_guard::ProbePolicyGuard; 2 3 #[tokio::test] 4 async fn test_probe_policy_guard_reference_execution() { 5 // Permissive threshold to verify pipeline execution 6 let guard = ProbePolicyGuard::new_reference(0.0); 7 let allowed = guard.check_action("read_file", "src/lib.rs").await.unwrap(); 8 assert!(allowed); 9 } 10 11 #[tokio::test] 12 async fn test_probe_policy_guard_fails_closed_on_strict_threshold() { 13 // Impossibly high threshold forces fail-closed behavior 14 let guard = ProbePolicyGuard::new_reference(0.999999); 15 let result = guard.check_action("rm_rf", "/").await; 16 assert!(result.is_err()); 17 let err_msg = result.unwrap_err().to_string(); 18 assert!(err_msg.contains("blocked by sovereign probe policy")); 19 }