Skip to content
프로젝트

소개

Sage is a virtual Mythic agent that that uses an AI agentic system to operate Mythic and Mythic agents running on compromised hosts.

AI 및 머신러닝

이 수치를 측정하는 방법

What you can do

  • Observe - list_callbacks, get_task_history_for_callback, get_all_uploaded_files - read-only
  • Tasking - issue_task_and_waitfor_task_output - guarded
  • Capabilities - execute_capability, build_capability_commands - guarded / read-only
  • Payloads - create_payload, download_payload - guarded / read-only

측정된 스타 증가

in 24h
0
in 7 days
+4
in 15 days
+6
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Sage

Sage

Sage is an AI operator that lives inside your C2 and works under your direction. It reads your live Mythic operation — its callbacks, tasks, credentials, and files — alongside your BloodHound graph and reasons over it the way an analyst would. Ask it a scoped question about the engagement and get a grounded answer, or work an objective with it: Sage proposes each next step as a concrete Mythic task, shows you what it expects that step to prove, and runs it only when you approve. Sage drives Mythic and operates through your Mythic payloads; it never touches the target environment itself.

Concretely, Sage is a chat container for Mythic. It is not a standalone tool — it installs into a Mythic server the same way a payload type or C2 profile does, and it has no function outside one. It gives operators an AI/LangGraph interface to Mythic through its API: it can drive the same Mythic surfaces an operator does — callbacks, payloads, tasks, credentials, files, and more — and reason over the BloodHound graph. It runs on the control plane: it is not an implant and does not create a Sage payload callback.

Sage is built for supervised, operator-approved work in Mythic. Conversation mode reads and answers; supervised mode proposes one guarded action at a time and runs it only after you accept its approval card. A separate, experimental auto mode can pursue an explicitly configured objective without per-action approval; it is a research and evaluation capability, validated only against the GOAD lab. Target-facing activity always executes through a live Mythic payload callback. The Sage process may query Mythic and BloodHound control-plane data, but it must not connect directly to target LDAP, SMB, Kerberos, WinRM, RPC, HTTP, or similar services, and Sage-local attack artifacts are not admissible proof of an objective.

Sage supervised approval card in Mythic
Supervised mode: Sage works the objective in a specialist agent and pauses each guarded action for your decision — Accept, Reject, or Respond with guidance. Captured from a development build in October 2026.

⚠️ Authorized use only, and still maturing. Use Sage only for activity you are explicitly authorized to perform. It is under active development, and its behavior in a production environment is not yet well understood: an autonomous agent driving a C2 carries real risk of unintended impact on a live network. Weigh production use very carefully, and prefer labs and authorized engagements until Sage has matured.

Contents

How Sage works

Product contracts and authority modes

Sage has two distinct product contracts:

  • Assisted mode is the consultant-facing product umbrella over the existing conversation and supervised runtime modes. It observes the current Mythic operation and answers through normal Mythic Chat. conversation is read-only; supervised may propose a concrete guarded action, but that exact action runs only after the consultant approves it.
  • Auto mode is the experimental autonomous CTF contract. It attempts an explicitly configured objective end to end without an operator approving each action. Its current validation is GOAD-only; that does not establish reliability or generalization elsewhere.

conversation, supervised, and auto are the only runtime authority modes. Assisted mode is not a fourth selectable mode: it names the product experience provided by conversation and supervised together. The assisted and auto contracts therefore share control-plane evidence and Mythic execution plumbing without sharing the same authority or acceptance standard.

When authority permits action, Sage runs an observe/model/select/execute/verify loop. It observes state from Mythic and BloodHound, models the actions available to it as typed capabilities, selects one, executes it as a Mythic task, verifies the effect from real proof, then repairs or re-plans — appending every proven effect to the Engagement State Ledger.

flowchart LR
    O[Observe: Mythic + BloodHound] --> M[Model capabilities]
    M --> S[Select next action]
    S --> E[Execute as Mythic task]
    E --> V[Verify from real proof]
    V --> R[Repair / re-plan]
    R --> O
    V --> L[(Engagement State Ledger)]

In an autonomous solve, a deterministic controller (autonomous_controller.py) honors the model's intent to act but owns which capability actually runs and how it is built — the mechanics stay below the model. GOAD is a development benchmark, not a strategy source: domain names, hosts, accounts, and attack paths do not live in the product runtime. Sage plans from the graph and callbacks in front of it, so the same loop is meant to transfer to other Active Directory environments with different names and paths.

The split of LLM judgment from deterministic execution and verification draws on prior work:

  • LLM+P: Empowering Large Language Models with Optimal Planning Proficiency — Liu et al., 2023 — arXiv:2304.11477. The LLM translates the problem into PDDL and a classical planner solves it deterministically — the solver, not the model, owns correctness.
  • LLMs Can't Plan, But Can Help Planning in LLM-Modulo Frameworks — Kambhampati et al., 2024 — arXiv:2402.01817. Pair the LLM with sound external verifiers rather than trusting it to plan unaided.
  • Agents Thinking Fast and Slow: A Talker-Reasoner Architecture — Christakopoulou et al., 2024 — arXiv:2410.08328. A fast conversational agent over a slow reasoner that owns planning and produces the agent's state.

Agents

The agent graph routes requests through a Supervisor and six specialists. Configured autonomous objectives can instead use the native capability controller, which owns the policy-selection/execution/verification loop and bypasses Supervisor/worker negotiation. A result from that controller path does not measure the specialist graph. Each agent's system prompt is a plain markdown file under Payload_Type/sage/prompts/ — edit the body, start a new chat, and that agent's behavior changes with no Python edit and no restart. This is how you ship your own playbook with an engagement.

Agent Role
Supervisor Routes requests and coordinates specialists on the agent-graph path
Mythic_Operator All Mythic C2 operations and in-memory offensive tradecraft
Mythic_Payload Builds and configures Mythic payloads and C2 profiles
BloodHound Attack-graph lifecycle — collects, ingests, and analyzes BloodHound facts
MCP_Manager Bridges arbitrary third-party MCP servers
Generalist General Q&A with no Mythic, TTP, or tool access
Sandbox Local-only isolated shell/Python snippets for scratch computation

See prompts/README.md for the prompt format and the editing workflow.

Runtime packages

The runtime entry point is Payload_Type/sage/main.py. Importing sage_chat registers the SageChat container with Mythic. Each Mythic chat channel owns a reusable LangGraph Model session, while each request gets its own streaming emitter and terminal lifecycle.

Path Responsibility
Payload_Type/sage/sage_chat/ Native chat registration, configuration, sessions, streaming, HITL, and slash commands
Payload_Type/sage/ai/langgraph/model.py Agent topology and autonomous execution kernel
Payload_Type/sage/ai/langgraph/mythic_tools.py Mythic API and capability execution surface
Payload_Type/sage/ai/langgraph/capabilities.py Generic capability candidates and structured verifiers
Payload_Type/sage/ai/langgraph/engagement_state.py Observed predicates, effects, and execution state
Payload_Type/sage/ai/langgraph/graph_reconciler.py BloodHound facts projected into engagement state
Payload_Type/sage/ai/langgraph/access_reconciler.py Mythic callback and liveness facts projected into footholds
Payload_Type/sage/ai/trajectory/ Runtime failure recording and advisory repair metadata
Payload_Type/sage/prompts/ Externalized agent prompts
Payload_Type/sage/ttps/ Tradecraft references and pinned tool metadata

The Engagement State Ledger

An LLM does not remember your engagement between turns. Sage keeps that memory outside the model, in a durable Engagement State Ledger: a running record of the capabilities and credential material the operation has gained, so a multi-day assessment survives context resets, restarts, and even a change of model.

