Skip to content

Research: untrusted repository preflight before agent execution (Lazarus incident fixtures; external adapter only) #156

Open

Description

@PhysShell

Classification / scope

Research / security preflight / P2 — feasibility only, NOT a request to embed a second security scanner in 007.

Question: before o7 run lets a coding agent interact with a new/untrusted repository, can a lightweight, static-only intake step identify repository-controlled execution surfaces and stop the run from silently crossing the trust boundary?

Why here: 007's README documents a disposable git worktree and autonomous agent execution with a deny-list; a worktree isolates changes to tracked files, not credentials, network egress, host processes or malicious tool instructions. Generic VM/sandbox discussions alone do not inventory what the repo is asking the agent/toolchain to execute.

Scope separation:

  • #74: universal change admission / proof-carrying change, broader architecture.
  • #53: external sidecar + sandbox process boundary.
  • #44: 007 should invoke evidence adapters, not own supply-chain detection logic.
  • ScenarioBox (concept only; no verified project repository) is a possible future caller of the same independent intake adapter for one-click manual test environments; this issue does not authorize building ScenarioBox or stretching 007 into a VM product.

Real-world motivation and evidence

  • tayvano/lazarus-bluenoroff-research aggregates incident reports and examples of malicious developer projects; specifically VS Code task cases and fake job coding tests.
  • VS Code Workspace Trust disables automatic task execution in Restricted Mode, but this is an IDE boundary, not a protection offered by Git worktrees or by generic CLI agents.
  • The tayvano repository also contains live malicious sample archives. Do not clone/sample-execute them for this experiment, fetch them via a tool-enabled agent, or put them in the 007 repo/CI. Use public textual incident descriptions to derive harmless inert fixtures only; attribution to DPRK is not assumed for every report.

Candidate preflight threat model

A repo can be readable but dangerous to build, install, run, trust in an IDE or grant to an agent. Candidate execution surfaces to inventory (not exhaustive):

  • .vscode/tasks.json auto-run (runOn: folderOpen), debug/launch configurations and IDE extension recommendations.
  • package.json lifecycle scripts (preinstall/install/postinstall, etc.) and transitive package scripts; npm ci is not a read-only operation.
  • Python build backends/legacy setup.py, Makefile/npm scripts; dotnet MSBuild custom tasks/targets; CI/actions/workflows and custom runner hooks.
  • Shell command chains, network downloads piped to interpreters, secrets/SSH/cloud-credentials access, filesystem writes, persistence and process spawning.
  • Repo-owned AGENTS.md/agent settings/prompts or MCP/tool manifests that might trick an autonomous agent into treating untrusted instructions as authority.
  • Opaque/transitive execution and unsupported languages must produce UNKNOWN, not a claim that the repo is safe.

Critical distinction: this is a static, opt-in risk inventory. A warning is not evidence that a project is malicious; lack of a warning is not proof of harmlessness. No automatic execution during inspection.

Gate 0: overlap and baseline before implementation

  1. Inspect the exact current 007 run setup, existing permission/sandbox boundaries and extension/gate APIs; distinguish stated design from enforced restrictions.
  2. Compare at least DataDog/guarddog, safedep/vet, and existing repository-intake scanners (e.g. preflight) on their actual supported inputs. Package scanners are not automatically complete repository/IDE/agent scanners.
  3. Choose whether the right home is an external read-only adapter called before agent launch, an OwnAudit profile, or a ScenarioBox security hook. Do not introduce a new scanner library into 007 if an existing check suffices.
  4. Predeclare STOP/GO thresholds and legal access constraints. No network scanning or reputation claims beyond permitted public evidence.

Minimal reproducible spike (safe fixtures only)

  • Prepare 6–10 inert, hand-audited fixtures covering: malicious-looking autostart (inert command), legitimate task, package install hook, nested/transitive configuration, agent-instruction injection as data, network/effect chaining, missing/unsupported config.
  • Source linkage: case type → public textual incident report → synthetic fixture → expected execution path → scan report.
  • Detect entry point → trigger → command/tool → potential effect (host filesystem/network/credential read), including whether executing it requires explicit user trust/approval.
  • Use Risk / Needs review / Not observed / Unknown with evidence anchors and completeness limits. Never emit SAFE for missing coverage.
  • Compare the adapter with baseline(s) for unique true detections, false positives, missing coverage, scan time and analyst effort; preserve negatives and unverifiable cases.
  • If justified, integrate via an explicit pre-run optional gate with STOP/DEFER when inspection cannot complete, independent of agent output. Do not make it mandatory until compatibility and fail-closed semantics are proven. Agent must not override preflight verdict.

