Alexander Whitestone
8f24d43c08
Docker Build and Publish / build-and-push (pull_request) Has been skipped
Contributor Attribution Check / check-attribution (pull_request) Failing after 31s
Supply Chain Audit / Scan PR for supply chain risks (pull_request) Successful in 37s
Tests / e2e (pull_request) Successful in 2m27s
Tests / test (pull_request) Failing after 37m0s
feat: ML-inspired risk scoring for command approval (#681)
Current tier detection uses keyword matching and regex patterns.
This adds path-aware and context-aware risk scoring.
New tools/risk_scoring.py:
- classify_path_risk(): system paths (90), sensitive user paths (75),
safe paths (10), user paths (50)
- detect_context(): execution vs comment vs documentation vs code block
(documentation contexts reduce risk score)
- get_operation_risk(): read-only ops (cat/grep/find = 5-10) vs
destructive ops (rm=70, mkfs=95, kill=45)
- score_command_risk(): multi-factor RiskScore with tier classification
(SAFE/LOW/MEDIUM/HIGH/CRITICAL), factors list, recommendation
- compare_commands(): side-by-side risk comparison
Key improvements:
- 'cat /etc/passwd' is SAFE (read operation, path irrelevant)
- 'rm /etc/passwd' is CRITICAL (destructive + system path)
- 'rm /tmp/build.log' is MEDIUM (destructive but safe path)
- '# rm -rf /' is LOW (comment context reduces risk)
- 'curl ... | bash' is HIGH (pipe to shell pattern)
Tests: tests/test_risk_scoring.py
Closes #681
2026-04-14 19:20:50 -04:00
..
2026-04-07 08:40:22 -04:00
2026-04-12 06:18:05 +05:30
2026-03-17 02:33:12 -07:00
2026-03-31 08:48:54 +09:00
2026-03-23 07:43:12 -07:00
2026-04-14 01:43:45 -07:00
2026-04-08 02:24:32 -07:00
2026-04-01 04:18:50 -07:00
2026-04-10 03:44:43 -07:00
2026-04-14 10:21:54 -07:00
2026-04-08 02:24:32 -07:00
2026-04-11 14:50:44 -07:00
2026-04-07 13:36:38 -07:00
2026-04-13 04:23:27 -07:00
2026-04-11 13:59:52 -07:00
2026-04-13 16:32:04 -07:00
2026-04-07 10:25:31 -07:00
2026-04-12 00:54:35 -07:00
2026-04-13 16:32:04 -07:00
2026-04-13 23:54:45 -07:00
2026-04-13 16:32:04 -07:00
2026-04-10 16:47:44 -07:00
2026-04-13 04:45:07 -07:00
2026-04-13 16:32:04 -07:00
2026-04-11 14:02:58 -07:00
2026-04-02 12:40:03 +11:00
2026-04-10 03:05:04 -07:00
2026-04-13 22:14:55 -07:00
2026-04-14 10:18:05 -07:00
2026-04-13 16:32:04 -07:00
2026-03-18 02:55:30 -07:00
2026-03-11 20:02:36 -07:00
2026-04-05 12:46:07 -07:00
2026-04-10 16:47:44 -07:00
2026-04-11 13:59:52 -07:00
2026-04-12 00:36:22 -07:00
2026-04-13 23:52:32 -07:00
2026-04-14 19:20:50 -04:00
2026-04-07 10:25:31 -07:00
2026-04-14 00:11:49 -07:00
2026-04-13 04:54:42 -07:00
2026-04-11 13:59:52 -07:00
2026-04-13 16:32:04 -07:00
2026-04-12 16:39:04 -07:00
2026-04-11 01:21:20 -07:00
2026-04-14 10:42:58 -07:00
2026-04-13 16:32:04 -07:00
2026-03-25 19:47:58 -07:00
2026-04-11 16:22:50 -07:00
2026-03-31 08:48:54 +09:00
2026-04-11 14:26:11 -07:00
2026-04-13 16:32:04 -07:00
2026-04-12 16:46:18 -07:00
2026-04-10 05:04:28 -07:00
2026-04-13 16:32:04 -07:00
2026-04-13 16:32:04 -07:00
2026-04-13 16:32:04 -07:00
2026-04-07 10:25:31 -07:00