AI application security — SBOM generation, vulnerability scanning, behavioral validation, and adversarial red-teaming for AI Agents
Project description
NuGuard Open Source
NuGuard is an open source AI application security toolkit. Its goal is to provide the most extensive redteaming and behavioral validation of Agentic AI applications.
AI developers can focus on building their applications while NuGuard continuously tests and validates them against a wide range of security risks, including prompt injection, tool misuse, data exfiltration, and more.
What It Does
- Generate an AI-SBOM from a local codebase or Git repo
- Analyze the SBOM for structural AI security risks and supply-chain issues
- Propose an AI behavioral policy based on the SBOM
- Perform static and runtime behavioral testing purpose built around the AI-SBOM and the behavioral policy
- Red-team a sandboxed AI application: most extensive and updated catalog of attack vectors plus custom-built scenarios. This includes prompt injection, tool abuse, data exfiltration, and related attack scenarios that exercise the various sub-agents, tools, and capabilities of the target system.
- Automated remediation suggestions for findings, including code snippets and policy adjustments
- Export findings in text, JSON, Markdown, and SARIF-oriented workflows
Current CLI Surface
Implemented and usable today:
nuguard sbomnuguard analyzenuguard scannuguard policynuguard behaviornuguard redteam
Requirements
- Python 3.12+
uvfor the recommended local workflow
Installation
Python CLI:
pip install nuguard
The steps below describe how to set up a local development environment. This is recommended if you want to run the latest code, contribute to the project, or run the CLI with LLM-assisted features that require local environment variable configuration.
uv sync --dev
Run the CLI with:
uv run nuguard --help
Or, from the virtual environment:
. .venv/bin/activate
nuguard --help
Claude users can use plugin commands.
Follow the instructions in docs/plugin-guide.md to set up the NuGuard plugin for Claude and use it to run commands like /nuguard-sbom, /nuguard-analyze, and /nuguard-redteam directly from your conversations with Claude.
Quick Start
1. Generate an AI-SBOM
nuguard sbom generate --source . --output app.sbom.json
You can also scan a remote repository:
nuguard sbom generate \
--from-repo https://github.com/org/repo \
--ref main \
--output app.sbom.json
2. Run Static Analysis
nuguard analyze --sbom app.sbom.json --format markdown
Typical outputs:
markdownfor human reviewjsonfor automationsariffor code scanning pipelines
3. Behavioral Testing
nuguard behavior \
--sbom app.sbom.json \
--target http://localhost:3000 \
--format markdown
4. Red-Team a Live App
nuguard redteam \
--config nuguard.yaml \
--output reports/redteam.md \
--format markdown
For richer red-team coverage, you can also provide:
- a cognitive policy with
--policy - canary values with
--canary - a config file with
--config
5. Run the Unified Pipeline
nuguard scan \
--source . \
--output-dir nuguard-reports
This is the easiest way to run SBOM generation plus static analysis in one pass.
Configuration
NuGuard supports project configuration through nuguard.yaml. A ready-to-edit example lives at nuguard.yaml.example.
Key areas in the example config:
sbom: existing SBOM pathsource: source directory for generationpolicy: cognitive policy pathllm: model settings for LLM-assisted featuresbehavior: target URL, endpoint, and test profile settings for behavioral testingredteam: target URL, endpoint, canary file, profiles, scenario filters, guided conversation settings, and finding trigger controls (finding_triggers.*)analyze: minimum severity thresholddatabase: SQLite or Postgres-backed storage settingsoutput: output format and failure threshold
CLI flags take precedence over nuguard.yaml, which takes precedence over environment variables and built-in defaults.
Red-Team Canaries
NuGuard can watch for seeded canary values during dynamic testing to produce high-confidence exfiltration findings. Start from canary.example.json, create your local canary.json, seed those values into the target system, then point nuguard redteam at that file with --canary.
More detail is available in docs/redteam-engine.md.
Development
Install dev dependencies:
make dev
Run tests:
make test
Run linting and type checks:
make lint
Format the codebase:
make fmt
Publishing
This repo includes GitHub Actions workflows for Trusted Publishing to TestPyPI and PyPI:
Before the workflows can publish, configure Trusted Publishers in TestPyPI and PyPI for the nuguard project with:
- owner/org:
NuGuardAI - repository:
nuguard - workflow file:
publish-testpypi.ymlorpublish-pypi.yml - environment:
testpypiorpypi
Recommended release flow:
- Run the TestPyPI workflow manually from GitHub Actions.
- Verify the package install and CLI behavior from TestPyPI.
- Create a GitHub release to trigger the PyPI publish workflow.
Repo Notes
- The repository currently contains example outputs and benchmark fixtures under
tests/output/ - Some red-team and benchmark tests are opt-in and gated by environment variables
- LLM-assisted features depend on provider credentials being available via environment variables
License
License information is available in the LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nuguard-0.6.2.tar.gz.
File metadata
- Download URL: nuguard-0.6.2.tar.gz
- Upload date:
- Size: 981.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b04ea243f632426a023cc745304d43839e9ac052cd42000d401ec3976463132
|
|
| MD5 |
355016c7e8c6a9e685665c33932a7149
|
|
| BLAKE2b-256 |
24ad30aef765d561768254459b6abeed6c4bc52c150692d13b1c0aa7481c71f8
|
Provenance
The following attestation bundles were made for nuguard-0.6.2.tar.gz:
Publisher:
publish-pypi.yml on NuGuardAI/nuguard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nuguard-0.6.2.tar.gz -
Subject digest:
2b04ea243f632426a023cc745304d43839e9ac052cd42000d401ec3976463132 - Sigstore transparency entry: 1763471404
- Sigstore integration time:
-
Permalink:
NuGuardAI/nuguard@427b430d897a7ecd9e58124ebb70a109736fb313 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/NuGuardAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@427b430d897a7ecd9e58124ebb70a109736fb313 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file nuguard-0.6.2-py3-none-any.whl.
File metadata
- Download URL: nuguard-0.6.2-py3-none-any.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11938712d75c462b3f5584cf428a0e93351bd9ba377c66a4007b05099702d194
|
|
| MD5 |
d527d313a7635b80589deed41a5ba40f
|
|
| BLAKE2b-256 |
2a550c8b7d6c7a2a67a4ecc30f87890680ea2772f6d74238bc37b23170fca9d8
|
Provenance
The following attestation bundles were made for nuguard-0.6.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on NuGuardAI/nuguard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nuguard-0.6.2-py3-none-any.whl -
Subject digest:
11938712d75c462b3f5584cf428a0e93351bd9ba377c66a4007b05099702d194 - Sigstore transparency entry: 1763471508
- Sigstore integration time:
-
Permalink:
NuGuardAI/nuguard@427b430d897a7ecd9e58124ebb70a109736fb313 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/NuGuardAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@427b430d897a7ecd9e58124ebb70a109736fb313 -
Trigger Event:
workflow_dispatch
-
Statement type: