Metadata-Version: 2.4
Name: papa-guard
Version: 0.1.0
Summary: AI safety middleware: PII filter, injection guard, cost tracker
License: MIT
Project-URL: Homepage, https://github.com/papa-ecosystem/papa-lang
Project-URL: Repository, https://github.com/papa-ecosystem/papa-lang
Project-URL: Documentation, https://papa-lang.dev/docs/guard
Project-URL: Bug Tracker, https://github.com/papa-ecosystem/papa-lang/issues
Keywords: ai,safety,pii,llm,guard,hallucination,russian
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pydantic>=2.0

# papa-guard

> AI safety middleware for Russian-language AI systems.  
> PII filter (ФЗ-152) + injection guard + cost tracker.

## Install

```bash
pip install papa-guard
```

## Quick Start

```python
from papa_guard import Guard

guard = Guard()
result = guard.check_input("Звоните +7 999 123-45-67 Ивану Петровичу")

print(result.sanitized_text)   # "Звоните [ТЕЛЕФОН] [ФИО]"
print(result.pii_redacted_count)  # 2
print(result.blocked)   # False
```

## Why papa-guard?

| Feature         | papa-guard | presidio | no solution |
|-----------------|------------|----------|-------------|
| Russian PII     | ✅ native  | partial  | ❌          |
| Zero ML deps    | ✅         | ❌       | ✅          |
| Injection guard | ✅         | ❌       | ❌          |
| Cost tracking   | ✅         | ❌       | ❌          |
| ФЗ-152 compliant | ✅        | partial  | ❌          |
| Processing time | <5ms      | ~50ms    | 0ms         |

## Used by

- papa-app (multi-agent AI orchestration)
- papa-lang ecosystem
