Skip to content

Agent API_p12

grisun0 edited this page Oct 16, 2026 · 20 revisions

API (page 12 of 23)

Previous: API_p11.md

modules/intercept.py

Depends on: cli/commands/enum.py Imported by: cli/commands/daemon_ctl.py, modules/lazy_loop.py, skills/autonomous_daemon.py, skills/lazyown_mcp.py, tests/test_engage_gates.py, tests/test_lazy_parity.py, tests/test_safety_gates.py

  • InterceptRule.matches (method) modules/intercept.py:68 def matches(self, tool, command) -- Return True when this rule matches the tool call surface.
  • builtin_rules (function) modules/intercept.py:101 def builtin_rules() -- Return the default destructive and exfiltration guard rules.
  • scope_blocked (function) modules/intercept.py:131 def scope_blocked(target) -- Return the matching global scope suffix or empty (LAZY parity).
  • observe_post_tool (function) modules/intercept.py:144 def observe_post_tool(output) -- Classify post-execution output (LAZY Guard.postToolUse parity).
  • Interceptor.__init__ (method) modules/intercept.py:157 def __init__(self, rules, ask_timeout_sec, timeout_action) -- Initialize with rules sorted by descending priority.
  • Interceptor.rules (method) modules/intercept.py:172 def rules(self) -- Return a copy of the active rule list.
  • Interceptor.add_rule (method) modules/intercept.py:177 def add_rule(self, rule) -- Add a rule and keep priority ordering.
  • Interceptor.remove_rule (method) modules/intercept.py:183 def remove_rule(self, pattern) -- Remove the first rule matching pattern text.
  • Interceptor.evaluate (method) modules/intercept.py:192 def evaluate(self, tool, command) -- Evaluate a tool call and return the verdict.
  • Interceptor.decide (method) modules/intercept.py:220 def decide(self, approval_id, decision) -- Resolve a pending approval with approve or deny.
  • Interceptor.pending_approvals (method) modules/intercept.py:234 def pending_approvals(self) -- List unresolved approvals, expiring timed-out ones per policy.
  • Interceptor.approval_status (method) modules/intercept.py:249 def approval_status(self, approval_id) -- Fetch a single approval record by id.
  • Guard.__init__ (method) modules/intercept.py:258 def __init__(self, interceptor) -- Initialize audit log with an optional interceptor.
  • Guard.interceptor (method) modules/intercept.py:266 def interceptor(self) -- Expose the underlying interceptor.
  • Guard.check (method) modules/intercept.py:270 def check(self, tool, command) -- Audit the call then evaluate intercept rules (trace id kept).
  • Guard.observe (method) modules/intercept.py:282 def observe(self, output, source) -- Classify output and attribute blocked/error counters.
  • Guard.record_failure (method) modules/intercept.py:291 def record_failure(self, source) -- Attribute a post-execution failure to a source.
  • Guard.audit_log (method) modules/intercept.py:296 def audit_log(self, limit) -- Return the most recent audit entries.
  • Guard.attribution (method) modules/intercept.py:301 def attribution(self) -- Return failure attribution counters.

modules/iptables_portforward.sh

modules/jsonl_tail.py

Imported by: cli/lazy_monitor.py, cli/lazy_orchestrator.py, modules/lazy_runner.py

  • JsonlTail.__init__ (method) modules/jsonl_tail.py:17 def __init__(self, path) -- Bind the tail to one file path.
  • JsonlTail.read_new (method) modules/jsonl_tail.py:22 def read_new(self, limit) -- Return new complete records since the last call.

modules/k8s_attacks.py

