Metadata-Version: 2.4
Name: palveron-openai-agents
Version: 1.1.0
Summary: Official Palveron integration for the OpenAI Agents SDK — drop-in middleware for policy enforcement, PII masking, and audit trails.
Project-URL: Homepage, https://palveron.com
Project-URL: Documentation, https://docs.palveron.com/sdks
Project-URL: Repository, https://github.com/palveron/adapter-openai-agents
Project-URL: Issues, https://github.com/palveron/adapter-openai-agents/issues
Project-URL: Changelog, https://github.com/palveron/adapter-openai-agents/blob/main/CHANGELOG.md
Author-email: Palveron <hello@palveron.com>
License: MIT
License-File: LICENSE
Keywords: ai-governance,audit-trail,compliance,eu-ai-act,guardrails,openai,openai-agents,palveron,pii-detection
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
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
Classifier: Typing :: Typed
Requires-Python: >=3.8
Requires-Dist: openai>=1.0
Requires-Dist: palveron-sdk>=1.1.0
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# palveron-openai-agents

PALVERON AI Governance for the **OpenAI Agents SDK** — input and output guardrails with audit trails.

[![PyPI](https://img.shields.io/pypi/v/palveron-openai-agents.svg?style=flat-square)](https://pypi.org/project/palveron-openai-agents/)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0)

## Installation

```bash
pip install palveron-openai-agents
```

## Quick Start

```python
from agents import Agent
from palveron_openai_agents import palveron_input_guardrail, palveron_output_guardrail

agent = Agent(
    name="assistant",
    instructions="You are a helpful assistant.",
    input_guardrails=[palveron_input_guardrail(api_key="pv_live_xxx")],
    output_guardrails=[palveron_output_guardrail(api_key="pv_live_xxx")],
)

# Inputs with PII → blocked before the agent sees them
# Outputs with secrets → blocked before the user sees them
```

## How It Works

| Guardrail | When | What happens on BLOCKED |
|-----------|------|------------------------|
| `palveron_input_guardrail` | Before agent processes input | Raises `GuardrailTripwireTriggered` |
| `palveron_output_guardrail` | Before output reaches user | Raises `GuardrailTripwireTriggered` |

Every check creates an immutable trace in your PALVERON project for audit and compliance.

## Configuration

```python
guardrail = palveron_input_guardrail(
    api_key="pv_live_xxx",
    base_url="https://gateway.internal.corp:8080",  # On-prem
    fail_open=False,          # Block on gateway errors (default)
    metadata={"team": "ml"},  # Extra metadata on traces
)
```

## Links

- [Documentation](https://docs.palveron.com/integrations/openai-agents)
- [PALVERON Dashboard](https://app.palveron.com)
- [GitHub](https://github.com/palveron/palveron-openai-agents)

## License

[Apache 2.0](./LICENSE)
