Forge Verify SDK — Verify AI agent decisions with cryptographic attestation
Project description
forge-verify
Forge Verify SDK for Python. Verify AI agent decisions with cryptographic attestation.
Install
pip install forge-verify
Quick Start
from forge_verify import ForgeVerify
forge = ForgeVerify(api_key="vt_live_...")
result = await forge.verify_decision(
agent_id="agent-1",
action="payment.create",
params={"amount": 100, "currency": "USD"},
policy="finance-controls",
)
if result.verified:
# Action approved
pass
else:
print("Blocked:", result.reason)
Synchronous Usage
from forge_verify import ForgeVerify
forge = ForgeVerify(api_key="vt_live_...")
result = forge.verify_sync("send_email", params={"to": "user@example.com"}, policy="email-controls")
verify_sync() works in plain scripts, running asyncio event loops, FastAPI contexts, and Jupyter notebooks.
API
ForgeVerify(api_key, **options)
| Option | Type | Default | Description |
|---|---|---|---|
api_key |
str |
required | API key (vt_live_..., vt_sandbox_...) |
base_url |
str |
https://veritera.ai |
API base URL |
timeout |
float |
10.0 |
Request timeout (seconds) |
max_retries |
int |
2 |
Retries on 5xx errors |
fail_closed |
bool |
True |
Return denied instead of raising on errors |
debug |
bool |
False |
Enable debug logging |
Aliases: Forge, Veritera (backward compatibility)
Methods
verify_decision(agent_id, action, ...)— Verify an agent action against policyget_proof(proof_id)— Retrieve a verification proofverify_proof_locally(attestation, payload, public_key)— Verify attestation offline (Ed25519)create_delegation(agent_id, allowed_actions, ...)— Create a scoped agent delegationget_usage(period=None)— Get billing usage statshealth()— Check API health
Error Handling
from forge_verify import ForgeError, RateLimitError
try:
result = await forge.verify_decision(...)
except RateLimitError as e:
# Wait e.retry_after_ms before retrying
pass
except ForgeError as e:
print(e.code, e.status, str(e))
Fail-Closed (Default)
When fail_closed=True (default), network/server errors return a denied result instead of raising. The agent is blocked, not crashed.
Circuit Breaker
After 5 consecutive failures, the SDK opens a circuit breaker for 30 seconds. After 30s, one request is allowed through (half-open). On success, the circuit closes.
Idempotency
Pass idempotency_key to verify_decision() to prevent duplicate processing:
result = await forge.verify_decision(
agent_id="agent-1",
action="payment.create",
idempotency_key="unique-request-id",
)
Migrating from veritera
pip uninstall veritera
pip install forge-verify
Update imports:
# Before
from veritera import Veritera
# After (Veritera still works as alias)
from forge_verify import ForgeVerify
Requirements
- Python >= 3.9
- Dependencies:
httpx,cryptography
Links
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file veritera-0.2.0.tar.gz.
File metadata
- Download URL: veritera-0.2.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae73689012abba2eeca93357055d6964c05d416ac133dd080904718092d8e03f
|
|
| MD5 |
8f2ff7218e692333e606d2cb20c76f05
|
|
| BLAKE2b-256 |
460387caf796fd6dbba766cac430bbb34b5851d54a26dd1c216e73f2317ada04
|
File details
Details for the file veritera-0.2.0-py3-none-any.whl.
File metadata
- Download URL: veritera-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
205720cf4d40976d4595dfb697bad2377b79b05ab0b78fd8c8c7521760c653f1
|
|
| MD5 |
5d8cb0a1d1bbd4629ee4274bae928cc9
|
|
| BLAKE2b-256 |
aedc1df571ddf50155d90be86fb595ea34706187c3336dedf4db2d77234a4d55
|