Imported by: cli/commands/cloud_attacks.py

  • K8SAttackEngine.__init__ (method) modules/k8s_attacks.py:87 def __init__(self, config)
  • K8SAttackEngine.enumerate_rbac (method) modules/k8s_attacks.py:90 def enumerate_rbac(self) -- Enumerate RBAC permissions for the current identity.
  • K8SAttackEngine.privileged_pod_escape (method) modules/k8s_attacks.py:118 def privileged_pod_escape(self) -- Plan a privileged pod escape.
  • K8SAttackEngine.service_account_token_theft (method) modules/k8s_attacks.py:173 def service_account_token_theft(self) -- Steal service account tokens across namespaces for lateral movement.
  • K8SAttackEngine.kubelet_anonymous_auth_abuse (method) modules/k8s_attacks.py:198 def kubelet_anonymous_auth_abuse(self) -- Exploit kubelet anonymous authentication.
  • K8SAttackEngine.etcd_access_exploitation (method) modules/k8s_attacks.py:222 def etcd_access_exploitation(self) -- Exploit etcd database access for complete cluster compromise.
  • K8SAttackEngine.helm_tiller_abuse (method) modules/k8s_attacks.py:250 def helm_tiller_abuse(self) -- Abuse Helm (v2 Tiller or v3 RBAC) for privilege escalation.
  • K8SAttackEngine.persistence_techniques (method) modules/k8s_attacks.py:278 def persistence_techniques(self) -- Kubernetes persistence techniques for long-term access.
  • K8SAttackEngine.summary (method) modules/k8s_attacks.py:318 def summary(self)

modules/kerberoasting.py

Depends on: modules/kerberos_core.py Imported by: cli/commands/active_directory.py

  • KerberoastingEngine.__init__ (method) modules/kerberoasting.py:95 def __init__(self, domain, dc_ip, username, password, hash)
  • KerberoastingEngine.enumerate_spns (method) modules/kerberoasting.py:112 def enumerate_spns(self, ldap_output, bloodhound_data) -- Enumerate kerberoastable service principals.
  • priority (function) modules/kerberoasting.py:172 def priority(target)
  • KerberoastingEngine.request_tgs_aes_only (method) modules/kerberoasting.py:187 def request_tgs_aes_only(self, user_spn) -- Request a TGS ticket using only AES encryption (evades RC4 detection).
  • KerberoastingEngine.request_tgs_rc4 (method) modules/kerberoasting.py:208 def request_tgs_rc4(self, user_spn) -- Request a TGS ticket using RC4-HMAC (mode 13100 for Hashcat).
  • KerberoastingEngine.request_tgs (method) modules/kerberoasting.py:219 def request_tgs(self, user_spn, etype) -- Request a TGS service ticket for kerberoasting.
  • KerberoastingEngine.targeted_kerberoast (method) modules/kerberoasting.py:271 def targeted_kerberoast(self, high_value_only) -- Perform targeted Kerberoasting on enumerated SPNs.
  • KerberoastingEngine.asreproast_check (method) modules/kerberoasting.py:306 def asreproast_check(self, usernames) -- Check which users do NOT require Kerberos pre-authentication (AS-REP roastable).
  • KerberoastingEngine.extract_hashes_from_pcap (method) modules/kerberoasting.py:321 def extract_hashes_from_pcap(self, pcap_path) -- Extract Kerberoast hashes from a PCAP/PCAPNG network capture.
  • KerberoastingEngine.detect_kerberoasting_activity (method) modules/kerberoasting.py:336 def detect_kerberoasting_activity(self, event_log) -- Analyze Windows Event Logs for signs of Kerberoasting attacks.
  • KerberoastingEngine.build_hashcat_batch (method) modules/kerberoasting.py:379 def build_hashcat_batch(self, output_path) -- Build a batch file with all extracted hashes for Hashcat cracking.
  • KerberoastingEngine.summary (method) modules/kerberoasting.py:401 def summary(self) -- Return a summary of kerberoasting operations.

modules/kerberos_core.py

