Metadata-Version: 2.4
Name: velaru-sdk
Version: 0.2.2
Summary: Tamper-evident AI audit receipts in three lines — seal(), prove_restraint(), local Ed25519 verify
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: 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"
Dynamic: license-file

# Velaru SDK (Python) · v0.2.2

Tamper-evident AI audit receipts in three lines. Official client for [Velaru](https://velaru.onrender.com).

## Install

```bash
pip install velaru-sdk

# Recommended — local Ed25519 verify + OpenAI middleware
pip install "velaru-sdk[all]"
```

## Quickstart (3 lines)

```python
from velaru import seal

receipt = seal("your message", domain="hiring")
print(receipt.verify_url)   # open in browser — 12 green checks
print(receipt.permalink)    # permanent /r/{id} URL
```

## Restraint Atom (one call — beats two-phase commit-reveal)

```python
from velaru import prove_restraint

proof = prove_restraint(
    "financial.execute_trade",
    "Risk threshold exceeded",
    capability_proof={"permissions": ["trade.execute"]},
)
print(proof["verify_url"])
```

## Local verify (no server round-trip)

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

```python
receipt = seal("hello", domain="hiring")
assert receipt.verify_local()  # Ed25519 over entry_hash
```

## CLI

```bash
pip install "velaru-sdk[crypto]"
velaru seal "Skip the safety review" --domain hiring
velaru restraint --action "trade.execute" --reason "Risk limit"
velaru public-key
```

## OpenAI middleware (15-minute integration)

```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 |
| `Velaru().classify(...)` | Full classify |
| `Velaru().prove_restraint(...)` | Restraint Atom (client) |
| `Velaru().commit_counterfactual(...)` | Commit phase |
| `Velaru().reveal_counterfactual(...)` | Reveal phase |
| `Velaru().seal_reasoning(...)` | Seal model tokens |
| `Velaru().public_key()` | Ed25519 public key |
| `Velaru().offline_verify_kit()` | Portable verify bundle |
| `receipt.verify_url` | Browser verify link |
| `receipt.permalink` | Permanent receipt URL |
| `receipt.verify_local()` | Offline Ed25519 check |

## Links

- [Integration guide](https://velaru.onrender.com/integrate)
- [Public verifier](https://velaru.onrender.com/verify)
- [Procurement hub](https://velaru.onrender.com/procurement)
- [PyPI](https://pypi.org/project/velaru-sdk/)

MIT © Nisaba LLC
