From 5f1957c27bd23f73b339265d3acd32f4a21878a3 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sat, 25 Jul 2026 01:04:58 +0300 Subject: fix: harden hermes lifecycle detection --- src/detect/mod.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/detect/mod.rs') 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) // --------------------------------------------------------------------------- @@ -767,6 +770,13 @@ mod tests { assert!(!Agent::SCREEN_MANIFEST_AGENTS.contains(&Agent::Mastracode)); } + #[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); -- cgit v1.2.3