The Engagement State Ledger shown by /state
/state renders the ledger: each row's effect, status, task, and callback. Captured from a supervised run on a development build in November 2026.

  • What it is. One ledger per Mythic operation, shared live by every chat channel of that operation — a table of gains, each achieved or pending. A pending row is waiting for its effect or its proof and never satisfies a capability's precondition. You read and correct the ledger in chat with /state. Each row keeps a permanent number (the # column), assigned once and never reused. A correction never deletes a row: /state remove records a retraction (who, when, why) that you can undo with /state restore, and /state invalidate marks a row "no longer holds". The row keeps its number and shows the correction, and no session relies on it again. The Supervisor and Mythic_Operator get a fresh view of the ledger, with the same numbers, on every model call in every mode, so you can ask about "hop 4" directly, even in a new chat. When a conversation or supervised turn ends, and on /state reconcile, Sage reconciles the operation's Mythic tasks from every callback and every issuer. The ledger records verified gains, not every task: a task whose effect no verifier confirms leaves no achieved row, even when the task itself succeeded, and failed attempts stay in Mythic's task history.

  • Why it is proof-gated. A row counts as achieved only when it traces back to real evidence: a verifier's check of Mythic task output or files, Mythic's credential store, Mythic's callback records, or BloodHound data collected through a payload, or a rule in Sage's code that derives it from rows that already have that proof. Each achieved row carries a proof envelope recording what it rests on (the Mythic callback, task, transaction, credential, file or BloodHound ingest it came from, or the rule and premise rows behind a derived row) and the verifier's input and result hashes (sha256). An achieved write without an admissible envelope is stored as pending (proof_missing) and never counts as proof. The model can read the ledger and submit Mythic evidence IDs for verification, but it never writes rows itself, so it cannot write itself a success it did not earn.

  • Where it lives. In Sage's application database, sage.db (SAGE_DATABASE_PATH overrides it), keyed by the Mythic operation and the reset marker Sage stores in that operation. Every change is a short transaction that touches only the rows it changes and appends to the row's history, so concurrent channels never overwrite each other. skills/sage-goad-reset/scripts/engagement_ledger_migrate.py export writes the portable JSON record of an operation; the reset archives the database together with those exports. It is not a checkpoint or a trace, both of which live elsewhere and prove nothing on their own. Ledgers from releases that stored .sage_engagement/state_*.json files are imported once with that script's import command, with Sage stopped.

Why a ledger at all. An autonomous agent that reasons only over its own transcript re-runs steps it has already completed and attempts steps whose preconditions it never met: it substitutes recitation for perception. The oracles do not fix this by themselves — BloodHound shows that an edge is abusable, not that you already abused it, and Mythic shows callbacks, not "I ran step X." The ledger is the one piece of state that lives in neither oracle, and it is what lets Sage answer "already done?" and "precondition met?" before every hop. The design draws on prior work in autonomous-pentest state and agent memory:

  • PentestGPT — Deng et al., 2023 — arXiv:2308.06782. The Pentesting Task Tree: an external structure that encodes the test's ongoing status and steers the next action — the direct precedent for an external engagement-state object.
  • Guided Reasoning in LLM-Driven Penetration Testing Using Structured Attack Trees — Nakano et al., 2025 — arXiv:2509.07939. A deterministic MITRE ATT&CK task tree constrains the agent to defined techniques.
  • CoALA: Cognitive Architectures for Language Agents — Sumers et al., 2023 — arXiv:2309.02427. The working-memory vs long-term-memory split for language agents.
  • MemGPT: Towards LLMs as Operating Systems — Packer et al., 2023 — arXiv:2310.08560. Keep full state external and page only the relevant slice into context.
  • Incalmo — Singer et al., 2025 — arXiv:2501.16466. Declarative tasks plus a service to manage acquired assets; names context bloat as the failure mode.
  • Can LLMs Hack Enterprise Networks? — Happe & Cito, 2025 — arXiv:2502.04227. Autonomous assumed-breach pentest on GOAD; documents the same planner-to-executor state-loss failure the ledger closes.
  • Shell or Nothing (TermiAgent) — Mai, Hong et al., 2025 — arXiv:2509.09207. Memory-activated agents; structured retention of recon facts over narrative memory.
  • PentestAgent — Shen et al., 2024 — arXiv:2411.05185. RAG-augmented multi-agent pentest.

Repository layout

This is a monorepo with distinct release boundaries:

Payload_Type/sage/    Shipped Mythic chat capability and runtime
docs/                 Public architecture and development documentation
skills/               Operator and developer workflows
ludus/                Range definitions and provisioning

Evaluation and development packages currently retained beneath Payload_Type/sage/ are excluded from the container image. Product code cannot import range definitions, evaluation packages, or operator skills. See Repository Boundaries for the complete contract and migration strategy.

Requirements

  • Requires Mythic v4.
  • Python 3.14 and a repository virtual environment.
  • Model-provider credentials or an OpenAI-compatible endpoint.
  • For the live-qualified graph path, BloodHound CE 9.5.1 plus BloodHound MCP commit 92a37dd481ce675fe552f14c9957a31dbbcd212e. Sage also needs that MCP's ingest-status operation, which no upstream commit has, so Sage ships it as Payload_Type/sage/patches/bloodhound-mcp-ingest-status.patch (see Ingest readiness).
  • For live-qualified target activity, an Apollo v0.1.0-rc1 callback. Other payload types may work through the generic adapter but have not been live-qualified.

Create the development environment from the repository root:

python3 -m venv .venv
.venv/bin/pip install -r Payload_Type/sage/requirements-dev.txt -c Payload_Type/sage/constraints.txt

Three files, three jobs:

File Role
requirements.txt Intent — the packages Sage depends on directly. This is what the container image installs.
requirements-dev.txt Pulls in requirements.txt and adds test dependencies. Use this for development.
constraints.txt Resolution — every transitive package pinned to a version a green suite was observed against.

The -c flag is what makes your environment match the one the tests passed on, and match the image — without it pip resolves transitives fresh, which has silently broken imports before. Regenerate constraints.txt after any intentional dependency change, from a venv whose suite is green; the header in that file carries the exact command. See Dependencies for the reproducibility rationale and the incident that motivated it.

Do not put credentials in tracked files. Use Mythic user secrets, the per-chat configuration, process environment variables, or a secret manager. Payload_Type/sage/.env is the one deliberate exception to "no tracked env file", and it ships empty — every line commented out, so a fresh clone configures nothing. See The .env file.

Install and run Sage

In Mythic

Install Sage into a running Mythic the same way as any agent, from your Mythic directory:

sudo ./mythic-cli install github https://github.com/MythicAgents/sage

The installer pulls the published image named in config.json (ghcr.io/mythicagents/sage:<version>) instead of building one. To build from your checkout instead, run sudo ./mythic-cli config set sage_use_build_context true and then sudo ./mythic-cli build sage. Each version image is published from main before its release tag, and the annotated v<version> tag records that image's manifest digest, which the tag's CI checks without rebuilding.

The container runs Sage as the user who owns InstalledServices/sage, so the databases and state Sage writes there belong to that user, not root. A later mythic-cli install by that user can replace the directory without sudo. On its first start, the container hands back to that user any root-owned files an older Sage left there. A reinstall replaces the whole directory, including sage.db and .phoenix/, so archive them first if you need the history (see Runtime state and clean resets).

After the container registers, create a Mythic chat channel using the Sage model, then configure provider, model, mode, policy, and credentials in the channel or user-secret views. Mythic renders Sage output as markdown and renders each tool execution as an updating, collapsible card. What you do next happens in the chat itself — see Using Sage in chat.

BloodHound is the one exception to per-chat configuration: its connection is process-global, so you fill the BLOODHOUND_* fields in once and leave them blank in later chats. See BloodHound.

SQLite on macOS Docker Desktop / OrbStack

Sage keeps two SQLite databases in its service directory (InstalledServices/sage/), which Mythic bind-mounts into the container: sage.db and .phoenix/phoenix.db. On macOS, Docker Desktop and OrbStack share that directory through a file-sharing layer that does not support SQLite's locking. SQLite then reports unable to open database file.