Decision / deliverables

  • Current 007 execution-trust boundary diagram backed by code + exact SHA.
  • Comparison / dedup matrix with existing scanners, OwnAudit/007 tasks and VS Code Workspace Trust.
  • Harmless fixtures + independently reviewed expectations + false-positive/UNKNOWN cases; no raw malware samples.
  • Example portable, tool-independent execution-risk graph and machine-readable report, annotated with uncertainty.
  • Decision REUSE-EXTERNAL / ADAPT-ADAPTER / STOP-NO-GAP, bounded cost, owner repo for a follow-up (if any).
  • No full scanner, mandatory gate, shell execution, container download, VM automation, access to secret-bearing environments, PR or deployment as part of this issue.

Hard guardrail: a fork/worktree, running inside WSL2, or asking an LLM whether a repository is safe are not sufficient security boundaries.

Activity

  1. PhysShell commented on Nov 20, 2026

    @PhysShell
    OwnerAuthor

    Raven donor: malicious Windows installer and compatibility-layer attack surface (20.11.2026)

    Research page · Raven README.

    Raven runs Windows installers and emulates NT/Win32 services under a constrained Linux prefix. This offers a distinct negative-fixture family for untrusted repository / installer preflight, but Raven's project age (created October 2026) and README claims are not independent security evidence.

    Bounded extension of existing #156 only if Windows payloads are in scope: static inspection and isolated execution of a synthetic EXE/MSI that attempts host path traversal, registry persistence, command-line host path abuse, privilege/elevation claims, symlink swap, network egress and child-process escape. Use a disposable VM; monitor host syscalls/files outside guest, compare with known policy and independent hash oracle. Do not use live malware or expose genuine credentials.

    Separate RAVEN-01 / WPF-COMPATIBILITY / DEFERRED: compare a frozen .NET Framework 4.7.2 + DevExpress v12.2 smoke app on Raven, Wine and Windows VM. Upstream claims .NET Framework 4.8/WPF but does not demonstrate this enterprise stack; do not infer production readiness from launching Notepad++ or .NET demos. If no Windows-guest scenario is relevant to #156, leave this research archived on the page instead of expanding preflight scope. No new tooling requirement or production dependency.

  2. PhysShell commented on Nov 21, 2026

    @PhysShell
    OwnerAuthor

    Research addendum (21.11.2026): Atomdrift Scan as another candidate preflight signal

    Full source-backed page · atomdrift-project/scan · cleave · azoth

    Placement: this is supporting prior art for the existing comparison in #156, not an authorization to integrate a scanner into 007 or start a new preflight framework. The question remains whether an external, read-only analyzer adds meaningful evidence about repo-controlled execution surfaces before the agent executes anything.

    Verified characteristics

    • Scan extracts archive/source/binary features using stng/cleave, grades with azoth LightGBM/ONNX and reports benign / suspicious / hostile. It claims support for npm, Go modules, NuGet, GitHub Actions, VSIX, scripts, PE and many other formats.
    • Integration contract has distinct CLI exit codes: 0 clean / 1 hostile / 2 suspicious / 3 error / 4 incomplete ruleset / 130 interrupted. 4 is not a negative security finding: rules may have failed to load.
    • JSON contract distinguishes allow / block / unanalyzed / unavailable and exposes hash, engine version, findings and decision source. A known-hash allow can bypass deep analysis; preserve origin and coverage.
    • Optional --follow can fetch dependencies and code references. Updates and release checks can also use the network. For hermetic inspection require pinned binary/rules, --no-update, --follow=none, SCAN_NO_UPDATE_CHECK=1, SCAN_NO_UPLOAD=1, and an independent network-deny boundary. Do not pass private repo or credentials to remote LLMs/Uplink.
    • Evaluation caveat: this is not independently benchmarked for our workloads. The authors' azoth test summary reports Go recall@L25 70.56%, C# 39.95% on its own held-out files; split is content-deduplicated, not malware-family-held-out. Malicious capability is not equivalent to execution reachability or intent.

    Fit to #156 / kill-first

    • Compare inert fixtures for postinstall/MSBuild/Makefile/CI actions/VSIX and nested references against the current manual execution-surface inventory plus GuardDog/SafeDep/preflight, on identical pinned inputs. Measure unique true actionable detections, misses/UNKNOWN, FP and analyst effort. Do not execute malicious samples, repo lifecycle hooks or any unknown installer.
    • A Scan benign never upgrades an unknown/uninspected execution path to SAFE. Differentiate potential capability from reachable trigger → command → effect.
    • STOP-NO-GAP if no independently confirmed incremental capability; ADAPT only the portable evidence, version-diff and incomplete/unknown status semantics if helpful. Actual optional external adapter requires a separate GO and remains owned by existing supply-evidence work.

    Cross-reference: OwnAudit #45 owns evidence adapters; STS #30 is a different runtime threat-detection topic. 007 remains PARKED; no execution, dependency install, CI gate, production edit or PR is authorized by this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions