Repository navigation
feat(containment): Phase 2 behavior-first adjudication and kernel subtree containment - #82
Merged
Merged
Conversation
…or-first adjudication
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
crates/killswitch-adjudication/src/rea/engine.rs): Expandedhas_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) fromis_rea_benign_system_or_dev_process.adjudicator.rs,voters.rs,immunity.rs,lineage_trigger.rs): Combined candidate command-line and detection telemetry; gated off Layer 1 dev-tool immunity, Layer 2ProtectedBinaryHash, Layer 3AuthenticodeTrustedVendor/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
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.crates/killswitch-core/src/job_sandbox.rs): AddsWindowsJobSandbox(fail-closedCREATE_SUSPENDED->AssignProcessToJobObject->IsProcessInJob->ResumeThread),LinuxCgroupSandbox(cgroups v2 freeze/thaw +/procdescendant traversal), macOSproc_listchildpids, andfreeze_subtree_kernelfixed-point parent-before-child suspension plusrelease_all_sandbox_jobs.killchain.rs,freeze.rs,tarpit.rs,server.rs): Addsengage_isolation_for_target, tightensis_immutable_os_kernel_pid(exact KillSwitch binary stems, untrusted temp/public path rejection) andis_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
adjudicator.rs,killchain.rs,data_lineage_voter_tests.rs,empirical_challenge_m3_2.rs,empirical_challenge_m2_2.rs, andempirical_challenge_m5_2.rs.cargo fmt --all -- --checkandcargo clippy --workspace --all-targets -- -D warnings.