Metadata-Version: 2.4
Name: openaiguardrails-sdk
Version: 0.1.0
Summary: Official Python client for Open AI Guardrails policy distribution, audit evidence, and OPA control-plane APIs.
Author: Noir Stack LLC
License-Expression: MIT
Project-URL: Homepage, https://openaiguardrails.org/
Project-URL: Documentation, https://openaiguardrails.org/docs/
Project-URL: Runtime Reference, https://openaiguardrails.org/api/reference/
Project-URL: Repository, https://github.com/no1rstack/openaiguardrails
Project-URL: Issues, https://github.com/no1rstack/openaiguardrails/issues
Keywords: ai-safety,guardrails,opa,pdp,bifrost,governance,openai-guardrails
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
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: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# openaiguardrails-sdk

Official Python client for the Open AI Guardrails runtime governance API.

The PyPI distribution is currently published as `openaiguardrails-sdk` while PyPI reviews the canonical `openaiguardrails` project name. The Python import remains `openaiguardrails`.

## Install

```sh
pip install openaiguardrails-sdk
```

## Usage

```python
from openaiguardrails import OpenAIGuardrailsClient

client = OpenAIGuardrailsClient(
    base_url="https://openaiguardrails.org",
    token="YOUR_OPENAIGUARDRAILS_API_TOKEN",
)

policy = client.get_policy("prod-safety-alpha")
audit = client.export_audit("prod-safety-alpha")
```

For compatibility with the original client class name, `NoirGuardrailsClient` remains available as an alias.

## API surface

- `health()`
- `list_policies()`
- `get_policy(policy_id="prod-safety-alpha")`
- `toggle_policy_control(policy_id, key, value)`
- `run_policy_action(policy_id, action, **payload)`
- `export_audit(policy_id="prod-safety-alpha")`
- `list_opa_imports()`
- `import_opa_policy(payload)`
- `simulate_opa_import(import_id, input=None)`
- `export_opa_import(import_id, target)`
- `publish_opa_import(import_id, payload=None)`

The client is dependency-free and uses Python's standard library HTTP stack.

## Links

- Documentation: https://openaiguardrails.org/docs/
- Runtime reference: https://openaiguardrails.org/api/reference/
- Packages: https://openaiguardrails.org/projects/pypi-packages.html
