Nightfall is an autonomous offensive security and exploit-verification engine. It pairs tree-sitter target reconnaissance (cve-scan) with an adversarial Researcher/Critic falsification loop (adapted from google/mantis), zero-network PoC execution in Microsoft LiteBox, and automated exploit replay against staged targets.:
- Nightfall Red Team (
services/red-team) — Automated Application Security Assessment Platform. Combines source-archive/repository code intelligence with live, scope-enforced HTTP and WebSocket dynamic verification (campaign.yamlv5) routed through the L7 Egress Policy Proxy and isolated inside Microsoft LiteBox (microsoft/litebox) sandboxes to confirm real weaknesses with reproducibleEvidenceBundleproofs, discard unreachable static false positives, and re-test fixes post-deployment. - Nightfall Defense Factory (
services/defense-factory) — Continuous Vulnerability Remediation Platform. Scans real repositories and local workspaces (RepositoryScanner), deduplicates findings by root cause (RootCauseDeduplicator), routes work items to code owners within WIP velocity caps, synthesizes minimal patches verified by a mandatory Two-Stage Test Proof (Redfailing reproduction test →Greenminimal patch + full regression suite + independent Critic gate) inside Microsoft LiteBox, and commits reviewable Git branches/PRs (GitPatchPackager). - Nightfall Scorecard (
vendor/scorecard+services/scorecard) — Fused Supply-Chain & CI Workflow Posture Engine. Vendors and restylesossf/scorecard(Apache-2.0) as a persistent loopback Go daemon (nightfall-scorecard serve) with single-pass--format=nightfallJSON + structured probe evidence, promotes actionable CI/supply-chain hazards (Dangerous-Workflow,Token-Permissions,Pinned-Dependencies,Binary-Artifacts) directly into Defense Factory for Microsoft LiteBox patch verification, and re-runs Scorecard post-merge to prove live posture improvement. - Nightfall Three-Column Desktop & Web UI (
packages/ui-kit+apps/nightfall-ui) — Modular React 19 + TypeScript + Vite renderer built exclusively from@nightfall/ui-kit(webclawoklchdesign tokens,@base-ui/reactprimitives,@hugeicons/reacticons,PromptInput, interactive 3-stageSankeyDiagram,ScorecardPostureMeter, andUnifiedDiffViewer), wrapped in a hardenedhiddenInsetElectron shell (contextIsolation: true,sandbox: true,nodeIntegration: false) and backed by durablenode:sqlite(WAL) persistence with zero runtime mock fallbacks.
Nightfall/
├── apps/
│ ├── nightfall-ui/ # Modular (<320 LOC/file) Electron + Web UI consuming @nightfall/ui-kit
│ └── nightfall-cli/ # CLI for campaign.yaml signing/validation, scorecard scans & audit checks
├── packages/
│ ├── core-contracts/ # Zod/TS schemas: CampaignYamlV5, Ed25519 ScopeManifest, Finding, Fix, Scorecard
│ ├── ui-kit/ # Repo-wide webclaw Design System (@base-ui/react, @hugeicons/react, oklch tokens)
│ ├── sandbox-runtime/ # Microsoft LiteBox Library OS runtime + SHA-256 TeardownAttestation
│ ├── policy-gate/ # Risk-tier evaluator, Ask-for-Approval HITL gate & <1s Kill-Switch
│ ├── shared-memory/ # Cross-agent Shared Knowledge graph & TTL-leased Work Queue
│ ├── audit-ledger/ # Append-only SHA-256 hash-chained ledger & Safety Monitor status
│ └── model-gateway/ # Provider-agnostic model router & cost-budget circuit breaker
├── services/
│ ├── api-gateway/ # Live Node HTTP + SSE streaming BFF (:4000) + staging target (:4010)
│ ├── red-team/ # Campaign compiler, L7 HTTP+WS Egress Policy Proxy & live verifier agents
│ ├── defense-factory/ # Real RepositoryScanner, LiteBox 2-stage proof & GitPatchPackager
│ ├── scorecard/ # Fused Nightfall Scorecard Go daemon supervisor, CLI formatter & finding mapper
│ └── closed-loop-orchestrator/ # Durable node:sqlite (WAL) closed-loop state machine
├── vendor/
│ └── scorecard/ # Vendored & restyled ossf/scorecard Go engine (nightfall-scorecard)
├── benchmarks/
│ └── testbeds/ # Live local multi-tenant staging target & Microsoft LiteBox E2E suites
└── infra/
├── litebox/ # build-litebox.sh & multi-stage Dockerfile.litebox (LiteBox + Scorecard)
├── scorecard/ # build-scorecard.sh cross-platform Go build & Electron tool staging
└── deploy/ # Zero-egress Docker Compose network & persistent SQLite volume
# Build Microsoft LiteBox (litebox_runner_linux_userland, litebox_packager, litebox_syscall_rewriter)
# and the vendored Nightfall Scorecard Go engine. Required for `pnpm test` to pass.
./infra/litebox/build-litebox.sh
pnpm build:scorecard
# Install workspace dependencies
pnpm install
# Run full TypeScript check and Vitest suite across all packages, services, UI & E2E benchmarks
pnpm typecheck
pnpm test
# Evaluate supply-chain & CI workflow posture from the fused Nightfall CLI
pnpm --filter @nightfall/nightfall-cli exec tsx src/cli.ts scorecard .
# Start the live REST + SSE API Gateway (:4000) + local staging target (:4010)
pnpm dev:api
# Start the Nightfall Web UI (:5173)
pnpm dev:web
# Launch the native hiddenInset Electron shell (on macOS/Windows/Linux workstations)
pnpm dev:desktop
# Package debug/preview Electron installers (.dmg on macOS, WiX .msi on Windows)
NIGHTFALL_DEBUG_BUILD=1 NIGHTFALL_PREVIEW_IDENTITY=1 pnpm bundle:desktop:dmg
NIGHTFALL_DEBUG_BUILD=1 NIGHTFALL_PREVIEW_IDENTITY=1 pnpm bundle:desktop:msi
Nightfall sends traffic to a target only when its campaign.yaml is signed by a key you pinned in
advance. The runtime cannot create that key. The bundled staging server is the one exception: the
runtime starts it on loopback itself, so it may authorize traffic to it, and only traffic that
reaches a loopback address.
# Once per accountable person. Keep the private key off the Nightfall host.
pnpm cli keygen --key-id ops-lead --principal "Ops Lead" --out ~/.nightfall/ops-lead.pem
# Pin the printed entry in a registry file and point Nightfall at it:
# { "version": 1, "signers": [ { "keyId": "ops-lead", "principal": "Ops Lead", "publicKeyPem": "..." } ] }
export NIGHTFALL_SCOPE_SIGNERS=/etc/nightfall/scope-signers.json
# Sign each scope. The authorization expires (24h by default).
pnpm cli sign campaign.yaml --key ~/.nightfall/ops-lead.pem --key-id ops-lead --valid-for 8h
Send the resulting signedManifest as the signedManifest field of
POST /api/red-team/campaigns/:id/launch. Signers can be limited to certain target origins
(allowedTargetOrigins), given an expiry (notAfter) or revoked (revoked: true). See audit.md §12.
- AGENTS.md — Repo-wide zero-mock rules,
@nightfall/ui-kitdesign-system mandate,<320 LOCceiling, andNightfallnomenclature rules - docs/BUILD_PLAN.md — Architectural specification, Microsoft LiteBox sandbox design, safety invariants, and closed-loop state machine
- docs/WIREFRAME_CAPABILITY_MAPPING.md — 1-to-1 mapping of every wireframe screen & control to real
node:sqlite, LiteBox,EgressPolicyProxy, and Git implementations - docs/DESIGN_SYSTEM.md — Repo-wide
webclawDesign System (@nightfall/ui-kit:oklchtokens,@base-ui/react,@hugeicons/react,PromptInput, charts) - docs/DESKTOP_PACKAGING.md —
zcode-aligned Electron41.0.3architecture and GitHub Actions.msi&.dmgCI workflow (.github/workflows/desktop-debug-installers.yml)