aboutsummaryrefslogtreecommitdiff
path: root/src/detect/mod.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-07-25 01:04:58 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-07-25 01:05:14 +0300
commit5f1957c27bd23f73b339265d3acd32f4a21878a3 (patch)
tree3a89bcc452130df0b18becb7aa9ec4c6008262ba /src/detect/mod.rs
parent38d2b0780c50e4773d6948660873386261cde71d (diff)
fix: harden hermes lifecycle detection
Diffstat (limited to 'src/detect/mod.rs')
-rw-r--r--src/detect/mod.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/detect/mod.rs b/src/detect/mod.rs
index b8eb8f60..33c4361c 100644
--- a/src/detect/mod.rs
+++ b/src/detect/mod.rs
@@ -286,13 +286,16 @@ pub(crate) fn full_lifecycle_hook_authority(source: &str, agent_label: &str) ->
("herdr:pi", "pi")
| ("herdr:omp", "omp")
| ("herdr:mastracode", "mastracode")
- | ("herdr:hermes", "hermes")
| ("herdr:opencode", "opencode")
| ("herdr:kilo", "kilo")
| ("herdr:kimi", "kimi")
)
}
+pub(crate) fn session_identity_only_integration(source: &str, agent_label: &str) -> bool {
+ (source, agent_label) == ("herdr:hermes", "hermes")
+}
+
// ---------------------------------------------------------------------------
// Process identification (platform-specific)
// ---------------------------------------------------------------------------
@@ -768,6 +771,13 @@ mod tests {
}
#[test]
+ fn hermes_session_integration_leaves_state_to_screen_detection() {
+ assert!(!full_lifecycle_hook_authority("herdr:hermes", "hermes"));
+ assert!(session_identity_only_integration("herdr:hermes", "hermes"));
+ assert!(Agent::SCREEN_MANIFEST_AGENTS.contains(&Agent::Hermes));
+ }
+
+ #[test]
fn identify_unknown_processes() {
assert_eq!(identify_agent("bash"), None);
assert_eq!(identify_agent("zsh"), None);