Metadata-Version: 2.5
Name: llm-output-guard-lite
Version: 0.1.0
Summary: Local heuristic output guardrails for LLM applications
License-Expression: MIT
License-File: LICENSE
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# 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.

```python
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.
