A self-improving security agent built with Haystack that runs entirely on one NVIDIA DGX Spark. A self-improvement loop rewrites the agent's prompt or writes new analysis tools for it, and keeps a change only if it passes fixed checks. The bounds:
- The agent's sandbox: the agent is deployed in an OpenShell sandbox, created through NemoClaw.
- The tools' sandbox: Python the agent runs itself goes through Monty.
- Evaluation rules: every change must pass fixed gates on training pairs. Held-out validation pairs decide which improved agent we report.
- Local models only: NVIDIA Nemotron 3.5 Super VL and Qwen3.8 Flash-Next, served with vLLM or llama.cpp in our
runs.
serving/also sets up NVIDIA NIM, for Nemotron 3.5 Lightning.
There are two benchmarks:
- PrimeVul, paired: each pair is a vulnerable C/C++ function and its patched version.
- Synthetic custom components: 50 pairs of small Haystack component repositories. One repository of each pair has a planted vulnerability and the other is its fixed twin. The agent scans each one as a whole repository.
Status: work in progress. The code, agents and serving recipes to rerun them are being moved in from internal repositories.
- NVIDIA GTC session: Evolve Within Bounds: Secure, Self-Improving Agents for On-Prem AI.
- Blog post: Self-Improving AI Systems: A Log-Analysis Agent on NVIDIA DGX Spark, on the Haystack blog. The same approach applied to another use case: a Haystack agent analyzes recorded traces of a citizen-services AI assistant and improves it, with local models on a DGX Spark.
- An NVIDIA DGX Spark (GB10, 128 GB unified memory) with Docker and the NVIDIA Container Toolkit.
- Hatch for the Python environments, and Node.js 22.19 or newer for NemoClaw.
- A Hugging Face token for the model downloads, and an NGC API key for NIM containers.
- Data: both benchmarks already build with one command each, see
data/. - Synthetic custom components: see
docs/synthetic.md. Serve Super VL with vLLM, create the sandbox, scan with both agents inside it, run the loop, then approve an improvement and deploy it there; and roll the agents out with NeMo Gym. - The demo: see
demo/README.md. - PrimeVul: see
docs/primevul.md. Build the benchmark file and the knowledge base, serve Flash-Next with vLLM, create the sandbox, measure both agents inside it on the test pairs, run the prompt loop, and roll the agents out with NeMo Gym.
hatch run fmt # format and lint
hatch run test:unit # unit tests, no GPU needed
hatch run test:types # type checksApache-2.0, see LICENSE. Third-party software, models and datasets keep their own licenses, see NOTICE.
