Skip to main content

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 policy
  • get_proof(proof_id) — Retrieve a verification proof
  • verify_proof_locally(attestation, payload, public_key) — Verify attestation offline (Ed25519)
  • create_delegation(agent_id, allowed_actions, ...) — Create a scoped agent delegation
  • get_usage(period=None) — Get billing usage stats
  • health() — 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

veritera-0.2.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

veritera-0.2.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file veritera-0.2.1.tar.gz.

File metadata

  • Download URL: veritera-0.2.1.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

Hashes for veritera-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4724a8b45dc3fab491bef0e025f0c9aab6cb5bb988652a4253e739beb3bf3de8
MD5 9f9d156f10fcb6d3fb54937dc1ac0f21
BLAKE2b-256 9b02c9fb553361e32cb420793655a03b8ee9063ed84c5a3e912db8d5afc75669

See more details on using hashes here.

File details

Details for the file veritera-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: veritera-0.2.1-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

Hashes for veritera-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af9307c77ded919fe83aac10f25678378609232032c51505b83e239930e052c0
MD5 94567e60a957e40d5f375bdc5e4a7825
BLAKE2b-256 a4fcf736f3f56bdcf71fa6704f50777dd37b19d5c484f7a8d158a4dd0d37139d

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