Imported by: modules/kerberoasting.py, modules/kerberos_tickets.py

  • KerberosPrincipal.to_string (method) modules/kerberos_core.py:152 def to_string(self)
  • KerberosTicket.has_flag (method) modules/kerberos_core.py:207 def has_flag(self, flag_name)
  • KerberosCrypto.__init__ (method) modules/kerberos_core.py:277 def __init__(self)
  • KerberosCrypto.derive_aes_key (method) modules/kerberos_core.py:282 def derive_aes_key(password, salt, etype) -- Derive an AES Kerberos key from a password using string-to-key.
  • KerberosCrypto.derive_rc4_key (method) modules/kerberos_core.py:318 def derive_rc4_key(password) -- Derive RC4-HMAC Kerberos key from password (hash = MD4(UTF16LE(password))).
  • KerberosCrypto.aes_encrypt (method) modules/kerberos_core.py:329 def aes_encrypt(self, key, plaintext, usage) -- AES encrypt with Kerberos ciphertext stealing (CTS) mode.
  • KerberosCrypto.aes_decrypt (method) modules/kerberos_core.py:361 def aes_decrypt(self, key, ciphertext, usage) -- AES decrypt with Kerberos CTS mode.
  • KerberosCrypto.compute_checksum (method) modules/kerberos_core.py:389 def compute_checksum(key, data, etype) -- Compute a Kerberos checksum using HMAC-SHA1-96-AES.
  • KerberosCore.__init__ (method) modules/kerberos_core.py:421 def __init__(self, domain, dc_host, dc_ip)
  • KerberosCore.get_supported_etypes (method) modules/kerberos_core.py:427 def get_supported_etypes(self) -- Return encryption types supported by this implementation.
  • KerberosCore.build_as_req (method) modules/kerberos_core.py:435 def build_as_req(self, username, domain, password, etype) -- Build an AS-REQ message for TGT retrieval.
  • KerberosCore.build_tgs_req (method) modules/kerberos_core.py:489 def build_tgs_req(self, params) -- Build a TGS-REQ message for service ticket retrieval.
  • KerberosCore.parse_as_rep (method) modules/kerberos_core.py:534 def parse_as_rep(self, as_rep_data, key, etype) -- Parse an AS-REP response and extract the TGT and session key.
  • KerberosCore.parse_tgs_rep (method) modules/kerberos_core.py:550 def parse_tgs_rep(self, tgs_rep_data, session_key, etype) -- Parse a TGS-REP response and extract the service ticket.
  • KerberosCore.decrypt_ticket (method) modules/kerberos_core.py:563 def decrypt_ticket(self, ticket_data, key, etype) -- Decrypt the encrypted portion of a Kerberos ticket.
  • KerberosCore.parse_pac (method) modules/kerberos_core.py:588 def parse_pac(self, pac_data) -- Parse a Privilege Attribute Certificate (PAC) from decrypted auth data.
  • KerberosErrorParser.parse_error (method) modules/kerberos_core.py:687 def parse_error(error_data) -- Extract error code, message, and client/server realm from a KRB-ERROR.
  • TicketValidator.is_expired (method) modules/kerberos_core.py:706 def is_expired(endtime, grace_period) -- Check if a ticket has expired.
  • TicketValidator.validate_flags (method) modules/kerberos_core.py:719 def validate_flags(ticket, required_flags) -- Check that a ticket has all required flags.
  • TicketValidator.validate_pac_checksums (method) modules/kerberos_core.py:735 def validate_pac_checksums(pac) -- Validate PAC server and KDC checksums.

modules/kerberos_tickets.py

Depends on: modules/kerberos_core.py Imported by: cli/commands/active_directory.py

modules/kill_chain_viz.py

Depends on: modules/killchain.py Imported by: lazyc2.py

modules/killchain.py