Move both databases to a path inside the container. Add two lines to Sage's .env, then restart the Sage container. In the Mythic UI's container file browser, .env is in the top folder (the browser opens inside Sage's service directory). On the Mythic host it is InstalledServices/sage/.env, and these commands, run from your Mythic directory, append the lines there:

echo 'PHOENIX_WORKING_DIR=/opt/sage_data' | sudo tee -a InstalledServices/sage/.env
echo 'SAGE_DATABASE_PATH=/opt/sage_data/sage.db' | sudo tee -a InstalledServices/sage/.env

You must set both. Startup creates the directories, checks that sage.db can be opened and locked, and stops with an error that names the path if it cannot. The databases survive a container restart but are deleted when the container is recreated, for example by a rebuild or reinstall. Archive them first if you need the history (see Runtime state and clean resets).

Local development

The supported development workflow runs Sage in a local sage tmux session while Mythic remains Docker-backed. Create the session once:

tmux new-session -d -s sage

Then use the canonical launcher from the repository root:

/bin/bash skills/sage-goad-reset/scripts/sage_restart.sh SAGE_BLOODHOUND_MCP_DIR=/path/to/bloodhound_mcp

The launcher preserves the effective environment of an existing Sage process, applies explicit KEY=VALUE overrides, verifies the virtual environment before stopping anything, and relaunches inside the same tmux session. It must not print secret values in status output.

Inspect native chat readiness without submitting an objective:

.venv/bin/python skills/sage-live-runner/scripts/native_chat.py inspect --runtime-dbs-archived

--runtime-dbs-archived is an operator attestation that the active Sage and Phoenix databases were archived before this Sage process started; it does not delete or ignore them. The comprehensive demo readiness command is documented in skills/sage-goad-reset/SKILL.md; its default operation is read-only and reports each readiness component instead of collapsing partial checks into a misleading global success.

For scripted native chat, use the maintained runner:

.venv/bin/python skills/sage-live-runner/scripts/native_chat.py prepare
.venv/bin/python skills/sage-live-runner/scripts/native_chat.py run --prompt 'Describe the scoped objective here.' --timeout 1800

The runner reports channel and request identity immediately, then emits progress until Mythic records a terminal request.

Using Sage in chat

Everything below happens inside a Mythic chat channel with the Sage model.

Modes

Set mode when you create the channel, or switch it live with /mode:

Mode What Sage can do When to use
conversation (default) Reads Mythic and BloodHound state, queries read-only tools (callbacks, graph, credentials, tradecraft), and answers. Cannot fire a guarded/offensive action. Asking questions, reviewing the graph, getting tradecraft advice, planning. The safe default.
supervised Proposes guarded actions; each one waits for your approval before it runs. Interactive engagement work where you want Sage to act but keep a hand on every trigger.
auto (experimental) Runs the autonomous kernel — observe → select → execute → verify — with no per-action approval. Validated only against the GOAD lab. Research and evaluation against a prepared lab objective with a live callback and an ingested graph.

/mode with no argument reports the channel's current mode.

Sage in experimental auto mode on the GOAD lab
Experimental auto mode in a GOAD lab: the Engagement State Ledger fills in as each hop is verified, through to domain compromise. Recorded by August 2026 on a development build that predates 0.1.0-beta; auto mode was not run live on 0.3.0. Auto mode is a research and evaluation capability, exercised only on GOAD.

Supervised approvals

In supervised mode every guarded action — issuing a command, executing a capability, creating a payload, adding a credential — pauses as a native Mythic approval request before it runs. Approval is default-deny: only an explicit Accept lets it through. In normal native supervised chat, simultaneous guarded tool proposals are narrowed to one; Sage must propose a later guarded action on a fresh card. An objective-led controller run also pauses before each proposed move. A card for execute_capability approves that exact capability action and its arguments; its adapter may issue several Mythic tasks while carrying it out. Inspect the displayed scope before accepting. Read-only tools (list_*, get_*, downloads) never prompt. For direct Mythic task proposals, the card shows the deterministically prepared command and arguments. If the command schema or selected registered file changes before issuance, Sage stops and requires a fresh proposal; an explicit token_id is refused because this task path does not forward it to Mythic. If an accepted task has not returned a confirmed result by the wait deadline, ordinary supervised chat ends that request with the exact Mythic task ID and an incomplete-observation notice. The task's outcome is still unknown; Sage does not automatically issue it again. A fresh request can inspect that task's output or history before you decide whether to approve another action.

With Autonomous Solve enabled in a supervised channel, the first prompt becomes a continuing objective for Sage's controller. Each controller move still pauses for a native approval card. With that option off, supervised chat uses the ordinary LangGraph consultation path and approval cards for guarded tools. Reject skips the proposed move and lets Sage consider an alternative with a fresh approval. Respond denies that move and carries your guidance into the next model selection. Hybrid consults the model for this guidance even when only one alternative remains. Symbolic policy cannot interpret Respond guidance and hands control back without issuing another action. Objective-led completion requires objective evidence; completing one collection does not prove the objective.

Guarded tools are also scope-preflighted: each maps to a required Mythic bot-token scope (task.write, payload.write, credential.write, file.write, or file.read), and a tool whose scope your channel token lacks is disabled up front rather than failing mid-run.

For every Sage tool to be available, give the channel token chat-ai.write, apitoken.write, callback.read, response.read, operation.read, operator.read, task.write, file.write, payload.write, credential.write, and eventlog.write (each .write also grants its .read). Mythic requires the first two on any AI channel token. Sage's session token inherits the channel token's scopes, and Mythic rejects a query the token has no read scope for.

Slash commands

Command What it does
/state Show the Engagement State Ledger — the durable table of achieved and pending gains shared by every chat in the current Mythic operation
/state help Show /state usage without reading the ledger
/state objective <text> Set the operation's stored compatibility objective (an operation setting, not a channel goal)
/state reconcile [<id>[,<id>…]] [apply] Record verified effects from the operation's completed Mythic tasks, from any issuer, or from the cited task IDs, cred:<id> and file:<id> entries. Verified updates are saved immediately; apply only permits importing missing credential material into Mythic's credential store, which is previewed unless apply is given, because task output is attacker-influenceable
/state set <#|id> achieved task=<id> type=<type> account=<account>@<realm> line=<n> after=<text> Promote a pending account-secret row to credential material by citing where the secret sits in a task's output; Sage never takes the secret itself, and only a task whose completion function failed after the agent answered qualifies
/state remove <#>[,…] [--reason <text>] · /state restore <#>[,…] · /state invalidate <#>[,…] Retract a row, undo a retraction, or mark a row "no longer holds", by hop number (the # column) or hop id. Rows are kept and numbered; no command marks a row achieved without verified evidence
/state wipe Retract every row and every current graph fact; nothing is deleted or renumbered
/mode [conversation|supervised|auto] Show or switch the channel's mode
/model [name] Show this chat's model, or change it in the chat's Model setting; the conversation continues
/list List active Sage chat sessions
/tools List Sage's public Mythic tool functions, descriptions, and access requirements
/tools staged List the binaries in Sage's tools/ drop zone: type, architecture, matching TTPs, and whether Mythic already holds them
/report [identity] Show retained identity/membership observations shared across assisted chats in this operation engagement, unknown access prerequisites, and next checks; one identity metadata check, no model call or new task
/stop Cooperatively stop the running agent on this channel
/bloodhound [force] [dir] Connect, report, or rebind the BloodHound MCP — see BloodHound
/mcp <list|tools|call|connect|disconnect|policy> Manage MCP servers — see Connecting other MCP servers
/sandbox [shell|python] <code> Run an isolated local snippet (no network or host mounts; needs no Mythic scope)
/acp [status|connect codex|models|model <id>|disconnect] Connect this channel to an optional, separately deployed Codex worker and choose its model; configuration only, no prompt is sent — set up the worker with container/codex/SETUP.md

/state is available in conversation, supervised and auto modes. Its ledger is shared across chats in the same operation engagement and persists once written. A new engagement can show an empty ledger: viewing operation details or callbacks does not record an achieved effect, and reading /state does not add rows.

/report defaults to the identity report; /report identity remains supported. It is available in conversation and supervised chat, including a fresh chat without model initialization. It uses matched task observations Sage has collected in the same Mythic operation engagement, shared across chats and retained across Sage restarts. It performs a bounded read-only operation-marker check before reading local evidence; it does not scan Mythic task history. Original collection provenance remains visible, and missing or changed engagement identity makes sharing unavailable. Observations may be historical or incomplete. A reported identity or host membership does not prove current authentication or access. The report has authored next checks; general chat remains exploratory model prose. See the bounded report contract.

/tools and simple questions such as “list your tools” use the same deterministic inventory without a model call. The inventory distinguishes read-only tools from guarded actions and reports known session restrictions. Before a session is initialized, live token availability is unverified. Use /mcp tools for connected MCP tools; payload callback commands are a separate inventory retrieved from Mythic.

Tools and capabilities

Sage classifies tools as read-only (enumerate callbacks, payloads, tasks, files, and credentials; retrieve tradecraft guidance; build capability plans) or guarded/offensive (issue a command, execute a capability, create a payload, add a credential, ingest a collection, run in the sandbox). The public Mythic tool inventory is available through /tools; internal helpers and callback payload commands are separate. Every tool carries a @tool_safety decorator (TOOL_SAFETY_READ_ONLY, TOOL_SAFETY_GUARDED, or TOOL_SAFETY_STAGING) and CI enforces that no tool ships unclassified — an undecorated method defaults to guarded at runtime. The classification determines behavior across modes: guarded tools are approval-gated in supervised mode, denied in conversation mode, and only they can change target state. The one staging tool, ensure_tool_uploaded, writes only Mythic's operation file store: it needs no approval in supervised mode and is denied in conversation mode.

Area Example tools
Observe list_callbacks, get_task_history_for_callback, get_all_uploaded_files read-only
Tasking issue_task_and_waitfor_task_output guarded
Capabilities execute_capability, build_capability_commands guarded / read-only
Payloads create_payload, download_payload guarded / read-only
BloodHound ingest ingest_collection guarded
Credentials read_credentials, add_credential read-only / guarded
Tradecraft get_ttp_guidance, list_ttp_categories read-only
Sandbox sandbox_exec guarded

On top of the tools sits a 15-step generic capability layer: typed actions with preconditions, effects, and structured verifiers that the planner chains from observed state. It models a full attack chain generically — for example: collect graph → GPO-controlled SYSTEM execution → grant directory (DCSync) rights → DCSync krbtgt → forge a golden ticket → ADCS abuse. Each step unlocks only from verified proof of the previous one; nothing is recorded on assertion alone. These capabilities are range-agnostic by design — there is no GOAD path baked in.

Tradecraft is backed by a curated corpus of 237 tradecraft references (Payload_Type/sage/ttps/) that the agents retrieve against through get_ttp_guidance.

Tool drop zone. Payload_Type/sage/tools/ is an operator drop zone for tool binaries. It ships empty — Sage bundles no offensive binaries. Drop a binary in (for example Rubeus.exe, Certify.exe, SharpHound.exe, SharpGPOAbuse.exe, SharpDPAPI.exe, or Whisker.exe) and Sage can see it through the read-only list_staged_tools tool, then stage it into Mythic on demand instead of making you upload it by hand. The inventory reads each file's type and architecture from its header, matches renamed and per-architecture builds (new_sharphound_x64.exe, SharpHound.o) to their TTPs, and says whether Mythic already holds the same bytes. A binary no TTP documents is listed with a hint that tells Sage to ask you what it is for before using it. /tools staged shows the same inventory in chat. download_tool can also fetch a pinned, sha256-verified binary from its TTP source straight into this folder. Staging a file never authorizes running it.

For operator-run static metadata and reviewed executable-help inspection in isolated containers, see off-target artifact inspection. This workflow does not use a target callback or add a new chat command. For enrolled executables, Sage supports versioned executable arguments with typed fields and deterministic rendering before approval through supported Apollo wrappers.

Sage discovers commands and validates arguments against the live payload's advertised command schema. Automated workflows also use payload-specific profiles in mythic_capability_adapter.py to select commands and account for execution and authentication behavior. The automated graph-collection controller currently has profiles for Apollo and Merlin; it excludes payload types without a collection profile. Discovering a payload's commands does not establish support for every automated capability on that payload.

See payload adapters and command discovery for the profile mappings and approval/alias boundary. An implemented profile is separate from live validation; live qualification has used Apollo only (see Limitations).

The complete tool and capability reference is in docs/reference/TOOLS_AND_CAPABILITIES.md. Because the exposed set is assembled in code, treat that page as a snapshot and the source as authoritative.

Configuration load order

Every native-chat setting — model settings and BloodHound credentials alike — resolves through one chain, first non-empty wins:

  1. Mythic channel configuration — the per-chat fields you fill in when creating a Sage chat.
  2. Mythic user secrets — the operator's stored secrets. Preferred home for tokens and API keys.
  3. Sage process environment — what Mythic injects into the container, your shell for local development, and anything Sage loads from Payload_Type/sage/.env at startup.
  4. Safe defaults, where one exists.

The .env file

Payload_Type/sage/.env is committed on purpose, which is unusual and deliberate. Most projects ship a .env.example you copy — under Mythic that would mean getting a shell inside the container. Shipping the real file means you edit it from the Mythic web UI: open the Sage chat container's files (Installed Services → Chat → sage → View Files), where .env is in the top folder, edit it, and save. Editing needs no shell, no docker cp, and no sudo. The change applies after a container restart, and Mythic's web UI has no restart control as of v4.0.8, so run sudo ./mythic-cli restart sage on the Mythic host.

It ships with every line commented out, so cloning Sage sets nothing.

Two rules govern how it loads, both enforced in dotenv_bootstrap.py:

  • A variable already in the environment wins. Mythic injects 21 variables into the container. Nothing in this file can override them, so a stale entry cannot break your broker connection. That is why RABBITMQ_HOST, MYTHIC_SERVER_HOST, RABBITMQ_PASSWORD and DEBUG_LEVEL sit in a clearly-marked local-development section — set them only when running Sage as a bare process outside Docker.

  • An empty value is ignored. KEY= sets nothing. Uncommenting a line and leaving it blank is identical to leaving it commented, so you cannot accidentally define an empty variable that later reads as "configured" and disables a fallback.

Use it for values you want shared by every chat in the container. Use the chat configuration for per-chat values, and Mythic user secrets for anything sensitive.

Because the file is tracked, your edits appear in git status — .gitignore does not apply to tracked files. To keep your local copy out of diffs while contributing, git update-index --skip-worktree Payload_Type/sage/.env (a per-clone setting; undo with --no-skip-worktree). The file is excluded from the image (.dockerignore), so it never bakes in — under Mythic it reaches the container through the bind mount, which is also why your edits survive a rebuild.

One caveat worth knowing before you rely on layer 3: the BloodHound MCP runs as a subprocess, and the MCP stdio client only passes it a fixed safe subset of Sage's environment (HOME, LOGNAME, PATH, SHELL, TERM, USER). A BLOODHOUND_* variable set on the Sage container therefore does not reach the MCP server by inheritance — Sage resolves it through the chain above and forwards it explicitly. See BloodHound for the file-based alternative.

Model configuration

Model settings resolve through the chain above. The main settings are:

Setting Purpose
provider openai (default), bedrock, anthropic, or ollama
model Provider model identifier
API_ENDPOINT Optional endpoint override — point openai at any OpenAI-compatible server (see below)
API_KEY Provider API key when required
mode conversation (default), supervised, or auto — see Modes
autonomous_solve Enable objective-led controller execution; supervised mode still requires approval for each guarded action. Ignored in conversation mode, which stays read-only
policy_mode hybrid (default), symbolic, or llm capability selection
max_steps Model-step ceiling per chat request; unset defaults to 200, 0 means unlimited
SAGE_OPENAI_API OpenAI API: blank keeps the adapter's usual route; chat_completions or responses selects one (OpenAI provider only)
SAGE_OPENAI_ACCESS_PROGRAM OpenAI Daybreak: standard (Off), daybreak_blue or daybreak_red. Any value, Off included, requires SAGE_OPENAI_API=responses; blank sends Off on Responses
SAGE_OPENAI_SAFETY_IDENTIFIER OpenAI Safety Identifier: a stable pseudonym for the person using the chat, sent as safety_identifier
SAGE_REASONING_EFFORT Reasoning Effort: blank sends no effort (the provider's default for the model); none, minimal, low, medium, high, xhigh or max is sent as chosen (OpenAI provider only)

Providers. The four above are the tested set. Sage builds the model through LangChain's init_chat_model, so other providers it supports may work but are unverified. Bedrock is the only provider with dedicated AWS credential and region handling exposed in the channel configuration. Never infer the effective backend from the model name alone; record the provider and route for live runs.

OpenAI-compatible endpoints. Selecting provider: openai does not tie you to OpenAI. It speaks the OpenAI API — the de-facto standard most inference servers and gateways implement — so you can set API_ENDPOINT to any server that exposes it: a self-hosted model, an internal gateway, or a proxy. For example, run a LiteLLM proxy and point API_ENDPOINT at it to reach 100+ providers behind a single OpenAI-compatible endpoint.

OpenAI Responses and Daybreak. Some OpenAI models are served only on the Responses API, including the -cyber models from GPT-5.6 Cyber on. Set OpenAI API to Responses and keep API_ENDPOINT as the base URL (https://api.openai.com/v1); Sage adds /responses itself. Responses requests are stateless (store: false): Sage keeps the conversation and sends it, with the model's encrypted reasoning, on each request. On Responses, Sage always names the Daybreak program and sends Off (standard, standard safeguards) unless you choose Blue or Red, so a project's own default program is never used implicitly. Blue or Red requires an OpenAI project approved for that program. GPT-6 Cyber uses Responses + Red and needs Daybreak Red approval, separate model approval, a non-default project with access enabled, and an allowlisted sending IP; ZDR projects also need Private Safety Processing. An OpenAI Safety Identifier is optional for every model; OpenAI recommends one so it can act on a single user instead of the whole organization. Sage never derives one from a Mythic username; use the same pseudonym for the same person. Invalid combinations fail before any request: any OpenAI Daybreak value, Off included, without OpenAI API = Responses (wherever the value comes from: the chat, a user secret or the environment), or any of these settings with a non-OpenAI provider. When the provider rejects a route (for example a Responses-only model on Chat Completions, or a Daybreak access error), the error names the setting to change and says whether the chat continues. Changing Model (or running /model <name>), OpenAI API, OpenAI Daybreak, OpenAI Safety Identifier or Reasoning Effort continues the same chat with its conversation, and a fix made in the OpenAI project without changing Sage's settings is retried in the same chat. Changing the API key, provider or API endpoint starts a new chat. Sage never switches the model, provider, endpoint, API or reasoning effort on its own.

Reasoning effort and tools. Reasoning Effort resolves like every other setting: the chat's field, then the SAGE_REASONING_EFFORT user secret, then the environment. Blank all the way through sends no effort, so the provider's default for the model applies; that is not the same as None, which Sage sends as an explicit value. Supported values depend on the model, so check its model page: for example, OpenAI documents that GPT-6.1 Sol does not accept None. Several OpenAI reasoning models accept function tools together with a reasoning effort only on the Responses API; on Chat Completions the provider answers Function tools with reasoning_effort are not supported …. Sage's tools are always offered, so for a reasoning model with tools set OpenAI API to Responses and choose an effort the model supports. The supported setup for GPT-5.6 Sol and GPT-6.1 Sol with tools is OpenAI API = Responses, Reasoning Effort = Low and OpenAI Daybreak = Off. When the provider refuses an API or effort combination, the error names the setting, the effort Sage sent and where that value came from, and the change to make; correcting it continues the same chat. Sage 0.3.0 cannot select the Responses API from a chat's settings: if the chat's model settings do not list OpenAI API, upgrade Sage first. Through an OpenAI-compatible proxy (API_ENDPOINT), the proxy decides which route and efforts reach the model; Sage sends what you selected and does not infer a proxy's capabilities from a model name.

Changing the model. Edit the chat's Model setting, click the Model chip, or run /model <name> (/model alone shows the model and where its value comes from). /model <name> writes the chat's Model setting in Mythic, so Mythic's own rules apply: only the channel's creator or an operation lead/admin may change it, through the channel's API token. The next message continues the same conversation with the new model; its earlier messages, tool calls and results carry over, while the previous model's opaque reasoning is not sent to a different model. A model the provider rejects before it has answered leaves the chat as it was, with an error naming the model, the provider's message and the fix, so a wrong model name is corrected in place. A change made while an approval card is waiting does not apply until the card is answered or declined, by the model that raised it.

Policy. policy_mode controls how the next capability is chosen. hybrid (default) has deterministic code constrain the admissible actions and lets the model pick among them — the intended production mode. symbolic is a deterministic, model-free baseline, useful for reproducible debugging without LLM variance. llm lets the model choose from the full catalog: most latitude, weakest guardrails, mainly for research and eval comparisons. Choose hybrid unless you have a reason not to. This setting governs controller capability selection. Ordinary supervised chat with Autonomous Solve off uses the agent graph: read-only requests can run immediately, and guarded requests can be proposed for approval. Turning Autonomous Solve off does not remove the operator's ability to request an action.

Step budget. max_steps bounds the number of model steps in each chat request; the count starts again with every new request, and approving a card continues the same request's budget. Left unset it defaults to 200; set it to 0 for unlimited. A small ceiling caps cost and stops runaway loops on scoped work. For a full autonomous objective, raise it or set 0 — but the autonomous controller also enforces hard stop-losses independent of step count: 60 cycles, a 45-minute wall clock, a 3M-token budget, and a no-progress loop-breaker. Each is tunable through SAGE_CONTROLLER_MAX_CYCLES, SAGE_CONTROLLER_WALL_S, and SAGE_CONTROLLER_TOKEN_BUDGET.

BloodHound

Sage's graph analysis is backed by the BloodHound MCP server, which Sage runs as a subprocess and connects to at startup. BloodHound is a pre-wired, dedicated MCP server with its own agent; to attach any other MCP server, see Connecting other MCP servers.

Set the MCP checkout directory before starting Sage. This is Sage runtime config — the process reads it to auto-connect BloodHound at startup — so its home is Payload_Type/sage/.env, not the operator-tooling .env at the repository root. The key already exists there, commented; uncomment it and fill in your path:

SAGE_BLOODHOUND_MCP_DIR=/path/to/bloodhound_mcp

The container image bakes its own ENV SAGE_BLOODHOUND_MCP_DIR=/opt/bloodhound_mcp, so leave it commented under Mythic unless you are pointing at your own checkout. Exporting it in your shell also works for a single local session. The default launcher uses uv --directory "$SAGE_BLOODHOUND_MCP_DIR" run main.py for the stdio MCP server.

BloodHound credentials

The MCP server needs to reach your BloodHound CE instance. These resolve through the standard load order, so there are two places an operator can set them without a shell inside the container:

  1. The Mythic chat configuration, when you create the chat — per-chat, and the same place your model API key already lives. Mythic user secrets work too and keep the token out of plaintext channel config.
  2. Sage's own .env, which Mythic maps into the container. Open it from the Mythic installed-services page (View Files on the sage row; .env is in the top folder), fill it in, and save. Editing needs no shell, docker cp, or sudo. Then restart the container with sudo ./mythic-cli restart sage on the Mythic host, since Mythic's web UI has no restart control as of v4.0.8. Shared by every chat in that container. This is why that file ships tracked and fully commented out rather than as a .env.example you would need a shell to copy.

Full order, highest first: chat config → user secret → container env → .env.local → .env.

A third place exists and is the least durable: the BloodHound MCP server also reads its own .env from the directory SAGE_BLOODHOUND_MCP_DIR points at. Under Mythic that is the image's baked /opt/bloodhound_mcp, which is not on the bind mount — anything written there is lost on the next rebuild and cannot be edited from the UI. Prefer either option above.

Setting Purpose
BLOODHOUND_URL Where BloodHound CE is, as one address: scheme://host:port (e.g. http://localhost:8080). Sage expands it into the three variables the MCP server reads.
BLOODHOUND_TOKEN_ID API token ID
BLOODHOUND_TOKEN_KEY API token key

Sage forwards whatever it resolves into the MCP subprocess. Anything you leave unset is simply not forwarded, so the server falls back to its own .env — which is what keeps the file-based workflow (documented in docs/configuration/BLOODHOUND.md) working unchanged.

Ingest readiness

Connected is not the same as able to ingest. Sage verifies a graph collection only through BloodHound's own ingest-job status: it uploads the collection with file_upload(info_type="upload_bytes"), then reads that exact job with file_upload(info_type="status") until BloodHound reports it Complete. Only that verified result records the collection, which is what stops Sage collecting the same graph again.

The pinned MCP commit has no status operation, so the Sage image contains that immutable base plus Sage's checked-in patches/bloodhound-mcp-ingest-status.patch, applied at build time; the build fails if it does not apply. Changing either half needs an image rebuild (./mythic-cli build sage). Syncing Sage source into /Mythic cannot repair /opt/bloodhound_mcp, and a restart alone does not pick up a new image.

Sage checks the connected server, not a checkout on disk, with one read-only status read for job 0, which BloodHound never assigns:

  • /bloodhound reports Connection and Ingest separately, and probes an already-connected server too.
  • Conversation and supervised chats keep working with a connected but ingest-incompatible MCP; graph reads work, and the chat shows a one-time graph ingest is unavailable notice naming the fix.
  • Graph collection checks again before its first target task, and ingest checks again before it uploads. Against an incompatible server neither tasks the target nor uploads; the result is Collection failed with the dependency diagnostic.
  • Autonomous solves fail closed until the connected MCP answers the status read.

A collection whose job is still ingesting when Sage's two-minute wait ends reports Collection pending, and a job BloodHound ends as failed, partially complete, canceled, or timed out reports Collection failed. Neither counts as a verified collection. A host checkout's mcp_check.py result does not establish what the serving image can do; use the serving chat's /bloodhound answer when validating a deployment.

For a custom local MCP checkout (SAGE_BLOODHOUND_MCP_DIR pointing at your own clone), apply the same patch to a clean checkout of the pinned base, then sync and reconnect:

git -C /path/to/bloodhound_mcp checkout --detach 92a37dd481ce675fe552f14c9957a31dbbcd212e
git -C /path/to/bloodhound_mcp apply --check /path/to/sage/Payload_Type/sage/patches/bloodhound-mcp-ingest-status.patch
git -C /path/to/bloodhound_mcp apply /path/to/sage/Payload_Type/sage/patches/bloodhound-mcp-ingest-status.patch
uv --directory /path/to/bloodhound_mcp sync --no-dev

then /bloodhound force. Sage never patches a checkout itself; a checkout with other local changes needs your own judgment. An MCP that implements the same status contract natively needs no patch.

When BloodHound is not connected

Sage still works. BloodHound is central to Sage but it is not Sage's life support, and a missing optional dependency degrades a capability rather than the product:

  • Ordinary chat is unaffected. Conversation and supervised chats answer normally with no BloodHound credentials, no MCP directory, and no MCP server on disk. A hello gets a reply.
  • Autonomous solves fail closed, on purpose. A solve reasons over the attack graph to choose and verify each step, so running one without the graph would mean acting blind. An autonomous request is refused with a message that names BloodHound and repeats the setup steps.
  • Nothing is retried pointlessly. When a required credential resolves nowhere, Sage does not spawn an MCP server it knows will exit, and it does not repeat that attempt on every request. Fix the configuration and the next request tries again.

What you will see

In the Sage container log, at WARNING so it survives Mythic's default log level:

BloodHound auto-connect (chat): BloodHound MCP connect not attempted: required credentials are unset,
so the server would exit during startup.

Credentials Sage resolved for this attempt: NONE
Missing (required): BLOODHOUND_URL, BLOODHOUND_TOKEN_ID, BLOODHOUND_TOKEN_KEY

It names which credentials arrived and which did not — never their values. A bare McpError: Connection closed with no explanation means you are on a build from before this was fixed.

Configure once, not per chat

The BloodHound connection is process-global. The first chat that connects successfully establishes it for the whole container, and every later chat reuses that connection — so you only fill these fields in once, and can leave them blank in subsequent chats. There is no per-chat BloodHound setup to repeat.

Three consequences worth knowing:

  • A failed connect establishes nothing. If the first attempt fails — wrong port, unreachable host, missing token — the next chat tries again from scratch. You are not stuck with a bad connection, and you do not need to restart to retry.

  • Connect on demand with /bloodhound. New chats auto-connect before the graph is built. If you want to retry after fixing something, run /bloodhound in the chat. Plain /bloodhound is idempotent — it reports an existing connection rather than replacing it, so it is also a safe way to ask whether BloodHound is connected.

  • Rebind without a restart using /bloodhound force. To point an already-connected container at different credentials or a different BloodHound, run /bloodhound force (reconnect and --force also work) in a chat configured the way you want. It rebinds using that chat's resolved credentials, and the new connection is then the process-global one every later chat reuses. /bloodhound force <directory> also changes the MCP directory. One caveat: the rebind disconnects before it connects, so if the new settings are wrong you are left with no BloodHound connection rather than the old one. The failure message says so explicitly, and plain /bloodhound will then connect again once you have fixed the configuration.

If a connect fails, the returned message names which credentials Sage resolved and which required ones were missing, so you do not have to read the container log to find out.

For the file-based credential route under a Mythic install (persisting a .env across image rebuilds, the /opt vs bind-mount nuance, and local-development setup), see docs/configuration/BLOODHOUND.md.

Autonomous sessions fail closed if BloodHound cannot connect with the graph tools required by the execution kernel. Ordinary supervised chat remains available in a degraded, fail-soft state so an operator can diagnose or configure the integration.

Connecting other MCP servers

Sage can drive any MCP server, not just BloodHound. Connect one from chat:

/mcp connect {"name":"my-server","type":"stdio","command":"uv","args":["--directory","/path","run","main.py"],"sage_execution_class":"non_target_control_plane","read_only_tools":["search","fetch"]}

Transports: stdio (default), sse, and http / streamable_http.

Connecting a third-party MCP server with /mcp connect
Connecting a third-party server (Nemesis) with /mcp connect: note the required sage_execution_class and the read_only_tools allowlist.

Two rules will otherwise trip you up:

  • sage_execution_class is required. A connect with no execution class defaults to unclassified and is refused before it connects. To attach a third-party server you must set "sage_execution_class":"non_target_control_plane". This is deliberate: MCP servers are control-plane only — Sage never reaches a target through one.

  • MCP tools default to guarded. An MCP tool not explicitly classified is treated as guarded: it requires HITL approval in supervised mode and is denied in conversation mode. Classify tools via the mcp_tool_policy.json file in the Sage payload root (Payload_Type/sage/). Set SAGE_MCP_TOOL_POLICY to override the file path.

MCP tool policy

The policy file classifies MCP tools as read_only (freely available) or guarded (HITL-gated in supervised, denied in conversation). BloodHound CE ships pre-classified.

{
  "default": "guarded",
  "servers": {
    "bloodhound-ce": {
      "default": "guarded",
      "tools": {
        "domain_info": "read_only",
        "graph_analysis": "read_only",
        "file_upload": "guarded"
      }
    }
  }
}

Lookup order: tool-level override → server default → global default → guarded (hardcoded fallback). A missing or malformed file falls back to all-guarded. Use /mcp policy to view the effective policy.

Other /mcp subcommands

/mcp list (connected servers and tool counts), /mcp tools [server] (tool names), /mcp call <server> <tool> <json> (invoke one allowlisted tool directly, 60-second timeout), /mcp policy (show effective tool safety classifications), and /mcp disconnect <name>. For an agent to use a server during a turn, name it in your message — for example "using my-server, fetch …".

Custom TLS certificates

If BloodHound CE, Mythic, or a model endpoint presents a certificate signed by a private CA, put the CA bundle at certs/bundle.pem inside Sage's directory. At startup Sage concatenates it with the system CA store, writes certs/combined-bundle.pem, and points SSL_CERT_FILE at the result — so private CAs are trusted in addition to the public roots, not instead of them. Without a bundle.pem Sage logs that it is using system defaults and carries on.

Under a Mythic install the file goes in the mounted service directory, and mythic-cli install creates that tree owned by root, so writing to it needs elevation:

sudo cp your-ca-bundle.pem <mythic>/InstalledServices/sage/certs/bundle.pem

Restart the Sage container to pick it up. The same root ownership applies to anything else you place in that directory, including the BloodHound MCP .env route. For local development there is no bind mount — write directly to Payload_Type/sage/certs/bundle.pem.

combined-bundle.pem is generated on every start and is gitignored along with bundle.pem; neither is ever baked into the image.

Runtime state and clean resets

Payload_Type/sage/sage.db stores LangGraph checkpoints, tool cache, channel markers, controller recovery and operation-memory tables, including retained report observations. These surfaces share a physical SQLite file but retain separate APIs and erasure lifecycles. The default path is independent of the process working directory; SAGE_DATABASE_PATH can select an explicit application database path. Multiple chats share SQLite's writer limit, so write transactions must remain short and database lock failures must remain visible. If a legacy sage_operation_memory.db exists, startup refuses to silently ignore it. Stop Sage, then import it with .venv/bin/python skills/sage-goad-reset/scripts/migrate_operation_memory.py --sage-stopped. The import preserves the original file, verifies schema and records, rejects destination conflicts, and records an idempotent migration receipt. A changed legacy source requires operator review. The archive helper also honors SAGE_DATABASE_PATH and preserves legacy files and SQLite sidecars. An operation-memory wipe erases its operation rows, including report observations; it does not erase chat checkpoints in the same file. Payload_Type/sage/.phoenix/phoenix.db stores observability history. Treat both as retained trajectory data.

An active chat channel retains its session across ordinary turns, including pending approvals and objective context. When Sage restarts with its database retained, an existing channel continues on its next request: Sage rebuilds the session from the channel's saved record and its checkpoint, with its conversation, /mode override and engagement binding, and says so in the channel. Nothing that grants authority is carried over: the request's current Mythic identity and configuration must match what the session was saved under, and secrets are resolved fresh. A pending approval card still resolves only by an exact decision on that card.

A restart leaves the request Sage was answering open in Mythic, and Mythic accepts no new prompt in that channel until it ends. When Mythic sends the container's startup message, Sage settles each such request without a model call or a task: a card still waiting stays open for your decision. For a card that already shows your decision (made while Sage was down, or while it was starting), Sage cannot tell whether Mythic will still deliver it, so it adds one Continue saved decision / Stop card to the same request and applies nothing yet. If Mythic delivers your original decision, Sage applies it once and retires the Continue/Stop card; otherwise choose Continue to apply the saved decision exactly as you made it (an approval runs the action once, a rejection runs nothing), or Stop to discard it. Continue never changes the decision, and Cancel on the request also discards it. Sage first re-checks the saved decision against the card, the session's identity and configuration, and the paused action; if any of them changed, nothing runs and the request closes with the reason. The same holds when the chat's mode or tool access no longer matches the card (for example, a later /mode change), and an approved action that still did not run after the restart ends its request as an error instead of a completion. A card saved by a Sage version from before this request state was kept is closed with a notice instead. Any other request is closed with a notice. The resumed request keeps its original tool and sub-agent cards, step budget and in-request denials, and ends normally. An approved action interrupted by the restart is never resent: your next message gets the exact Mythic task it produced, or says its outcome is unknown, and the chat continues. Mythic sends the startup message only to an operation with an active bot account assigned to it; without one, use Cancel on the open request in Mythic to free the channel. A restart never restarts autonomous work, and a controller-owned autonomous approval is not resumed.

A channel still needs a fresh chat when its session ended on purpose (stop, cancel, an error, or a changed configuration or token), when its saved state cannot be read, or when a chat from before restorable sessions cannot be matched to exactly one saved conversation. Sage names the reason. Read-only /state, /report and tool discovery remain available either way.

Never delete runtime databases to obtain a clean run. Stop Sage and archive active databases first:

/bin/bash skills/sage-goad-reset/scripts/sage_stop.sh
.venv/bin/python skills/sage-goad-reset/scripts/archive_runtime_dbs.py

The archive helper moves active databases to timestamped retained files. The complete lab reset order—including Mythic, range, clock, BloodHound, Sage, payload, callback, and final readiness gates—is maintained in skills/sage-goad-reset/SKILL.md and skills/sage-callback-bootstrap/SKILL.md.

Observability

Sage embeds Arize Phoenix. On startup it launches a local Phoenix instance, instruments the LangChain stack through OpenInference, and emits its own spans from the deterministic execution kernel — with no configuration, and nothing leaving the host.

Sage has two execution paths, and they produce different traces. Knowing which one you ran is the difference between reading a trace and misreading it.

Conversation and ordinary supervised chat (LangGraph agent) Auto and supervised objective runs (deterministic kernel)
What runs the agent graph: supervisor, sub-agents, middleware the controller loop: observe, select, execute, verify
Span tree Sage → Supervisor → model / tools → tool spans sage.kernel.episode → sage.kernel.cycle → sage.kernel.seam.* → tool spans
Model calls one ChatOpenAI span per call, with token counts one per policy call, nested under seam.policy_select
Tool calls nested under the agent step that issued them nested under the kernel seam that issued them

A run with no LLM spans is not necessarily a broken trace. The kernel's policy backend runs in symbolic, hybrid, or llm mode (SAGE_POLICY_MODE), and the first two can resolve a whole run from the deterministic admissible frontier without consulting a model. When that happens the run legitimately contains zero ChatOpenAI spans. Compare against the run's own model_calls in its runtime telemetry rather than assuming loss.

Every seam.policy_select span carries the decision it produced — sage.policy.disposition, sage.policy.rationale, and sage.policy.model_response_observed — so a run that stopped because the model was unreachable says so in the trace instead of only in a failed leaf span.

Embedded Phoenix trace view
The embedded Phoenix UI: an agent-path run traced span by span, with token counts, cost, and latency.

This gives you:

  • See exactly what ran and why. Open the Phoenix UI (by default http://localhost:6006) and walk a run span by span: which agent or kernel step ran, what it sent the model, what came back, which tools fired, and where a step failed.

  • Token accounting per run and per step — how you catch a context blow-up or a runaway loop before it burns your budget. An autonomous run is a single trace rooted at sage.kernel.episode, so summing llm_token_count_* over that trace gives the whole run's cost.

  • The evidence base for evaluation. The trace store (.phoenix/phoenix.db) is what the eval harness reads to score runs, so debugging and measurement share one source of truth.

Traces persist in .phoenix/phoenix.db and are retained like the rest of the runtime state above. Read them WAL-inclusively: copying phoenix.db without its -wal sidecar silently drops everything not yet checkpointed.

To check whether a run is traced at all, rather than reading span counts by eye:

python3 skills/sage-trace-analysis/scripts/phoenix_verdict.py --latest-episode

It reports TRACED, PARTIAL, UNTRACED, or EMPTY, and exits non-zero on anything but TRACED.

Known limits. Kernel spans cover the controller's own steps; a Mythic task issue and its wait are traced as part of the execute seam rather than as separate spans. Span attribute values are capped at 128 KB (OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT), so a very large prompt or tool output is truncated in the trace, not dropped. Set SAGE_KERNEL_TRACING=0 to disable kernel spans; LangChain instrumentation is unaffected by it.

Verification

Run focused tests for the subsystem being changed, then the offline suite:

.venv/bin/python skills/sage-focused-capability-tests/scripts/run_offline_suite.py

One tier, no exclusions — a green run means the tree is green. The rejected successor-portfolio suites that were once excluded are retained evaluation evidence and now live under .sage_history/.

See Test Tiers for the details. Changes to autonomous execution also require focused controller/runtime tests and the architecture budget check:

python3 skills/sage-architecture-governor/scripts/check_arch_budget.py --changed

Live range execution is a separate verification lifecycle. A successful live solve does not replace offline tests, and an evaluation claim requires its own prospective contract and evidence gates.

Operator workflows

Reusable operational tooling lives under skills/; skills/README.md is the index. The most common workflows are:

  • sage-goad-reset: archive state, reset and verify the lab, and run comprehensive readiness checks.
  • sage-callback-bootstrap: verify native chat, create the Apollo payload, establish the retained foothold, and verify callback identity and clocks.
  • sage-live-runner: prepare, run, monitor, and inspect native Mythic chat requests.
  • sage-focused-capability-tests: narrow capability diagnostics plus explicit offline test tiers.
  • sage-trace-analysis: inspect Phoenix, Mythic output, and Engagement State Ledger exports.
  • sage-trajectory-learning: export and replay redacted transition data.

Range-specific operators, prompts, credentials, and generated evidence remain development inputs. They are not part of the shipped Sage capability.

Background findings watcher

Sage exposes two native Mythic AI models: ordinary Sage and a separate Sage Watcher. Creating a Watcher chat is inert. Lock the intended Sage Watcher channel and run /watcher apply there to claim the operation's sole Watcher owner generation. The applied profile starts one serial, incremental background watcher; ordinary Sage chat creation or use never selects or reconfigures it.

A scan is one read-only, operation-scoped poll of Mythic's callback, task, response/task-output, credential, and file streams. It never issues a payload task or contacts a target. Every poll attempt increments scans, but it does not automatically mean an LLM call: unchanged durable evidence is reconciled deterministically without model inference. When evidence changes, the watcher may make one bounded, tool-free model call; last model reasoning reports the most recent scan that did so.

The profile exposes only SAGE_WATCHER_PROVIDER, SAGE_WATCHER_MODEL, endpoint/API-key, four AWS credential counterparts, and cadence. These values use the same first-non-empty resolution and provider construction as Sage Chat—channel config, identically named optional user secret where declared, environment, then default—but never fall back to ordinary Sage's unprefixed keys. Scheduled analysis stays on the direct tool-free reasoner. Watcher conversation uses a separate one-node, stateless, tool-free, no-checkpointer graph that can only explain and cite the admitted canonical view; it has no mode, policy, BloodHound, MCP, sandbox, approval, callback, or task surface.

Background polling separately requires SAGE_WATCHER_APITOKEN for an active bot in the watched operation. Its effective scopes must exactly match the documented read/delivery set; wildcard, missing, and excess scopes fail closed. Mythic's short-lived onStart token may read the active channel profile and create or reuse #sage-findings, and may settle chat requests a restart left open (see the restart contract above), then is discarded. It never becomes scheduler, model, delivery or tasking authority.

After Sage starts:

  • Run /watcher status from either model to inspect the redacted owner, generation, route sources, cadence, and health. Only the exact active locked owner may run /watcher apply|scan|pause|resume|interval. Cadence defaults to 300 seconds, accepts 5–86,400, and pause/cadence persist with the applied profile across restart.
  • UI- and environment-backed profiles auto-resume after exact startup binding checks. A generation that used a requesting-user Mythic secret becomes visibly credentials-required after restart; run /watcher apply from the locked owner to rehydrate it. Sage never copies the secret into operation memory or channel metadata.
  • Open the normal Mythic channel #sage-findings to see bot-authored full finding updates without initiating an AI-chat turn. Mythic's event feed also receives a generic warning notification.
  • Run /findings for the same canonical view plus watcher health in either AI model. The legacy /finding spelling remains a compatibility alias. The bare word findings is an ordinary conversational prompt and has no special command behavior.
  • Optionally configure SAGE_FINDINGS_SLACK_WEBHOOK_URL. Slack receives only the fixed generic change notice; the full client-data-bearing finding remains inside Mythic. Modern Slack app incoming webhooks are bound to the channel selected at installation, so use one webhook URL per destination. A legacy custom-integration webhook may use the optional SAGE_FINDINGS_SLACK_CHANNEL_ID C/G channel ID; modern app webhooks cannot honor that override.
  • To send the exact production notice manually, use .venv/bin/python skills/sage-focused-capability-tests/scripts/probe_slack_findings_webhook.py --send. Select another modern channel's webhook without exposing the URL on the command line with --webhook-env SAGE_FINDINGS_SLACK_WEBHOOK_URL_SECURITY; use --channel-id C0123456789 only for a legacy hook.

Security and evidence rules

The complete client-data flow, persistence, erasure, and Slack-egress contract is in Security and Data Handling. In short, Mythic-derived content is client data throughout the trusted Mythic/Sage deployment. It may reach the configured model route, checkpoints, Phoenix traces, operation memory, findings, and native Mythic notifications. A configured Slack hook is a separate boundary and receives only the fixed notice Sage findings changed. Open Mythic to review. plus, for a legacy override, an operator-configured channel ID that is never derived from Mythic data.

  • Target-facing actions execute through Mythic payload tasks only.
  • Objective proof comes from Mythic task output or artifacts, Mythic credential-store state, or BloodHound facts derived from payload-collected artifacts.
  • read_credentials can place raw secrets in model context and traces; use it deliberately.
  • Never log .env contents, process environments, RabbitMQ credentials, model API keys, or raw credential material merely to prove readiness.
  • Re-discover live callback identities after every reset.
  • A configured or provisioned range is not automatically callback-ready.
  • A live evaluation attempt with a setup or measurement defect is burned, not retroactively repaired.
  • Livelock detection. A no-progress backstop halts after 3 consecutive delegations where a guarded tool was attempted but no Mythic task was issued. A neutral-delegation soft cap warns the operator after 6 consecutive non-tasking delegations. A pair-bounce detector warns when the same agent is delegated 3 times in a row without progress.

Limitations

Sage 0.4 is deliberately narrow, and its live validation lags its code:

  • Live validation. Each release is validated by the offline suite, the repository-boundary guards, the repo-hygiene checks, and scripted tests of the assembled chat path. Any live run a release receives is reported in that release's GitHub release notes, with its image, architecture, Mythic version, model route, objective and result; that result covers that one configuration and objective. Individual fixes are spot-checked live on a GOAD lab during development; those checks are not a release qualification.
  • Supervised mode. Live evidence for objective-led supervised mode comes only from GOAD with an Apollo foothold and one model route. Sage proposes and you approve each guarded action, but the quality of its proposals on another engagement is not established. The Supervisor does not yet plan bounded steps: it can hand a specialist the whole objective, so a step runs until one of its limits or an error. A catalog step runs only an action that current evidence supports; when the Supervisor selects one Sage cannot bind, the request ends blocked before any card instead of re-scoping.
  • Auto mode is experimental and has been exercised only against GOAD; each release's GitHub release notes say whether that release ran it live. That does not establish reliability or generalization on another range or a production network.
  • Other configurations. Configurations no release's notes report are not validated: other operating systems and architectures; other Mythic, Apollo, BloodHound CE, or BloodHound MCP revisions; other model providers, routes, and models; and payload types other than Apollo. Code paths that support them are not evidence that they work.
  • Findings acceptance. The assisted operation-memory acceptance case joins one completed native Apollo download task to its exact current downloaded .ps1 file record containing direct literal username/password assignments. One tool-free model call may propose credential-material; deterministic admission binds the operation, task, callback, and file identity before background delivery. It does not show that a consultant would have missed the finding, acted on it, or received independent value.
  • Known issues. See the CHANGELOG for each release's known issues. As of 0.4.0 these include SQLite locking on the bind-mounted service directory under macOS Docker Desktop and OrbStack (see SQLite on macOS Docker Desktop / OrbStack), dependency advisories in six packages (three pinned by upstream projects, three left for a later Sage upgrade), supervised closings that claim a result in plain prose with no step behind it (only Sage's own report forms are withheld), repeated collection proposals and empty delegations that end in the no-progress stop, request endings reported as "not terminal" or as errors when a task's completion function failed or a delegation was interrupted, the internal delegation envelope appearing in the transcript, a ledger that records only verifier-proven gains, and an experimental coding-agent connection whose worker settings a Sage reinstall deletes.
  • Erasure. Operation-memory erasure removes Sage-derived state for one operation but deliberately leaves authoritative Mythic records unchanged. It does not erase separate LangGraph checkpoints, Phoenix traces, LiteLLM/provider retention, native Mythic messages, or Slack workspace records; each owner must apply its own retention policy.
  • Slack. Findings delivery, when configured, contains only a generic change notice. It does not provide finding previews or operation identifiers; review the full finding inside access-controlled Mythic Chat.

Development guidance

Read AGENTS.md before making changes, then skills/README.md for the operator-tool index. Verify important claims against source, tests, and live state rather than against prose — this documentation has been stale before. To publish a version, follow Releasing Sage.

High-risk changes to prompts, agent topology, tool surfaces, capability planning, trajectory behavior, evaluation drivers, or autonomous execution require the sage-architecture-governor workflow and explicit approval before editing. Do not commit unless the repository owner explicitly asks; the normal workflow leaves review and commits to the maintainer.

관련 프로젝트 살펴보기

불러오는 중…