Metadata-Version: 2.4
Name: vantageai
Version: 0.4.0
Summary: Vendor-neutral governance SDK for enterprise AI agents
Author-email: Vantage <sdk@vantage.ai>
License: MIT
Project-URL: Homepage, https://vantage.ai
Project-URL: Repository, https://github.com/vantageai/vantage
Keywords: ai,agents,governance,audit,observability
Classifier: Development Status :: 4 - Beta
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 :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27.0
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3.0; extra == "langchain"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: respx>=0.21; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Dynamic: license-file

# vantageai

Python SDK for Vantage governance, execution-boundary enforcement, and brokered model execution.

## Install

```bash
pip install vantageai
```

## Core Client

```python
from vantageai import VantageClient

client = VantageClient(
    api_key="vt-...",
    agent_id="mortgage-underwriter",
    base_url="https://api.vantage.ai",
)
```

## Evaluate, Authorize, Commit

```python
decision = await client.evaluate(
    action_type="approve_large_loan",
    action_payload={"amount": 850000, "applicantId": "app-123"},
)

authorization = await client.authorize(
    action_type="openai.chat.completions.create",
    action_payload={
        "model": "gpt-4.1-mini",
        "messages": [{"role": "user", "content": "Review this file"}],
    },
    execution_trace_id="trace-123",
    ttl_seconds=120,
)

if authorization.decision == "allow" and authorization.authorization:
    await client.commit_authorization(
        authorization.authorization.id,
        action_payload={
            "model": "gpt-4.1-mini",
            "messages": [{"role": "user", "content": "Review this file"}],
        },
        execution_trace_id="trace-123",
    )
```

## Brokered Provider Execution

```python
result = await client.broker_openai_chat_completion(
    request={
        "model": "gpt-4.1-mini",
        "messages": [{"role": "user", "content": "Review this mortgage application"}],
        "stream": False,
    },
    execution_trace_id="trace-123",
    ttl_seconds=180,
)

if result.decision == "allow":
    print(result.authorizationId, result.commitAttemptId, result.completion)
```

Anthropic and OpenAI-compatible broker client helpers are available too:

```python
from vantageai import create_brokered_anthropic_client, create_brokered_openai_client

openai = create_brokered_openai_client(client, execution_trace_id="trace-123", ttl_seconds=180)
anthropic = create_brokered_anthropic_client(client, execution_trace_id="trace-123", ttl_seconds=180)
```

## Observed Wrappers

```python
from openai import OpenAI
from vantageai import VantageClient, wrap_openai_client

vantage = VantageClient(api_key="vt-...", agent_id="mortgage-underwriter")
openai = wrap_openai_client(OpenAI(api_key="..."), vantage)

await openai.chat.completions.create(
    model="gpt-4.1-mini",
    messages=[{"role": "user", "content": "Summarize this file"}],
)
```

Observed wrappers keep post-execution logging behavior. If the org is in broker-required mode, strict logging surfaces that violation instead of silently claiming execution was governed.

## Operator Visibility

```python
boundary = await client.get_execution_boundary_settings()
authorizations = await client.list_execution_authorizations(limit=20)
attempts = await client.list_execution_commit_attempts(limit=20)
performance = await client.get_performance_snapshot()
```

## Sync Usage

```python
from vantageai import VantageClientSync

client = VantageClientSync(api_key="vt-...", agent_id="mortgage-underwriter")
snapshot = client.get_execution_boundary_settings()
```
