Skip to main content

Route OpenAI and Anthropic API calls through the Vigil AI security proxy

Project description

vigil-sdk

Route OpenAI and Anthropic API calls through the Vigil AI security proxy. One-line integration — wrap your existing client and everything else stays the same.

Quickstart

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

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

Usage

OpenAI

from openai import OpenAI
from vigil_sdk import wrap

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

Anthropic

from anthropic import Anthropic
from vigil_sdk import wrap

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

Async clients

from openai import AsyncOpenAI
from vigil_sdk import wrap

client = wrap(AsyncOpenAI())

Custom proxy URL

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vigil_sdk-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vigil_sdk-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file vigil_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: vigil_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for vigil_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f3f42b1b68cbeb2da181ff8d39cc28b150f4154b23acaf5a9823c064071d549e
MD5 39408e30d27901fb63237aa990ba466d
BLAKE2b-256 a475c432e41dceecde2c92b80576b05a90941267d4852964e9f9d52e0c5039d8

See more details on using hashes here.

File details

Details for the file vigil_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vigil_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for vigil_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 377f200f2b7fee9337ff65593038b31291e196faf01fd480d9cb0d9cadc2a23f
MD5 a00fb4cfc9cd413d708d102ba56b3934
BLAKE2b-256 35f66582d0ab2876c68dae6ea6216edf465182ee3fe9f8229cc911db8c690f4e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page