Metadata-Version: 2.4
Name: vigil-sdk
Version: 0.1.0
Summary: Route OpenAI and Anthropic API calls through the Vigil AI security proxy
Author: Vigil AI Security
License: MIT
Project-URL: Homepage, https://runvigil.ai
Project-URL: Repository, https://github.com/vigilai/vigil-sdk-py
Keywords: ai,security,proxy,openai,anthropic,vigil
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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: Topic :: Security
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: openai
Requires-Dist: openai>=1.0; extra == "openai"
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.20; extra == "anthropic"
Provides-Extra: all
Requires-Dist: openai>=1.0; extra == "all"
Requires-Dist: anthropic>=0.20; extra == "all"

# vigil-sdk

Route OpenAI and Anthropic API calls through the [Vigil](https://runvigil.ai) AI security proxy. One-line integration — wrap your existing client and everything else stays the same.

## Quickstart

```python
from openai import OpenAI
from vigil_sdk import wrap

client = wrap(OpenAI())
response = client.chat.completions.create(
    model="gpt-4o", messages=[{"role": "user", "content": "Hello"}]
)
```

## Install

```bash
pip install vigil-sdk[openai]     # for OpenAI
pip install vigil-sdk[anthropic]  # for Anthropic
pip install vigil-sdk[all]        # both
```

## Usage

### OpenAI

```python
from openai import OpenAI
from vigil_sdk import wrap

client = wrap(OpenAI())
# Use client exactly as before — all traffic flows through Vigil
```

### Anthropic

```python
from anthropic import Anthropic
from vigil_sdk import wrap

client = wrap(Anthropic())
# Use client exactly as before — all traffic flows through Vigil
```

### Async clients

```python
from openai import AsyncOpenAI
from vigil_sdk import wrap

client = wrap(AsyncOpenAI())
```

### Custom proxy URL

```python
client = wrap(OpenAI(), proxy_url="http://localhost:9090")
```

Or set the `VIGIL_PROXY_URL` environment variable.

## How it works

`wrap()` reconfigures the client's underlying HTTP transport to route through the Vigil proxy at `localhost:8080`. The proxy intercepts requests, runs them through Vigil's security pipeline (injection detection, policy enforcement, anomaly scoring), and forwards allowed requests to the upstream API. Blocked requests return a 403 before reaching the AI provider.

## Requirements

- Python 3.9+
- Vigil proxy running locally (the Vigil menu bar app handles this)
- `openai>=1.0` and/or `anthropic>=0.20`

## License

MIT
