Skip to content
BreachPilot

Exploit Agent — Overview

Single-target LLM loop. Canonical implementation: tools/exploit_agent/runner/_impl.py (loaded into the package by tools/exploit_agent/runner/loop.py via importlib). Entry point run_exploit_agent (_impl.py:301) re-exported via the package root __init__.py after _sync_patchable_symbols (propagates historical test monkeypatches into the split modules). tools/exploit_agent/loop.py is a deprecated re-export shim (DeprecationWarning).

Verified symbols

ModuleSymbolKindLine
tools/exploit_agent/runner/_impl.pyrun_exploit_agentasync def301
tools/exploit_agent/runner/_impl.py_InMemoryExperienceStoreclass196
tools/exploit_agent/runner/_impl.pyCheckpointContextdataclass99
tools/exploit_agent/runner/_impl.pyCheckpointOutcomedataclass117
tools/exploit_agent/runner/_impl.pyCheckpointHookProtocol138
phase_tracker.py_PhaseTrackerclass9
policy.pyExploitPermissionEnum13
policy.pyExploitSettingsdataclass24
policy.pyExploitPolicyclass277
policy.pyExploitRecorddataclass143
context.pysanitize_outputdef619
prompt.pybuild_exploit_system_promptdef13
research_assistant.pyResearchAssistantclass189
research_assistant.pyResearchAssistantSettingsdataclass105
reflection.py_generate_reflectiondef11
tool_calls.py_ToolOutcomeTrackerclass
tool_catalog.pyselect_tools_for_phasedef

Module responsibilities

FileRole
tools/exploit_agent/runner/_impl.pyMain loop, phase/budget/compaction/reflection wiring, checkpoints
runner/ + runner.pyLoader + re-export shims into the package
loop.pyDeprecated shim → runner
phase_tracker.pyPhase minima + can_terminate()
policy.pyPermission + budgets + tamper-evident audit chain
context.pyToken estimation, compaction, attack memory, reasoning advisory, sanitization
prompt.pySystem prompt assembly + advisory briefings
model_client.py_call_model_with_retry, _stream_model, _call_model_with_tools — provider-neutral (ollama_client.py is its deprecation shim)
tool_calls.pyFiltering/validation, _ToolOutcomeTracker, replan prompts
tool_catalog.pyPhase-narrowed tool schemas
reflection.pyHeuristic + LLM reflection, peer consultation
research_assistant.pyBounded read-only research sidecar
skills.pyMid-run skill re-selection
outcome_*.pyClassification → truth normalization → judge bridge

Config keys (read via tools.config_manager.load_validated_config / raw load_config)

KeyEffect
exploit.permissionfull_access/approve_only/read_only; missing → read_only
exploit.attack_modeEnables attack workflow + raised budgets
exploit.max_rounds / max_commands_per_session / attack_max_*Budgets via ExploitSettings.effective_*
exploit.allowed_targets / require_explicit_allowlistTarget-IP lock (enforced in MCP layer)
exploit.attacker_osOS prompt branch (_resolve_attacker_os)
long_session.*num_ctx, checkpointing
reasoning.*chain_of_thought, ultrathink, llm_reflection, peer_consult_on_failure_threshold
multi_model.*Peer consultation budget
research.assistant.*ResearchAssistantSettings.from_config
skills.*Startup hints + reselect_*
memory.*attack_memory_enabled, semantic_enabled, experience_*
models.info.<alias>.context_windowCompaction profile override (context.py:60)

Tests (all verified present)

Test fileCovers
tests/test_agent_loop.pyLoop lifecycle, budget, phase minima
tests/test_context_compaction.pyCompaction + token estimation
tests/test_attack_memory.pyAttack memory capture/render
tests/test_long_session.pynum_ctx, persist_messages
tests/test_reasoning_loop.pyULTRATHINK advisory
tests/test_ultrathink.py[REASONING] parsing
tests/test_exploit_permission.pyPermission modes
tests/test_audit_chain.pyHash chain
tests/test_tool_outcome_tracker.pyBlocked/compromise tracking
tests/test_research_assistant.pyResearch sidecar
tests/test_skill_reselection.pyMid-run skill update
tests/test_outcome_truth.pynormalize_action_result
tests/test_outcome_judge_flow_a.pyJudge bridge

Safety note

ExploitPolicy.approve_action auto-approves in full_access with no command/scope inspection. The sole attack-mode safety is the target-IP allowlist enforced at tools/mcp_shared._allowed_target_list + tools/kernel/allowlist.py. See policy.md.

source: repo docs (build sync)Edit this page on GitHub →