AI application security CLI — SBOM generation, static analysis, cognitive policy validation, and adversarial red-teaming for AI apps
Reason this release was yanked:
too old
Project description
NuGuard OSS
NuGuard is an open source AI application security CLI. It can generate an AI-focused SBOM from source code, run static security analysis, validate cognitive policy documents, and red-team a live AI app with scenario-driven adversarial testing.
What It Does
- Generate an AI-SBOM from a local codebase or Git repo
- Analyze the SBOM for structural AI security risks and dependency issues
- Cross-check a cognitive policy against the SBOM
- Red-team a running AI application with prompt injection, tool abuse, data exfiltration, and related attack scenarios
- Export findings in text, JSON, Markdown, and SARIF-oriented workflows
Current CLI Surface
Implemented and usable today:
nuguard sbomnuguard analyzenuguard scannuguard policynuguard redteam
Present but still stubbed / not yet implemented:
nuguard seednuguard reportnuguard findingsnuguard replay
Requirements
- Python 3.12+
uvfor the recommended local workflow
Optional external tools used by some analysis paths:
grypecheckovtrivysemgrep
If these tools are not installed, the corresponding checks can be skipped or may report as unavailable depending on the command path.
Installation
uv sync --dev
Run the CLI with:
uv run nuguard --help
Or, from the virtual environment:
. .venv/bin/activate
nuguard --help
Quick Start
1. Generate an AI-SBOM
uv run nuguard sbom generate --source . --output app.sbom.json
You can also scan a remote repository:
uv run nuguard sbom generate \
--from-repo https://github.com/org/repo \
--ref main \
--output app.sbom.json
2. Run Static Analysis
uv run nuguard analyze --sbom app.sbom.json --format markdown
Typical outputs:
markdownfor human reviewjsonfor automationsariffor code scanning pipelines
3. Validate or Check a Cognitive Policy
Validate policy structure:
uv run nuguard policy validate --file cognitive-policy.md
Cross-check policy against the SBOM:
uv run nuguard policy check \
--policy cognitive-policy.md \
--sbom app.sbom.json
4. Red-Team a Live App
uv run nuguard redteam \
--sbom app.sbom.json \
--target http://localhost:3000 \
--format json
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
uv run 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 featuresredteam: target URL, endpoint, canary file, profiles, scenario filters, and guided conversation settingsanalyze: 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.
Common Commands
uv run nuguard --help
uv run nuguard sbom --help
uv run nuguard analyze --help
uv run nuguard policy --help
uv run nuguard redteam --help
uv run nuguard scan --help
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-oss - 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
No license file is currently present in this repository. Add one before treating the project as redistributable open source.
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.1.0.tar.gz.
File metadata
- Download URL: nuguard-0.1.0.tar.gz
- Upload date:
- Size: 446.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b488f216618c786422158cee662836b4834b14df56609e5ede942ebc30bf00d
|
|
| MD5 |
629b730a572d15ce512216fcd0087175
|
|
| BLAKE2b-256 |
8f33297c7661927e45014c45a42e812420df13651710df95cf9addb11adfe8ce
|
File details
Details for the file nuguard-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nuguard-0.1.0-py3-none-any.whl
- Upload date:
- Size: 570.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
112ddb1ffbf9e452098a529051c6c5f3a4d1a56f55fd36f6fb76a75c47c62a9d
|
|
| MD5 |
d1246fe39c2dca0d35f6ee92c51d69c3
|
|
| BLAKE2b-256 |
d367f8738981c1d9d9f59dd6763c3e380e36edc6bcb6768bb44caf3598097ad7
|