Depends on: core/logging.py, modules/world_model.py Imported by: cli/commands/ai.py, cli/dashboard_tui.py, cli/killchain.py, cli/ops_commands.py, cli/recon_plan.py, cli/tips_engine.py, lazyc2.py, lazygui/panels/killchain_panel.py, modules/atomic_exploit_bridge.py, modules/kill_chain_viz.py, modules/lazyown_bridge.py, modules/opsec_scorer.py, scripts/devtools/core_smoke.py, skills/autonomous_daemon.py, skills/hermes-lazyown/constants.py, skills/lazyown_mcp.py, tests/test_killchain_snapshot.py, tests/test_killchain_unified_v2.py

  • KillChainConfig.world_model_path (method) modules/killchain.py:116 def world_model_path(self) -- Return the resolved path to world_model.json.
  • KillChainConfig.phase_index (method) modules/killchain.py:120 def phase_index(self, phase) -- Return the positional index of a canonical phase in the kill chain.
  • KillChainConfig.is_valid_phase (method) modules/killchain.py:127 def is_valid_phase(self, phase) -- Return True when phase is a recognised canonical phase.
  • KillChain.config (method) modules/killchain.py:154 def config() -- Return the centralised configuration.
  • KillChain.phases (method) modules/killchain.py:159 def phases() -- Return the canonical 8-phase tuple.
  • KillChain.phase_labels (method) modules/killchain.py:164 def phase_labels() -- Return the canonical phase label mapping.
  • KillChain.phase_colors (method) modules/killchain.py:169 def phase_colors() -- Return the canonical phase hex-color mapping.
  • KillChain.phase_rich_colors (method) modules/killchain.py:174 def phase_rich_colors() -- Return the canonical phase rich-terminal color mapping.
  • KillChain.engagement_phase_to_cli (method) modules/killchain.py:179 def engagement_phase_to_cli(engagement_value) -- Map a WorldModel.EngagementPhase value to the CLI phase key.
  • KillChain.cli_phase_to_host_state (method) modules/killchain.py:191 def cli_phase_to_host_state(phase) -- Map a CLI phase to a WorldModel.HostState value.
  • KillChain.current_phase (method) modules/killchain.py:204 def current_phase(world_model_path) -- Derive the current kill-chain phase.
  • KillChain.advance_phase (method) modules/killchain.py:251 def advance_phase(new_phase, world_model_path) -- Advance the kill-chain phase for all connected surfaces.
  • KillChain.get_progress (method) modules/killchain.py:315 def get_progress(world_model_path) -- Return the current kill-chain progress as a list of status objects.
  • KillChain.compact_progress (method) modules/killchain.py:364 def compact_progress(current_phase, phases_entered) -- Return a compact single-line progress indicator [R>E>X>P>L].
  • KillChain.phases_for_display (method) modules/killchain.py:384 def phases_for_display() -- Return an ordered (key, label, hex_color) triple for every phase.
  • KillChain.phase_index (method) modules/killchain.py:395 def phase_index(phase) -- Return the zero-based index of a canonical phase.
  • KillChain.snapshot (method) modules/killchain.py:400 def snapshot(world_model_path) -- Return a single, render-agnostic snapshot of the whole kill-chain.
  • get_killchain (function) modules/killchain.py:440 def get_killchain() -- Return the KillChain class as a module-level entry point.

modules/kivi.py

modules/lazy_agent.py

