Skip to content

feat(containment): Phase 2 behavior-first adjudication and kernel subtree containment - #82

Merged
oyesanyf merged 5 commits into
mainfrom
feat/phase2-lineage-containment
Nov 13, 2026
Merged

oyesanyf merged 5 commits into
mainfrom
feat/phase2-lineage-containment

Conversation

@oyesanyf

Copy link
Copy Markdown
Owner

Summary

Implements Phase 2 (Behavior-First Adjudication and Lineage-Scoped Subtree Containment) on top of merged Phase 1 (#81):

1. Behavior-First & Agent-Lineage Adjudication

  • REA Engine (crates/killswitch-adjudication/src/rea/engine.rs): Expanded has_active_lotl_or_exploit_indicators (encoded PowerShell -ec, invoke-webrequest, -ep bypass, /dev/tcp/, nc -e, python -c, curl , certutil -urlcache, ld_preload=, /proc/self/mem, nsenter, /var/run/docker.sock, cloud metadata & credential paths) and removed shells/interpreters (cmd.exe, powershell.exe, pwsh.exe, node, python, python3) from is_rea_benign_system_or_dev_process.
  • Adjudicator & Voters (adjudicator.rs, voters.rs, immunity.rs, lineage_trigger.rs): Combined candidate command-line and detection telemetry; gated off Layer 1 dev-tool immunity, Layer 2 ProtectedBinaryHash, Layer 3 AuthenticodeTrustedVendor / WindowsCatalogSigned, and benign REA/voter vetoes whenever active agent-runtime lineage, DLP/event risk, or LOTL/exploit telemetry is present while preserving immutable OS kernel anchors (is_immutable_os_kernel_pid) and KillSwitch self PIDs.

2. Cross-OS Subtree Sandboxing & Tracked Agent Registry

  • Tracked Agent Registry (crates/killswitch-core/src/agent_registry.rs): Tracks AI agent roots, descendant parent-child edges, and offending subtrees while excluding immutable kernel anchors and KillSwitch self PIDs.
  • Cross-OS Job/Cgroup/Libproc Sandbox (crates/killswitch-core/src/job_sandbox.rs): Adds WindowsJobSandbox (fail-closed CREATE_SUSPENDED -> AssignProcessToJobObject -> IsProcessInJob -> ResumeThread), LinuxCgroupSandbox (cgroups v2 freeze/thaw + /proc descendant traversal), macOS proc_listchildpids, and freeze_subtree_kernel fixed-point parent-before-child suspension plus release_all_sandbox_jobs.
  • Host Manager, Freezer, Tarpit & Server (killchain.rs, freeze.rs, tarpit.rs, server.rs): Adds engage_isolation_for_target, tightens is_immutable_os_kernel_pid (exact KillSwitch binary stems, untrusted temp/public path rejection) and is_critical_system_pid (removes shells, interpreters, wsl, docker, sudo, su, and tracked agent PIDs), refreshes thread handles per tarpit duty cycle, and registers detected agent roots/ancestors before engaging target-scoped isolation.

3. Tests & Verification

  • Added and updated tests across adjudicator.rs, killchain.rs, data_lineage_voter_tests.rs, empirical_challenge_m3_2.rs, empirical_challenge_m2_2.rs, and empirical_challenge_m5_2.rs.
  • Verified locally with cargo fmt --all -- --check and cargo clippy --workspace --all-targets -- -D warnings.

…nity tests for Phase 2 CI

- Restrict clean powershell.exe/pwsh.exe admin shell veto in DataLineageVoter to untracked PIDs with no taint baggage, input datasets, LOTL indicators, or agent ancestry
- Update test_adjudicator_preserves_benign_cargo_and_clean_get_service to assert monitor-only handling without lineage context and clean veto with verified clean DataLineage evidence
- Preserve cursor/ssh/ls in non-kernel critical PID lookup while tracked agent trees and active threat indicators continue to revoke ambient immunity
…reat root

Stop upward ancestor climbing at the highest confirmed threat root (or below any uninvolved host boundary/interactive shell or unknown empty parent) instead of over-climbing to unrelated non-shell ancestors.
…al_system_pid

Preserve uninvolved Windows Terminal (wt.exe) host processes alongside windowsterminal.exe when outside tracked AI agent trees and active threat indicators.
@oyesanyf
oyesanyf merged commit 1e7de9b into main Nov 13, 2026
7 checks passed
@oyesanyf
oyesanyf deleted the feat/phase2-lineage-containment branch November 13, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant