Skip to main content

LLM Output Guard Lite

Local heuristic guardrails for Python 3.10+ text and JSON responses. The package has zero runtime dependencies and makes no network calls during validation.

from llm_output_guard_lite import create_output_guard

guard = create_output_guard()
result = guard.check("Contact user@example.test")
if result["allowed"]:
    print(result["sanitizedOutput"])

Use check_async or assert_safe_async for trusted full-response plugins. Use stream() for explicitly managed sessions or wrap_stream() and wrap_stream_async() for iterator integration. Buffered streaming is the default and checks the whole response before emitting text. Incremental mode uses bounded line records and a conservative HTML tail. Shadow passthrough can expose protected content.

Enable json: {} to inspect JSON strings and apply structural checks. repair_json() alone performs structural processing and may return sensitive values. Policy and result dictionaries use the shared camelCase schema.

The provider adapters cover supported plain-text surfaces of OpenAI Chat Completions and Anthropic Messages. Unsupported content blocks and provider-specific structured or streaming formats are rejected. The guard operates on text and supported references. It cannot inspect image pixels, audio, or video, and does not replace renderer-level sanitization or content controls.

MIT licensed. See LICENSE.

Metadata

Release files for llm-output-guard-lite 0.1.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 llm-output-guard-lite 0.1.0
File Size Uploaded Provenance Actions
llm_output_guard_lite-0.1.0.tar.gz 17.9 kB Without provenance Details for llm_output_guard_lite-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llm-output-guard-lite 0.1.0
File Interpreter ABI Platform Actions
llm_output_guard_lite-0.1.0-py3-none-any.whl Python 3 none any Details for llm_output_guard_lite-0.1.0-py3-none-any.whl

Total release size: 40.3 kB

Release files / llm_output_guard_lite-0.1.0.tar.gz

Download URL llm_output_guard_lite-0.1.0.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1110178f5782cf35e9516b30de9cfa99b461c97a5af27f84d74029ee3472aef7
BLAKE2b-256 checksum
How to use checksums
5aa82fcb83f50d3f1b887cd400acfe35cbfbbf536b69529bf119f327e1a6588f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Release files / llm_output_guard_lite-0.1.0-py3-none-any.whl

Download URL llm_output_guard_lite-0.1.0-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f229c0e010bc4ec878d4be4c98f45a6fa5eb11fa3759b9f08e9249d1136edf8
BLAKE2b-256 checksum
How to use checksums
a88a60793f621456b998735546959dfe7f1b087c5b44272b31562a3f8b3553cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Security for llm-output-guard-lite 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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