Depends on: core/config.py, modules/__init__.py, modules/agent_runner.py, modules/auto_registry.py, modules/lazy_loop.py, modules/llm_factory.py, modules/loop_ai_bridge.py Imported by: cli/commands/lazyops.py, tests/conftest.py, tests/test_lazy_agent.py

  • model_timeout_sec (function) modules/lazy_agent.py:41 def model_timeout_sec() -- Return the hard per-turn model timeout from configuration.
  • tool_calling_enabled (function) modules/lazy_agent.py:57 def tool_calling_enabled() -- Return whether agentic tool calling is enabled by configuration.
  • max_iterations (function) modules/lazy_agent.py:72 def max_iterations() -- Return the bounded agent step budget from configuration.
  • resolve_agentic_model (function) modules/lazy_agent.py:83 def resolve_agentic_model(exclude) -- Return a raw tool-calling backend for the best pool member, or None.
  • ObservableAgentRunner.__init__ (method) modules/lazy_agent.py:148 def __init__(self, model, system_prompt, max_iterations, on_event) -- Bind the model and the optional event sink (kind, name, text).
  • ObservableAgentRunner.run (method) modules/lazy_agent.py:168 def run(self, user_input) -- Base loop plus final-turn persistence for true resume.
  • ConversationStore.__init__ (method) modules/lazy_agent.py:264 def __init__(self, task_id) -- Bind the conversation store for one task (main when empty).
  • ConversationStore.intent_messages (method) modules/lazy_agent.py:273 def intent_messages(self, intent_id) -- Return the stored messages for one intent (resume seed).
  • ConversationStore.save_intent (method) modules/lazy_agent.py:278 def save_intent(self, intent_id, messages) -- Persist the tail of one intent conversation.
  • ConversationStore.session (method) modules/lazy_agent.py:287 def session(self, session_id) -- Return one main-agent session payload (empty when unknown).
  • ConversationStore.sessions (method) modules/lazy_agent.py:291 def sessions(self) -- List main-agent sessions with title, message count and age.
  • ConversationStore.save_session (method) modules/lazy_agent.py:305 def save_session(self, session_id, messages, title) -- Persist one main-agent session conversation tail.
  • ConversationStore.reset_intents (method) modules/lazy_agent.py:315 def reset_intents(self) -- Drop every stored intent conversation (fresh agent start).
  • register_tools (function) modules/lazy_agent.py:322 def register_tools(runner, specs) -- Register tool specs (name, description, func, parameters, required).
  • run_worker_session (function) modules/lazy_agent.py:335 def run_worker_session(model, task_id, intent_id, system_prompt, launch_prompt, tools, on_event) -- Run one agentic intent attempt with resume seeding.
  • run_main_session (function) modules/lazy_agent.py:374 def run_main_session(model, session_id, system_prompt, prompt, tools, on_event) -- Run one main-agent turn, resuming the stored session conversation.
  • run_external_opencode (function) modules/lazy_agent.py:396 def run_external_opencode(prompt, session_id, agent, cwd, timeout_sec) -- Run one headless opencode run task with MCP tooling.
  • run_external_hermes (function) modules/lazy_agent.py:472 def run_external_hermes(prompt, session_id, cwd, timeout_sec, max_turns, run_budget) -- Run one detached hermes chat --oneshot task.

modules/lazy_bridge.py

Depends on: modules/finding_lifecycle.py, modules/traffic_recorder.py, modules/world_model.py Imported by: cli/commands/lazyloop.py, modules/lazy_loop.py, skills/lazyown_mcp.py, tests/conftest.py, tests/test_lazy_loop.py

  • lazy_tasks (function) modules/lazy_bridge.py:88 def lazy_tasks() -- Load LAZY task registry.
  • lazy_assets (function) modules/lazy_bridge.py:99 def lazy_assets() -- Load LAZY asset nodes.
  • lazy_graph (function) modules/lazy_bridge.py:110 def lazy_graph(task_id) -- Load experiment graph for a task.
  • lazy_activity (function) modules/lazy_bridge.py:123 def lazy_activity(task_id) -- Load activity transcript for a task.
  • lazy_traffic (function) modules/lazy_bridge.py:135 def lazy_traffic(task_id) -- Load traffic log for a task.
  • lazy_guard_audit (function) modules/lazy_bridge.py:147 def lazy_guard_audit(task_id) -- Load guard audit for a task.
  • bridge_status (function) modules/lazy_bridge.py:159 def bridge_status() -- Summarize LAZY universe and last sync cursor.
  • pull_to_world_model (function) modules/lazy_bridge.py:206 def pull_to_world_model() -- Sync LAZY graphs and assets into LazyOwn world model.
  • pull_to_objectives (function) modules/lazy_bridge.py:251 def pull_to_objectives() -- Inject open LAZY tasks as LazyOwn objectives without duplicates.
  • pull_findings_to_lifecycle (function) modules/lazy_bridge.py:286 def pull_findings_to_lifecycle() -- Confirm LAZY finding nodes in LazyOwn finding lifecycle.
  • pull_traffic_to_recorder (function) modules/lazy_bridge.py:314 def pull_traffic_to_recorder() -- Mirror LAZY traffic logs into LazyOwn traffic recorder index.
  • push_objective_to_lazy (function) modules/lazy_bridge.py:344 def push_objective_to_lazy(goal, scope) -- Export a LazyOwn objective as an LAZY-compatible task draft.
  • push_tasks_to_c2 (function) modules/lazy_bridge.py:369 def push_tasks_to_c2(only) -- Mirror loop tasks into the lazyc2 Kanban board (sessions/tasks.json).
  • sync_all (function) modules/lazy_bridge.py:434 def sync_all() -- Run full bidirectional pull plus lifecycle, traffic and board mirror.

