LLM and RAG audits including safety, security, hallucination, and citation checks
Project description
rai-audit-llm
LLM and RAG audits for prompt injection, unsafe output, toxicity, faithfulness, citations, retrieval quality, and retrieval security.
CLI
Audit captured responses from a YAML suite:
rai-audit llm run --suite packages/rai-audit-llm/examples/llm_audit_suite.yml --format html
New suites should set schema_version: "1.0". Existing unversioned suites and
the legacy tests key are migrated during loading.
Use --audit-type rag to run only RAG checks or --audit-type rag-security to
scan only retrieval security cases.
Python API
from rai_audit.llm import LLMAudit, load_test_suite
suite = load_test_suite("packages/rai-audit-llm/examples/llm_audit_suite.yml")
report = LLMAudit(suite, persist=False).run()
For live evaluation, pass responder=lambda case: .... RAG faithfulness checks
require an LLM-as-judge verdict: provide judge_result in captured YAML or pass
faithfulness_judge=lambda case, response: {"score": 0.9, "reasoning": "..."}.
RAG suites can set relevant_sources and retrieval_k for recall@k and reciprocal
rank checks. Retrieved contexts support document_id, tenant_id, updated_at,
and poisoned metadata for provenance, tenant-isolation, freshness, and poisoned
document checks.
OpenAIResponder and AnthropicResponder capture latency, token usage, and
optional caller-supplied pricing. Suites can also run structured_output,
pii_redaction, prompt_leakage, refusal_overblocking, rate_limit,
latency, and token_budget checks. Use rubric_judge for configurable
LLM-as-judge scoring and summarize_reports for repeated-run benchmarks.
All findings include OWASP LLM Top 10 2025 references where applicable.
Project details
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 rai_audit_llm-0.1.8.tar.gz.
File metadata
- Download URL: rai_audit_llm-0.1.8.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fd8a16b3024f8f3ef95b29b593e56de39f4e6b6e238e6a541ebba8d4fd2574a
|
|
| MD5 |
08f62ca87254c373d70087e8d9652af9
|
|
| BLAKE2b-256 |
6c7a084a9cede79dca64dc78259c208f260f934e6726bad71f089f02aec66d9e
|
Provenance
The following attestation bundles were made for rai_audit_llm-0.1.8.tar.gz:
Publisher:
publish.yml on SaiTeja-Erukude/rai-audit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rai_audit_llm-0.1.8.tar.gz -
Subject digest:
1fd8a16b3024f8f3ef95b29b593e56de39f4e6b6e238e6a541ebba8d4fd2574a - Sigstore transparency entry: 1686248423
- Sigstore integration time:
-
Permalink:
SaiTeja-Erukude/rai-audit@765d806641dfb84532bfe7781e171f85ba80c1c5 -
Branch / Tag:
refs/tags/rai-audit-llm-v0.1.8 - Owner: https://github.com/SaiTeja-Erukude
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@765d806641dfb84532bfe7781e171f85ba80c1c5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rai_audit_llm-0.1.8-py3-none-any.whl.
File metadata
- Download URL: rai_audit_llm-0.1.8-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98bbe75434b0cb023cff01cac0d5b37d0a18e077ef4d6fa6c808b40c2b822eb7
|
|
| MD5 |
50754e03789dea79cfd145c6e5d86ddc
|
|
| BLAKE2b-256 |
9a036d1866504fb700e301c4fb0cb0d525d984bbc994993c612fc019b9f20a8f
|
Provenance
The following attestation bundles were made for rai_audit_llm-0.1.8-py3-none-any.whl:
Publisher:
publish.yml on SaiTeja-Erukude/rai-audit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rai_audit_llm-0.1.8-py3-none-any.whl -
Subject digest:
98bbe75434b0cb023cff01cac0d5b37d0a18e077ef4d6fa6c808b40c2b822eb7 - Sigstore transparency entry: 1686248630
- Sigstore integration time:
-
Permalink:
SaiTeja-Erukude/rai-audit@765d806641dfb84532bfe7781e171f85ba80c1c5 -
Branch / Tag:
refs/tags/rai-audit-llm-v0.1.8 - Owner: https://github.com/SaiTeja-Erukude
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@765d806641dfb84532bfe7781e171f85ba80c1c5 -
Trigger Event:
push
-
Statement type: