Repository navigation
Done
Labels
Description
Problem Statement
Operators and autonomous AI agents running Ether encounter silent execution defects, contradictory security boundaries, and persistence leaks:
- Tool flags passed through CLI or MCP are silently dropped before reaching adapters and gateway policy checks, while non-zero tool exit codes are masked as completed runs and
Audit Manifestentries are silently skipped. - Scope and SSRF rules contradict each other across preflight, gateway, HTTP probes, and fuzzer baseline calibration, while legacy prompt-neutralization and static tool-list shims remain active in the codebase.
- Multi-stage
Reactive Pipelinechains treatTier B Adaptertools as empty no-ops and double-upsertFindingrecords. - CLI and MCP duplicate
Tool ArsenalandGraph Analyticswiring while harboring transport-only runtime crashes, unmasked credentials, and broken disk log lookups. Tier A Adaptermodules are silently downgraded tosubprocesswhen their manifests omitexecution_tier, and diagnostics fail to inspect coroutine tools accurately.Entity Graphpersistence leaks raw database connections across callers and tests, leaves most mutators outsideWrite Queue WorkerandForensic Sealing, truncatesFinding RAGvector search across sessions, and forces downstream callers to repeatedly deserialize JSON payloads.- Wordlist resolution is split across incompatible interfaces that ignore
$ETHER_WORDLISTS_DIRand SecLists during preflight, and the default test suite runs contended benchmarks on every PR.
Solution
Deepen Ether's core modules in two coordinated passes so callers and tests interact through a minimal set of authoritative seams:
- Pass 1 unifies command flag normalization, single-owner
LogSpoolerandAudit Manifestrecording,ExitCodefailure propagation, and realTier B Adapterexecution inReactive Pipeline; consolidates target, CIDR, metadata, loopback, and pre-connect DNS checks behindScope Validator; thins CLI and MCP to pure transport adapters over shared headless engines; alignsTier A Adaptermanifests; purges retired legacy shims; and separates fast PR gates from benchmark/scenario runs. - Pass 2 seals
Entity Graphpersistence by removing raw database handle leaks, routing all mutations throughWrite Queue Workerwith universalForensic Sealing, moving all pure reads to the read pool, hydratingpikanddatarecords, scopingvec0 Virtual Tablesearch per session, and consolidating wordlist/macro resolution behindAsset Resolver.
User Stories
- As an operator running a scan from the CLI, I want extra tool flags to reach the
Tool AdapterandAction Gateway, so that custom scan options actually execute and are policy-checked. - As an autonomous MCP agent calling
execute_tool, I want tool flags to be normalized identically to CLI invocations, so that agent-supplied flags are never silently dropped. - As an operator or agent running a tool that exits with a non-zero status, I want the action to be marked failed with its
exit_codeandNON_ZERO_EXITdiagnostic category, so that failed scans are never misreported as successful. - As a forensic auditor, I want every
Execution Sessionaction to open a singleLogSpoolerand record itsAudit Manifestentry upon completion, so that the cryptographic chain of custody is intact and verifiable. - As an operator using
--data-dir, I want session logs,Audit Manifestfiles, and log compression to respect the configured data directory across CLI and MCP, so that isolated workspaces never write to or read from the wrong directory. - As an autonomous agent reading historical action logs via MCP, I want
read_action_logto locate session-partitioned.logand.log.gzfiles on disk, so that completed or archived action telemetry remains accessible. - As an operator closing a session via CLI, I want log compression to run once and report an accurate integer count, so that closing a session does not double-compress or print raw path lists.
- As an operator running a
Reactive PipelinecontainingTier B Adaptertools, I want those stages to execute real subprocesses via the runner seam rather than empty strings, so that chained pipelines produce real findings. - As an operator or agent running a
Reactive Pipeline, I want each discoveredFindingto be persisted once byPipelineEngine, so thatobservation_count,Event Logrows, and vector indexing are not duplicated. - As a security-conscious operator running under
Gate PolicySAFE, I want loopback targets (127.0.0.1,::1) to be blocked by default unless explicitly permitted byEngagement Scope(allow_loopback=True) orGate PolicyUNRESTRICTED, so that local host services are protected from unintended SSRF. - As a red-team operator running under
Gate PolicyUNRESTRICTED, I want stored graph targets andhttp_proberequests to honorcontext.policywithout artificial blocks, so that authorized engagements are never obstructed. - As an operator running web fuzzers with
Baseline Calibration, I want calibration HTTP probes to pass throughScope Validatorpre-connect checks, so that calibration cannot bypass SSRF protections. - As a developer writing tests for scope and SSRF, I want
Scope Validatorto accept an injectable DNS resolver adapter, so that DNS rebinding and resolution checks are tested hermetically without live network calls. - As an adapter author adding a new tool manifest, I want
PreflightVerifierto derive target validation solely from manifesttarget_typeswithout static tool dictionaries, so that new tools work without modifying gateway code. - As an operator running
ether run, I want preflight errors and warnings to render cleanly and accurately, so that invalid invocations do not crash with attribute errors. - As an operator running
ether logs --crashes, I want recent fatal crash blocks to display cleanly without key errors, so that system diagnostics work when needed. - As an operator inspecting
Tool Arsenalviaether tool listorether doctor, I wantTier A Adaptercoroutine readiness to reflect actualvalidate_install()results rather than hardcoded"yes"orshutil.whichbinary checks, so that health diagnostics are accurate. - As an operator running
ether graphcommands, I want credential attributes to be masked by default unless--unmaskis supplied, so that sensitive secrets are not leaked in terminal output. - As a maintainer of CLI and MCP surfaces, I want
Tool Arsenalsummaries, target inference,Graph Analyticsenvelopes, and session listing to live in headless engine modules, so that CLI and MCP share one behavior contract. - As an operator running
audit_drift, I want baseline inputs to accept both file paths and JSON strings and check strict HTTP security headers, so that MCP and CLI drift audits behave consistently. - As a contributor reading the codebase, I want retired legacy modules (
PromptNeutralizer, staticpreflighttool lists, legacy flat log path helpers) removed outright, so that dead shims do not cause confusion. - As a developer running PR verification, I want the fast gate (
tier0andfast) to complete in under 5 seconds without benchmark contention, while benchmarks and live scenarios run in an isolated job. - As a maintainer of
Entity Graphstorage (Pass 2), I wantGraphStoreto seal its raw database connection so no external caller or test can bypass the module interface. - As an operator running 50+ concurrent subagents (Pass 2), I want all graph and timeline mutations to serialize through
Write Queue WorkerinsideBEGIN IMMEDIATEtransactions, so that concurrent writes never hit SQLite lock contention. - As a forensic auditor (Pass 2), I want every graph, belief, decay, note, and timeline mutator to enforce
Forensic SealingonCLOSEDsessions, so that sealed sessions are strictly immutable. - As an operator querying the
Entity Graph(Pass 2), I want pure read operations to execute on the read connection pool without blocking behind active write batches. - As a consumer of
GraphStorequeries (Pass 2), I want returned node records to include hydratedpikanddatadictionaries, so that callers do not repeatedly deserialize JSON strings. - As an autonomous agent running
Finding RAGin a multi-session database (Pass 2), I wantvec0 Virtual TableKNN queries scoped bysession_id, so that findings from other sessions never crowd out relevant results. - As an operator or adapter using wordlists (Pass 2), I want
Asset Resolverto resolve macros,$ETHER_WORDLISTS_DIR, SecLists, andminimal.txtuniformly across preflight and runtime without shipping bloated.txt.gzdictionaries.
Implementation Decisions
Pass 1: Execution, Scope, Transport & Tier Alignment (Tier 2/3 + Additive Tier-1 Helpers)
- Canonical Execution & Flag Seam: Normalize
flagsandraw_flagsonce at theActionRequest/Action Gatewayseam into canonicalraw_flags: strbefore policy validation, variable interpolation, andTool Adapterdispatch. ReuseActionGateway.infer_target_findingacross CLI andPipelineEngine. - Single-Owner Spooling & Exit Codes: Collapse
SubprocessCommandRunnerintoExecutorimplementingCommandRunner. Addexit_code: Optional[int]toJobStatus, transition non-zero exits toJobStatusEnum.FAILED(emittingExecutionFailedand MCPNON_ZERO_EXIT) unless an adapter marks an exit code non-fatal, and assignExecution SessionsoleLogSpoolerownership withdata_dirpropagated throughExecution Session,GraphStore.close_session,ForensicLogManager.find_action_log, andcreate_mcp_server. Reactive PipelineExecution & Persistence: Inject aCommandRunner/Execution Sessionseam intoPipelineEnginesoTier B Adapterstages execute real commands, and makePipelineEnginethe sole owner ofstore.upsert_findingwhensession_idis present (removing duplicate upserts from CLI and MCP callers).- Authoritative
Scope ValidatorSeam: Consolidate target, CIDR, metadata, loopback, and pre-connect async DNS checks intoScope Validatorwith an injectable DNS resolver port. UnderGate PolicySAFE, block loopback by default unlessEngagement Scopesetsallow_loopback=True(ADR 0012). Enforcecontext.policyandScope Validatoruniformly acrossAction Gateway,http_probe,tls_probe, and fuzzerBaseline Calibration. - Manifest-Driven Preflight & Tier Alignment: Populate explicit
target_typesandexecution_tier = "coroutine"on all applicable tool manifests, enforce manifest-adapter consistency intier0checks, and deletePromptNeutralizer, staticpreflighttool sets, and legacy flat action-log path helpers. - Thin CLI & MCP Transport Adapters: Push
Tool Arsenalsummaries, session-scopedGraph Analytics(withchoke_points),list_all_sessions, and--unmaskcredential masking into engine modules; fix CLI crashes inrun,logs,tool, andsession close; makeDriftEngineaccept JSON-string baselines and strict HTTP header checks.
Pass 2: Sealed Entity Graph Persistence & Asset Resolver (Tier-1 + Docs)
- Sealed
GraphStoreInterface: Replace externalstore.connection()callers (sessionlist,GraphAnalyticsEngine.evaluate_and_persist,ActionTimelineRepository) with first-classGraphStoremethods and removeconnection()from the public interface. Delete unreachable dead code and duplicateanchor_hashderivation. - Universal Write Serialization &
Forensic Sealing: Route allGraphStoreandActionTimelineRepositorymutations throughWrite Queue Worker(BEGIN IMMEDIATEbatches) with a centralizedCLOSED-session guard raisingPermissionError, and route all pure reads to_get_read_conn(). - Hydrated Records & Scoped
Vector Index Engine: Return hydratedpikanddatadictionaries fromGraphStorenode queries, unify batch embedding sync inVector Index Engine, and partition/scopevec_findingsKNN queries bysession_id(ADR 0012). - Consolidated
Asset Resolver: Merge macro expansion and wordlist lookup intoAsset Resolverwith injectable search roots, wirePreflightVerifierandAction Gatewayto it, and remove legacywordlistsshim and.txt.gzbundles per ADR 0011 Part 5. - Documentation Sync: Keep
GLOSSARY.md, ADR 0012, and architecture/database/CLI/MCP guides synchronized with the final contracts.
Testing Decisions
- Testing Philosophy: Test exclusively through public module interfaces and observable outcomes; never inspect private attributes (
_get_conn(),_tool_manager,_buf,_session,_get_tool_target_types) or re-implement internal logic in tests. Delete placebo or retired-code tests (test_prompt_neutralizer) rather than layering over them. - Primary Test Seams:
- CLI & MCP Transport Seam: Exercise
clientrypoint andcreate_mcp_servertools end-to-end against real:memory:GraphStoreand temporary data directories (coveringrun,logs,session close,tool list/info,graph--unmask,read_action_logon.log/.log.gz, andaudit_driftwith JSON strings). - Action Gateway & Execution Session Seam: Exercise
ActionGateway+Execution Session+PipelineEngineusing an in-memoryCommandRunneradapter and an injectable DNS resolver adapter onScope Validator(coveringflagsnormalization, non-zero exit failure,Audit Manifestverification,Gate PolicySAFEloopback default vsEngagement Scope(allow_loopback=True), and DNS rebinding/calibration SSRF). - GraphStore & Asset Resolver Seam: Exercise
GraphStore(with:memory:SQLite),Vector Index Enginemulti-session search isolation, universalForensic Sealingacross all mutators, andAsset Resolverwith injectable temp directories.
- CLI & MCP Transport Seam: Exercise
- Prior Art & Gate Separation: Follow existing Hypothesis state-machine tests, universal adapter fuzzing, and MCP/CLI integration tests. Separate
tier0 or fast(<5s PR gate) frombenchmarkandscenariosuites so benchmarks never fail due to parallel suite contention.
Out of Scope
- Any UI, Textual, or presentation widget code (preserving Ether's strict headless invariant).
- Cloud vector databases or remote embedding APIs (preserving the 100% offline invariant).
- Changing
Primary Identity Key (PIK)SHA-256 identity derivation or schemaschema_typenaming contracts.
Further Notes
- Domain terms (Engagement Scope, Reactive Pipeline, Asset Resolver) are recorded in
GLOSSARY.md. - Hard-to-reverse contract changes (
Gate PolicySAFEloopback default,NON_ZERO_EXITsemantics, Pass 2 sealedGraphStoreand session-partitionedvec_findings) are recorded in ADR 0012.
Activity
h45sh commentedon Nov 25, 2026
Completed in full across Pass 1 & Pass 2 and landed on
dev(commitsc1f5de4throughd3036d6):Pass 1: Unified Execution, Scope & Transports
flags/raw_flags) atActionRequest/ActionGatewayseam, implemented non-zero exit code failure semantics (JobStatus.exit_code,ExecutionErrorCategory.NON_ZERO_EXIT), and single-ownerLogSpoolerwithAudit Manifestrecording.ScopeValidator(GatePolicy.SAFEdefault-deny loopback unlessEngagementScope(allow_loopback=True)). AlignedPreflightVerifierand tool manifests (execution_tier = "coroutine").Reactive Pipeline, and hardenedDriftEngine.Pass 2: Sealed GraphStore Persistence & AssetResolver
connection()leaks from the public API, routed all mutators throughWriteQueueWorkerwith universalCLOSED-session forensic sealing (PermissionError), and routed pure reads to_get_read_conn().pikanddataJSON dicts on node lookups, and partitionedvec_findingsKNN search persession_id.ether.registry.assetsand removed legacy wordlist bundles.GLOSSARY.mdand ADR 0012 (0012-sealed-graph-persistence-unified-scope-and-execution-seams.md).All 472 unit and integration tests passing with 76.61% branch coverage and 100% green CI across all matrix environments.