Not yet published to PyPI. Install from source — see below. When the package ships,
pip install "prompt-shields[openai]" will be the route.Install
Hello world
- OpenAI
- Anthropic
- Async
chat.completions.create, not Anthropic’s native messages.create — so switching vendors touches one line.
Constructor arguments
One client per use case
Constructor metadata is immutable per instance and stamps every event, so a single shared global client collapses unrelated work into one meaningless registry entry.Privacy behaviour
Detected PII categories are
email, phone, ssn, credit_card, ip_address, iban, health_data, and financial_data. Detection is pattern-based and runs locally.
Fail-open by design
Telemetry never blocks a model call.- Events buffer locally, up to 1000, and retry with exponential backoff.
- On overflow, the oldest events drop first.
- A collector outage degrades your discovery data. It does not degrade your application.