Installation
DecGuard is a Python package with a command-line interface. It needs Python 3.11 or newer and is tested on Linux and macOS with Python 3.11, 3.12 and 3.13.
From PyPI
pip install decguardOr install the CLI as an isolated tool with uv:
uv tool install decguardCheck the installation:
decguard --versiondecguard 0.1.1decguard with no arguments, or decguard <command> --help, lists the commands and their options. Running python -m decguard is equivalent.
Dependencies
DecGuard has four runtime dependencies: pydantic, typer, httpx and PyYAML. There are no optional extras: the mock, HTTP and System One backends, metrics, fuzzing, regression diffs, production checks and the SDK all ship in the base package. No GPU, model weights, database or service account is required.
Backends that serve real models run wherever you run them. DecGuard only needs network access to their URL and, when they require one, a credential in an environment variable.
As a library
The same package provides the Python API used by the CLI:
from decguard import DecGuard # runtime policy SDK
from decguard.engine import run_test # golden tests and fuzzing from Python
from decguard.backends import CallableBackend # wrap a Python function as a backendSee Policies and Python SDK and Custom backends.
From source
To try unreleased changes or contribute:
git clone https://github.com/suffro/decguard
cd decguard
uv tool install . # or, inside a virtual environment: pip install .For development (tests, linting, type checks), use the locked environment:
uv sync
uv run pytestThe repository's CONTRIBUTING.md describes the full workflow.
In CI
Install from PyPI in the job, pinning the version you tested with:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install decguard==0.1.1See CI with GitHub Actions for complete workflows.
Next: write your first contract.