π‘οΈ ZeroWall β AI-Guided Adaptive Self-Hardening on NVIDIA DGX Spark
Why I Built ZeroWall
ZeroWall started with a simple question: what if defenders could adapt software faster than attackers could exploit it?
Most security response is reactive: detect an issue, patch it, redeploy, and verify that nothing broke. The longer-term vision for ZeroWall is a continuous adaptive-defense model (currently initiated by an operator or mock-alert trigger for demonstration and testing purposes): generate constrained defensive variants, test them, replay known exploits, and publish only a candidate that passes live verification.
Inspired by moving target defense, I used locally trained models and NVIDIA DGX Spark to explore whether learned policies could rank vetted security transformations from observed outcomes. The models do not generate arbitrary patches or replace security rules; they select among registered safeguards while tests, acceptance gates, and rollback remain in control.
π Table of Contents
- Why I Built ZeroWall
- Overview
- Problem Statement
- Architecture
- NVIDIA Stack Usage
- NVIDIA Requirement Mapping
- Demo Instructions
- Benchmarking
- Screenshot Checklist
- Disclaimer
- License
Overview
ZeroWall is an MTD-inspired, multi-agent adaptive-hardening proof of concept designed for NVIDIA DGX Spark. It can also run in CPU development mode through deterministic, NumPy, and pandas fallbacks. Models select from registered transformations; they never write arbitrary source code.
When an operator or mock alert supplies attack context, ZeroWall:
- Generates a configurable set of benign-contract-preserving mutation candidates (10 by default)
- Runs tests to reject candidates that break the target contract
- Replays known exploits against passing candidates in parallel
- Scores risk through Triton when available, with a local weighted-formula fallback
- Deploys the winning variant and rolls back if post-deploy checks fail
Candidates are published only after verification and scoring. The live gate confirms that the managed worker loaded the exact artifact, preserves representative normal traffic, and blocks the predefined replay set before accepting the deployment.
Problem Statement
Static defenses fail against adaptive attackers and manual patch cycles are slow. ZeroWall demonstrates a constrained response loop: receive an alert, propose registered variants, test, replay, score, publish, verify live, and automatically restore the previous artifact on failure.
Architecture
ββββββββββββββββββββββββ attack context ββββββββββββββββββββββββββ
β Operator / Mock IDS β ββββββββββββββββββββββββββΊ β ZeroWall Core API / CLIβ
β /defend /simulate... β βββββββββββββ¬βββββββββββββ
ββββββββββββββββββββββββ β
βΌ
βββββββββββββββββββββββ NVIDIA DGX Spark or local development host βββββββββββββββββββββββ
β β
β βββββββββββββββββββββββββββ ZeroWall Core Engine ββββββββββββββββββββββββββββββββββββ β
β β β β
β β βββββββββββββββββββββββββ Defense Loop Orchestrator βββββββββββββββββββββββββββ β β
β β β 1. Baseline replay 4. Verifier Agent: pytest + optional Bandit β β β
β β β 2. Mutation Agent 5. Exploit Agent: isolated HTTP replay β β β
β β β 3. Transform Engine 6. Risk Agent β deploy or reject β β β
β β β Explanation Agent β cycle summary β β β
β β ββββββββββββββββ¬βββββββββββββββββββββββ¬βββββββββββββββββββββββ¬ββββββββββββββββ β β
β β β β β β β
β β βΌ βΌ βΌ β β
β β ββββββββββββββββββββββββββ ββββββββββββββββββββββ ββββββββββββββββββββββββ β β
β β β Planner cascade β β Candidate workers β β Deployment Controllerβ β β
β β β β’ NeMo adapter* β β β’ temporary dirs β β β’ immutable versions β β β
β β β β’ learned NumPy policy β β β’ local processes β β β’ atomic active slot β β β
β β β β’ Triton policy* β β β’ predefined replayβ β β’ verified rollback β β β
β β β β’ deterministic fallbackβ ββββββββββββββββββββββ ββββββββββββ¬ββββββββββββ β β
β β ββββββββββββββββββββββββββ β β β
β β βΌ β β
β β βββββββββββββββββββββ βββββββββββββββββββββ ββββββββββββββββββββββββββ β β
β β β Triton Server* β β vLLM Server* β β Versioned deploy volumeβ β β
β β β planner + risk β β explain + NeMo β βββββββββββββ¬βββββββββββββ β β
β β βββββββββββββββββββββ βββββββββββββββββββββ β β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββ β
β βΌ β
β ββββββββββββββββββββββββ predefined HTTP βββββββββββββββββββββββββββββββββββββββ β
β β Seed script / replay β βββββββββββββββββββΊ β Managed FastAPI target β β
β ββββββββββββββββββββββββ β vulnerable baseline β accepted buildβ β
β βββββββββββββββββββββββββββββββββββββββ β
β β
β JSONL telemetry βββΊ cuDF* or pandas analytics βββΊ Streamlit + Next.js dashboards β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
* Optional accelerated component; the defense loop has a local fallback.
What happens during a defense cycle
ββββββββββββββββββββββββββββ
β Operator or mock IDS β
β /defend /simulate-alert β
ββββββββββββββ¬ββββββββββββββ
β attack context
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ZeroWall Defense Loop β
β β
β 1. Replay baseline exploits against the managed FastAPI target β
β 2. Rank transforms: NeMo adapter* β NumPy β Triton* β fallback β
β 3. Build registered CST/validator variants (10 by default) β
β 4. Run pytest and optional Bandit checks in parallel β
β 5. Boot passing variants in temporary local subprocesses β
β 6. Replay predefined HTTP payloads and calculate risk β
ββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββ΄βββββββββββββββ
β β
no safe winner safe winner
β β
βΌ βΌ
ββββββββββββββββββββ ββββββββββββββββββββββββββββ
β Reject candidatesβ β Versioned atomic publish β
β Target unchanged β ββββββββββββββ¬ββββββββββββββ
ββββββββββββββββββββ β managed reload
βΌ
ββββββββββββββββββββββββββββ
β Live acceptance gate β
β β’ exact source hash β
β β’ normal-request smoke β
β β’ exploit replay β
ββββββββββββββ¬ββββββββββββββ
β
βββββββββββββ΄ββββββββββββ
β β
pass fail
β β
βΌ βΌ
ββββββββββββββββββ βββββββββββββββββββ
β Confirm deploy β β Atomic rollback β
βββββββββ¬βββββββββ ββββββββββ¬βββββββββ
ββββββββββββββ¬ββββββββββββ
βΌ
JSONL telemetry β cuDF*/pandas
β dashboards
* Optional accelerated component; a local fallback is available.
NVIDIA Stack Usage
1. π₯οΈ Triton Inference Server
What it provides: Two small, dynamically batched policy endpoints:
mutation-plannerβ a planner-cascade fallback for ranking transform typesrisk-scorerβ candidate confidence scoring when Triton is healthy
The planner cascade tries an optional NeMo adapter, the checked-in NumPy policy, Triton, and finally a deterministic fallback. Risk scoring also falls back to a local formula, so CPU development runs do not require Triton.
Evidence in code:
inference/triton-model-repo/mutation-planner/config.pbtxt+1/model.pyinference/triton-model-repo/risk-scorer/config.pbtxt+1/model.pyinference/clients/triton_client.pyβ Triton HTTP v2 client- Planner- and risk-stage latencies are recorded in telemetry and displayed on the dashboards
Docker service: docker-compose.yml β service triton
2. β‘ vLLM (Local LLM Runtime β TRT-LLM upgrade path)
What it provides: Optional local GPU LLM inference for:
- NeMo/LoRA transform ranking when a trained adapter is present
- Explanation Agent judge-facing summaries, with a template fallback
Why vLLM: The included service exposes an OpenAI-compatible API and runs the configured local model. The clients are isolated behind a thin interface; another runtime, including a suitably configured TRT-LLM OpenAI-compatible server, can replace it. The repository does not include a trained NeMo adapter, so the default cascade skips that tier.
Evidence in code:
inference/clients/vllm_client.pycore/agents/explanation_agent.pyβ calls vLLM for generation- LLM availability is reported by the CLI and operator dashboard
Docker service: docker-compose.yml β service vllm
3. π RAPIDS cuDF
What it provides when installed: GPU-accelerated telemetry analytics:
- Exploit success rate before vs after defense cycles
- Defense cycle latency statistics (mean, p95)
- Candidate evaluation counts
- Rolling exploit rate trends for dashboard
- Inference latency breakdown per agent
Evidence in code:
core/telemetry/rapids_analytics.pyβ cuDF path with pandas fallback- Uses
cudf.DataFramewhen cuDF is installed andRAPIDS_ENABLED=true - Backend shown in dashboard ("cuDF-GPU" vs "pandas-CPU")
- Analytics output feeds real-time Streamlit charts
The portable requirements.core.txt and core Docker image install pandas, not
cuDF. Use a RAPIDS-compatible DGX environment to activate the GPU path; otherwise
the same analytics run through pandas.
NVIDIA Requirement Mapping
Why DGX Spark is the accelerated demo path
| Reason | Detail |
|---|---|
| Triton model serving | Reproducible model lifecycle and dynamic batching; the current tiny NumPy policies run on CPU |
| vLLM LLM inference | The included vLLM container is configured for NVIDIA GPU execution |
| RAPIDS cuDF | Uses CUDA for analytics when installed, with a pandas fallback |
| Local LLM reasoning | vLLM runs the optional explanation/planner LLM locally on the DGX GPU |
| Parallel evaluation | Candidate tests and isolated HTTP replay benefit from DGX capacity but also run in CPU development mode |
NVIDIA Components Integrated
| Component | Role | Evidence |
|---|---|---|
| Triton Inference Server | Multi-model serving | inference/triton-model-repo/ |
| vLLM | Local LLM inference (TRT-LLM path) | inference/clients/vllm_client.py |
| RAPIDS cuDF | Optional GPU DataFrame analytics | core/telemetry/rapids_analytics.py |
Why this is an Advanced AI System
- Multi-agent pipeline: 5 specialized agents (Mutation, Exploit, Verifier, Risk, Explanation)
- Not a chatbot: No human in the loop during defense cycle
- Autonomous decision-making: Risk Agent recommends deploy/reject; the orchestrator rolls back a published candidate when its live gate fails
- Constrained code changes: Models rank registered deterministic CST transforms and validator guards
- Variant generation: Candidate layouts vary by transform and seed, although the selected winner may repeat
Demo Instructions
Prerequisites
# Copy configuration; edit only the services you intend to enable.
cp .env.example .env
# Optional examples: VLLM_MODEL, VLLM_TP_SIZE, and HF_TOKEN for gated models.
# For standalone Python development:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.core.txt
pip install -r apps/target-fastapi/requirements.txt
Full Docker Demo (DGX Spark)
# Start all services
docker compose up -d --build
# Watch service health; model startup time depends on the selected vLLM model.
docker compose ps
# Run the demo flow
bash scripts/run_demo.sh
# Visit the Streamlit dashboard at http://localhost:8501
# or the Next.js operator dashboard at http://localhost:3000
Step-by-Step Manual Demo
# 1. Start the managed target (standalone, no Docker)
# This serves artifacts/deploy/active/main.py and reloads atomic deployments.
bash scripts/run_target.sh &
# 2. Verify normal request
curl http://localhost:8000/health
# 3. Seed exploit attack
bash scripts/seed_attack.sh
# 4. Open OpenClaw CLI (interactive)
python -m core.orchestrator.openclaw_cli interactive
# Then type either /simulate-alert (which triggers defense) or /defend
# Then type: /status
# 5. Open dashboard
streamlit run dashboard/streamlit_app.py
Verification
# Includes target contracts, every transform, real live hot-swap, telemetry,
# and an injected post-deploy failure that must roll back.
pytest -q
OpenClaw Commands Reference
| Command | Description |
|---|---|
/defend |
Start defense cycle |
/replay |
Replay exploit against active version |
/status |
Show system status |
/benchmark |
Run burst benchmark |
/simulate-alert |
Inject mock IDS alert |
Benchmarking
Run the benchmark against the active local target:
bash scripts/run_benchmark.sh
# Or: python -m core.orchestrator.openclaw_cli benchmark --burst-size 50 --with-defense
Output files:
artifacts/benchmark/benchmark_summary.jsonartifacts/benchmark/benchmark_summary.csv- Rich terminal table printed automatically
The report includes request throughput, average and p95 latency, exploit success before and after defense, total defense-cycle time, retained candidate count, planner/risk-stage latency, and the active analytics backend. Candidate count can be lower than the configured value when duplicate or invalid variants are removed. Results depend on hardware, model, concurrency, and warm-up state; this repository does not claim canonical DGX Spark performance numbers.
Screenshot Checklist
For live demo evidence, capture and place in artifacts/:
- [ ]
artifacts/gpu_screenshot.pngβ DGX dashboard GPU utilization during benchmark - [ ]
artifacts/dashboard_screenshot.pngβ Streamlit dashboard with real data - [ ]
artifacts/benchmark_terminal.pngβ Rich terminal benchmark table - [ ]
artifacts/openclaw_defend.pngβ OpenClaw CLI defense cycle output - [ ]
artifacts/exploit_before.pngβ Exploit success before defense cycle - [ ]
artifacts/exploit_after.pngβ Exploit blocked after deployment
Project Structure
/ZeroWall
βββ apps/target-fastapi/ # Vulnerable demo FastAPI app
β βββ main.py # 3 simulated vulnerable endpoints
β βββ managed_runner.py # Serves/reloads the managed deployment slot
β βββ test_app.py # Target contract tests used by the verifier
β βββ requirements.txt
β βββ Dockerfile
βββ core/
β βββ agents/ # 5 ZeroWall agents
β β βββ mutation_agent.py # Generates candidate plans (10 by default)
β β βββ exploit_agent.py # Replays known attack payloads
β β βββ verifier_agent.py # Runs pytest + bandit
β β βββ risk_agent.py # Scores + recommends action
β β βββ explanation_agent.py # Judge-facing summaries
β βββ transforms/ # Deterministic CST transforms and guards
β β βββ base.py # Transform registry
β β βββ rename_identifiers.py
β β βββ reorder_blocks.py
β β βββ split_helpers.py
β β βββ swap_validators.py # PRIMARY security hardening transform
β β βββ route_rotation.py
β βββ orchestrator/
β β βββ defense_loop.py # Main multi-agent coordinator
β β βββ openclaw_cli.py # OpenClaw command interface
β βββ deploy/
β β βββ controller.py # Versioned atomic deploy + rollback
β βββ telemetry/
β β βββ collector.py # Event collection β JSONL
β β βββ rapids_analytics.py # cuDF GPU analytics
β βββ benchmark/
β βββ burst_sim.py # Burst attack benchmark suite
βββ inference/
β βββ triton-model-repo/ # Triton model repository
β β βββ mutation-planner/ # Transform type selector model
β β βββ risk-scorer/ # Candidate risk scoring model
β βββ clients/
β βββ triton_client.py # Triton HTTP v2 client
β βββ vllm_client.py # vLLM completion client
β βββ nemo_planner_client.py # Optional adapter planner client
βββ dashboard/
β βββ streamlit_app.py # Judge-facing metrics dashboard
βββ frontend/ # Next.js operator dashboard
βββ scripts/
β βββ run_demo.sh # End-to-end demo flow
β βββ run_benchmark.sh # Benchmark runner
β βββ seed_attack.sh # Seed known exploit payloads
βββ tests/ # Transform and live deployment integration tests
βββ docker-compose.yml # Target, inference, core, and two dashboards
βββ Dockerfile.core # ZeroWall core engine container
βββ requirements.core.txt
βββ .env.example
Safety Disclaimer
See SECURITY.md for safe-testing boundaries and private vulnerability reporting.
β οΈ HACKATHON SAFETY NOTICE
ZeroWall is built for safe, controlled demonstration purposes only.
- The "vulnerable" endpoints do NOT expose real system resources, execute real commands, or perform any harmful operations
- Simulated file, command, and query behavior uses in-memory fixtures rather than host resources
- Bundled exploit commands default to the local demo target and perform no network scanning
- No real offensive tooling is included in this project
- The deploy controller only writes the local, versioned demo deployment slot
- All "exploits" are pre-defined, non-harmful HTTP requests that trigger simulated response patterns
The CLI accepts a configurable target URL; do not point it at systems you do not own and control. This project demonstrates an MTD-inspired adaptive-hardening pipeline and is not a general-purpose detector or autonomous patcher. See SECURITY.md for the full boundary.
License
ZeroWall is licensed under the Apache License 2.0.
Log in or sign up for Devpost to join the conversation.