Metadata-Version: 2.4
Name: velaru-sdk
Version: 0.2.8
Summary: Governed AI audit receipts — seal(), prove_restraint(), bind_payment() in three lines
Author-email: Nisaba LLC <demond@velaru.xyz>
License-Expression: MIT
Project-URL: Homepage, https://velaru.onrender.com
Project-URL: Documentation, https://velaru.onrender.com/integrate
Project-URL: Repository, https://github.com/jdnova0802/velaru
Project-URL: Changelog, https://github.com/jdnova0802/velaru/releases
Keywords: velaru,ai,audit,compliance,cryptography,notary,receipt
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
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: Topic :: Security :: Cryptography
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests<3,>=2.28.0
Provides-Extra: openai
Requires-Dist: openai>=1.0.0; extra == "openai"
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.2.0; extra == "langchain"
Provides-Extra: mcp
Requires-Dist: mcp>=1.6.0; extra == "mcp"
Provides-Extra: crypto
Requires-Dist: cryptography>=41.0.0; extra == "crypto"
Provides-Extra: all
Requires-Dist: openai>=1.0.0; extra == "all"
Requires-Dist: langchain-core>=0.2.0; extra == "all"
Requires-Dist: cryptography>=41.0.0; extra == "all"
Requires-Dist: mcp>=1.6.0; extra == "all"
Dynamic: license-file

# Velaru SDK (Python) · v0.2.8

Governed attempts under frozen law — stranger-verifiable audit receipts in three lines. Official client for [Velaru](https://velaru.onrender.com).

## Install

```bash
pip install velaru-sdk

# Optional extras
pip install "velaru-sdk[all]"   # crypto + OpenAI middleware
```

## Quickstart (3 lines)

```python
from velaru import seal

receipt = seal("Bind policy DEMO-PAS-2026-001", domain="insurance")
print(receipt.verify_url)   # stranger verify — no login
print(receipt.permalink)    # permanent /r/{id} URL
```

## Restraint Atom (bind-gate / carrier wedge)

```python
from velaru import prove_restraint

proof = prove_restraint(
    "policy_bind",
    "Permit-before-bind: delegation limit exceeded",
    capability_proof={"bind_authority_limit_usd": 50_000},
)
print(proof["verify_url"])
```

## Bind-payment twin (PDTR)

```python
from velaru import bind_payment

twin = bind_payment("0xpayment_hash", decision_entry_id="ENTRY_ID")
print(twin["verify_url"])
```

## LangChain callback

```python
from langchain_openai import ChatOpenAI
from velaru import Velaru, VelaruCallbackHandler

handler = VelaruCallbackHandler(Velaru(api_key="YOUR_KEY"), domain="insurance")
llm = ChatOpenAI(model="gpt-4o-mini", callbacks=[handler])
```

Public try-it key: `velaru_public_demo` (sandbox, 10 req/min) — see [/integrate](https://velaru.onrender.com/integrate).

## MCP server (Cursor / Claude Desktop)

```bash
pip install "velaru-sdk[mcp]"
velaru-mcp
```

Tools: `velaru_seal`, `velaru_prove_restraint`, `velaru_bind_payment`, `velaru_hero_demo`, `velaru_warm`.  
Cursor config: `integrations/mcp/cursor-config.json` in the repo.

## Local verify (optional — advanced)

```bash
pip install "velaru-sdk[crypto]"
```

```python
receipt = seal("hello", domain="hiring")
assert receipt.verify_local()
```

## CLI

```bash
velaru seal "Skip the safety review" --domain hiring
velaru restraint --action "policy_bind" --reason "Delegation limit"
velaru public-key
```

## OpenAI middleware

```bash
pip install "velaru-sdk[openai]"
```

```python
from openai import OpenAI
from velaru import VelaruAuditedOpenAI

audited = VelaruAuditedOpenAI(OpenAI(), domain="hiring", api_key="YOUR_KEY")
result = audited.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello"}],
)
print(result.input_verify_url)
```

## API surface

| Call | Description |
|------|-------------|
| `seal(msg, domain=...)` | One-line receipt |
| `prove_restraint(action, reason, ...)` | Restraint Atom |
| `bind_payment(payment_hash, ...)` | PDTR twin receipt |
| `VelaruCallbackHandler` | LangChain callback (alias of VelaruAuditHandler) |
| `Velaru().classify(...)` | Full classify |
| `receipt.verify_url` | Browser verify link |
| `receipt.permalink` | Permanent receipt URL |

## Links

- [Integration guide](https://velaru.onrender.com/integrate)
- [Carrier hero demo](https://velaru.onrender.com/demo/hero)
- [Insurance wedge](https://velaru.onrender.com/insurance)
- [llms-full.txt](https://velaru.onrender.com/llms-full.txt)
- [PyPI](https://pypi.org/project/velaru-sdk/)

MIT © Nisaba LLC
