feat: add human detection scoring and webhook notifications
Implement phase 2.1 (human detection) and 2.2 (notifications): - Detection scorer computes 0.0-1.0 human likelihood from keystroke timing variance, special key usage, typing speed, command diversity, and session duration - Webhook notifier sends JSON POST to configured endpoints with deduplication, custom headers, and event filtering - RecordingChannel gains an event callback for feeding keystrokes to the scorer without coupling shell and detection packages - Server wires scorer into session lifecycle with periodic updates and threshold-based notification triggers - Web UI shows human score in session tables with highlighting - New config sections: [detection] and [[notify.webhooks]] Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
4
PLAN.md
4
PLAN.md
@@ -117,14 +117,14 @@ This lets shells build realistic prompts (`username@hostname:~$`) and log activi
|
||||
|
||||
Goal: Detect likely-human sessions and make the system smarter.
|
||||
|
||||
### 2.1 Human Detection Scoring
|
||||
### 2.1 Human Detection Scoring ✅
|
||||
- Keystroke timing analysis
|
||||
- Track backspace, tab, arrow key usage
|
||||
- Command diversity scoring
|
||||
- Compute per-session human score, store in sessions table
|
||||
- Flag sessions above configurable threshold
|
||||
|
||||
### 2.2 Notifications
|
||||
### 2.2 Notifications ✅
|
||||
- Webhook support (generic HTTP POST, works with Slack/Discord/ntfy)
|
||||
- Trigger on: human score threshold crossed, new session started, configurable
|
||||
- Include session details in payload
|
||||
|
||||
Reference in New Issue
Block a user