Metadata-Version: 2.4
Name: mawlaia-guardrail
Version: 0.1.0
Summary: Runtime safety proxy for LLM applications
License: MIT
Author: Mawlaia
Author-email: dev@mawlaia.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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
Provides-Extra: all
Provides-Extra: anthropic
Provides-Extra: openai
Requires-Dist: anthropic (>=0.25,<0.26) ; extra == "anthropic" or extra == "all"
Requires-Dist: openai (>=1.0,<2.0) ; extra == "openai" or extra == "all"
Requires-Dist: pydantic (>=2.0,<3.0)
Requires-Dist: pyyaml (>=6.0,<7.0)
Project-URL: Homepage, https://mawlaia.com
Project-URL: Repository, https://github.com/mawlaia/guardrail
Description-Content-Type: text/markdown

# guardrail

> Runtime safety proxy for AI apps.

**guardrail** is a drop-in proxy that protects your AI features from prompt injection, jailbreaks, and unsafe outputs — with sub-50ms overhead and no vendor lock-in.

```python
from guardrail import GuardrailProxy
import openai

client = GuardrailProxy(
    openai.OpenAI(api_key="..."),
    policy="guardrail.yaml"
)

# Input is checked before reaching the model
# Output is filtered before reaching your app
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": user_message}]
)
```

## Status

🚧 **Early development.** Star to follow progress.

## What it does

- **Input protection** — prompt injection, jailbreak, instruction override detection
- **Output filtering** — PII leakage, regulated content (medical/legal/financial), harmful content, brand safety
- **Multi-provider** — OpenAI, Anthropic, Google, Mistral, local models
- **Policy-as-code** — define rules in YAML, update at runtime without redeploy
- **Audit log** — every flagged call logged with reason code and severity
- **Sub-50ms** — small classifier models, not LLM-as-judge on the critical path

## Roadmap

- [ ] Python SDK
- [ ] TypeScript SDK
- [ ] Prompt injection classifier (open weights)
- [ ] Policy YAML spec
- [ ] Hosted API ([mawlaia.com](https://mawlaia.com))
- [ ] SOC 2 Type II

## License

MIT