modules/lazy_cli_bridge.py

Depends on: core/config.py Imported by: cli/commands/lazyops.py, modules/auto_registry.py, modules/lazy_intel.py, modules/lazy_orchestrator_feedback.py

modules/lazy_installer.py

Depends on: core/config.py, modules/auto_registry.py Imported by: cli/commands/lazyops.py, modules/auto_registry.py, modules/lazy_loop.py

  • installer_enabled (function) modules/lazy_installer.py:41 def installer_enabled() -- Return whether the loop may resolve install intents.
  • set_installer_enabled (function) modules/lazy_installer.py:58 def set_installer_enabled(enabled) -- Persist the installer flag and return the stored value.
  • install_command_for (function) modules/lazy_installer.py:70 def install_command_for(tool) -- Return the allowlisted install recipe for one tool, or None.
  • intent_for (function) modules/lazy_installer.py:75 def intent_for(tool) -- Build the canonical install intent summary for one tool.
  • tool_from_intent (function) modules/lazy_installer.py:80 def tool_from_intent(text) -- Extract the tool name from an install intent, else empty string.
  • steps_for_install (function) modules/lazy_installer.py:88 def steps_for_install(text) -- Resolve an install intent to its recipe, or None.

modules/lazy_intel.py

Depends on: core/config.py, modules/lazy_cli_bridge.py, modules/lazy_loop.py, modules/world_model.py, utils.py Imported by: modules/atomic_exploit_bridge.py, modules/lazy_loop.py, modules/lazy_orchestrator_feedback.py, tests/test_loop_supervision.py

  • infer_source (function) modules/lazy_intel.py:79 def infer_source(command, intent_text) -- Classify where a resolved step likely came from.
  • describe_command (function) modules/lazy_intel.py:105 def describe_command(command) -- Describe a command with phase and risk.
  • record_routing_decision (function) modules/lazy_intel.py:120 def record_routing_decision(task_id, intent_id, command, intent_text, target, stack) -- Record which verb the loop chose for one intent.
  • record_routing_outcome (function) modules/lazy_intel.py:160 def record_routing_outcome(task_id, intent_id, command, state, facts, findings, stack) -- Record the terminal outcome of one executed command.
  • read_decisions (function) modules/lazy_intel.py:202 def read_decisions(task_id, limit) -- Read routing records, optionally filtered by task.
  • mask_configured (function) modules/lazy_intel.py:228 def mask_configured(text) -- Mask only operator-configured credential values in live text.
  • stack_signature (function) modules/lazy_intel.py:254 def stack_signature(assets) -- Fingerprint the target stack from service assets.
  • fuse_routing_decisions (function) modules/lazy_intel.py:285 def fuse_routing_decisions(task_id) -- Fuse routing records into the world model as host notes.
  • export_spans (function) modules/lazy_intel.py:324 def export_spans(task_id, out) -- Export activity records as trace spans for observability.

Next: API_p13.md

Start

Wiki

Agent Docs

Recipes

Clone this wiki locally