Skip to main content

vella-sdk

Python SDK for deterministic pre-execution adjudication and signed proof-bundle generation.

Evidence conversion now rejects invalid unsigned 32-bit values and unknown symbols with E_EVIDENCE_INVALID. Invalid custom policies raise at creation rather than silently weakening rules. See evidence and policy validation for accepted forms and compatibility changes.

Version 2.0.0: the v2 proof and policy-bound signing APIs below introduce breaking changes from SDK 1.0.3. See migration and legacy limits.

Install

pip install vella-sdk

From source (development)

python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
pip install -e ".[dev]"
pytest
ruff check .
mypy --strict vella/

Basic usage

from vella import govern

result = govern(
    intent="EXECUTE_CHANGE",
    evidence_mask=1,
)

print(result["decision"])    # ALLOWED | DENIED
print(result["reason_code"]) # reason code string

With proof bundle

from vella import govern

signing_key = open("./proof-signing.pem", "r", encoding="utf-8").read()

result = govern(
    intent="EXECUTE_CHANGE",
    evidence_mask=1,
    proof_signing_key=signing_key,
)

print(result["proof_bundle"]["kind"])  # vella_proof_bundle_v2

Custom policy evaluators

Applications that need an application-supplied policy can create an isolated evaluator through the public package API:

from vella import create_evaluator

policy = {
    "policyVersion": "generation-v1",
    "defaultScope": "generation",
    "evidenceBits": {"AUTHN": 1},
    "scopes": {
        "generation": {
            "allowUnknownIntents": False,
            "defaultRequiredMask": 1,
            "intents": {"GENERATION_CONTEXT": 1},
        }
    },
}

evaluator = create_evaluator(policy)
result = evaluator.evaluate(
    {
        "intent_id": "GENERATION_CONTEXT",
        "evidence_mask": 1,
        "authority_scope_id": "generation",
        "policy_version": "generation-v1",
    }
)

print(result["decision"])    # ALLOWED | DENIED
print(result["reason_code"]) # reason code string

The policy uses the same policyVersion, defaultScope, evidenceBits, and scopes shape as DEFAULT_POLICY. Each scope declares allowUnknownIntents, defaultRequiredMask, and an intents mapping from normalized intent names to required evidence masks.

create_evaluator(...) returns a policy-bound evaluator whose evaluate(...) method returns decision and reason_code. Missing inputs, unknown intents or scopes, insufficient evidence, policy-version mismatches, and unexpected evaluator errors all return DENIED.

Use govern(...) for the built-in default policy. For custom-policy signing use a governor:

from vella import create_governor, verify_proof_v2

governor = create_governor(policy)
result = governor.govern(
    "GENERATION_CONTEXT", 1,
    request_id="request-123",
    action={"tool": "generate", "args": {"document": "draft-1"}},
    evidence={"identityRef": "session-123"},
    proof_signing_key=signing_key,
)
if result.get("proof_bundle"):
    checked = verify_proof_v2(result["proof_bundle"], trusted_public_key)
    if checked["ok"]:
        print(checked["authenticated"])

A governor snapshots its validated policy and exposes policy_version and policy_digest. Construct a new instance to activate a different policy. Custom evaluators remain evaluation-only.

The core SDK trusts application-supplied evidence, does not execute actions and does not persist proofs. Optional signing failure preserves the policy result and returns proof_bundle: None with proof_error. An integration requiring proof must stop before execution if signing or retention fails. Use the verified authenticated record, not an unverified decoded payload.

When to use this SDK

This SDK runs VELLA in-process inside your Python application. It is the right choice for agent tool-call hooks, CI/CD gating, edge compute, research notebooks, batch processing, and any context where microsecond-latency adjudication is needed without a separate service.

For enterprise service mesh, polyglot environments (Go, Java, .NET), Kubernetes admission control, or multi-tenant deployments, a different VELLA component (the runtime service or sidecar adapter) is the better fit. See the full deployment scope in the repository root.

API

  • govern(intent, evidence_mask, authority_scope=None, policy_version=None, proof_signing_key=None)
    • Returns a dict with decision, reason_code, latency_us, and optional proof_bundle/proof_error
  • create_governor(policy=None) exposes the same govern inputs plus keyword-only action, evidence, request_id, boundary, and build_hash
  • verify_proof_v2(bundle, public_key) returns a structured verification result
  • action_digest(value) returns a stable canonical JSON digest
  • create_evaluator(policy=None)
    • Returns a policy-bound evaluator with evaluate(input_dict), which returns decision and reason_code

Reference docs

See the root repository docs for full protocol details:

  • spec/icd.md
  • spec/proof-v2.md and spec/schemas/proof-v2.json
  • spec/schemas/proof.json (legacy)
  • verify/

Metadata

Release files for vella-sdk 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vella-sdk 2.0.0
File Size Uploaded
vella_sdk-2.0.0.tar.gz 17.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vella-sdk 2.0.0
File Interpreter ABI Platform
vella_sdk-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.1 kB

Release files / vella_sdk-2.0.0.tar.gz

Download URL vella_sdk-2.0.0.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f2b50c139062ce82b283ed1b831f7f9bd700386480658146ac0d69e1486421bc
BLAKE2b-256 checksum
How to use checksums
279baeb35f55b231a83f2e8077997fa7e1f4ad409fbc44db621abaa3beef6234
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / vella_sdk-2.0.0-py3-none-any.whl

Download URL vella_sdk-2.0.0-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
755417542341ffddc48535fa6d66d3a15d03ed62812a2cbad164ddf6d33dbff1
BLAKE2b-256 checksum
How to use checksums
06fbe8f339258b2f0a1c6cc06f05b7362048fb812ee20b1cb1a1f3823eafdd3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

2.1.0

2 release files

This release

2.0.0 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page