Skip to main content

RagGovern

RagGovern inventories RAG projects and checks their static configuration locally. It parses source as data and attaches source evidence to every finding. Install the release with python -m pip install RagGovern. The Python import and console command are both ragguard.

Assess your own project

Point the CLI at your application root. Source files can live anywhere within the included tree. From the application directory, run:

ragguard inspect .
ragguard scan . --format json

Look at architecture.grounding to see whether RagGovern traced retrieved content into generation. The report includes a path of component IDs that you can look up for filenames and lines. A partial result identifies visible components whose connection still needs evidence. Assembly-only projects and independently deployed services commonly produce partial results.

For custom Python APIs, bind qualified call names to roles in your policy. For a system built in another language or spread across services, supply a portable JSON description of its stages, settings and content flows with ragguard scan . --architecture topology.json. Declared settings can trigger policy findings. Runtime grounding and answer quality require additional evidence. Integration examples and coverage

Develop locally

Python 3.11+ is supported. Development targets Python 3.12. From this repository in an activated virtual environment:

python -m pip install -e ".[dev]"
ragguard init
ragguard config validate
ragguard scan examples/langchain
ragguard inspect examples/llamaindex --format mermaid
ragguard rules --format json

For an example with a threshold violation, run ragguard scan examples/custom --format json. The logging call that receives retrieved context produces a high-severity RG009 finding and exit code 1. Its evidence includes the relative file, source lines and logging function. The report omits the logged content.

Python SDK

from pathlib import Path
from ragguard import RAGGuard

guard = RAGGuard.from_config(Path("ragguard.yaml"), profile="ci")
snapshot = guard.inspect("examples/langchain")
print(snapshot.architecture.mermaid())

run = guard.scan("examples/custom")
for result in run.results:
    for finding in result.findings:
        print(finding.rule_id, finding.evidence.file, finding.evidence.line, finding.remediation)

RAGGuard.init(path) creates a policy. RAGGuard.validate_config(path) returns the effective typed settings. guard.rules() returns the catalog. JSON output is available from the CLI and through Pydantic's model_dump_json().

Working with results

Inspection covers Python sources, manifests, structured configuration, documentation and Dockerfile inventory. Recognized RAG roles range from document loading to citation formatting. Directed edges record observed call inputs and receivers. Confidence and diagnostics describe the limits of each assessment. A clean process exit can include unassessed rules.

Command exit Meaning
0 Command succeeded, below the configured finding threshold
1 A finding reached the severity threshold
2 Invalid policy, argument or path
3 Internal execution or rule error

Use --output new-report.json to create a scan report. A plain scan writes to stdout. The static scanner needs no provider credentials or framework installations.

Development and packaging

python -m pytest
python -m ruff check .
python -m ruff format --check .
python -m mypy src
python -m build
python benchmarks/scan.py examples 5

The wheel and source archive are written to dist/. The source tree includes three small framework examples and fixtures for incomplete or sensitive input. CI covers Windows, Linux and macOS.

Metadata

Release files for RagGovern 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for RagGovern 0.2.0
File Size Uploaded Provenance Actions
raggovern-0.2.0.tar.gz 48.2 kB Without provenance Details for raggovern-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for RagGovern 0.2.0
File Interpreter ABI Platform Actions
raggovern-0.2.0-py3-none-any.whl Python 3 none any Details for raggovern-0.2.0-py3-none-any.whl

Total release size: 86.0 kB

Release files / raggovern-0.2.0.tar.gz

Download URL raggovern-0.2.0.tar.gz
Size 48.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2ff014af804e9a54b373658801b05803391bb44d94d4a0575739845ef704f394
BLAKE2b-256 checksum
How to use checksums
0e38a5fca7ccad2c7f58fb893afc34282feb93603ca6ee35b8aba7b1431c9064
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release files / raggovern-0.2.0-py3-none-any.whl

Download URL raggovern-0.2.0-py3-none-any.whl
Size 37.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f444d6fc452ca20e90ec92321d0f538400120ec7ac2aca5e477a7f1ea210002
BLAKE2b-256 checksum
How to use checksums
4100f630a51024dc9dc2d327f413bca4436d8a2f4b8531980c3e1542ddf587f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Security for RagGovern 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page