Skip to main content

Send an AI workflow's run evidence to Veracity for verification.

Project description

veracity-connect-python

veracity-connect sends an AI workflow's run evidence to Veracity for verification.

This is the standalone Python SDK package for Veracity Connect.

Install

After the package is published to PyPI:

pip install veracity-connect

For optional integrations:

pip install "veracity-connect[langchain]"
pip install "veracity-connect[otel]"

If you need the current unreleased main branch:

pip install "veracity-connect @ git+https://github.com/nardosstem/veracity-connect-python.git@main"

Quick Start

This is a reference example for a common SQL-backed workflow. The SDK is not limited to this shape: create a VeracityRun, attach the evidence your workflow used, record the tool calls you want verified, set the artifact your workflow produced, and send the run to Veracity.

from veracity_connect import VeracityClient, VeracityRun

client = VeracityClient(
    base_url="https://app.veracity.example",
    pairing_token="vrc_...",
)

run = VeracityRun(
    agent_name="acme-finance-agent",
    framework="langgraph",
)
run.attach_source("financials.csv")
run.record_sql("SELECT SUM(revenue) AS total_revenue FROM financials", output=[{"total_revenue": 240000}])
run.set_artifact(rendered="Total revenue was $240,000.")
receipt = client.send(run, prompt="Summarize revenue.")

You can also load connection settings from the environment:

export VERACITY_BASE_URL="https://app.veracity.example"
export VERACITY_PAIRING_TOKEN="vrc_..."
from veracity_connect import VeracityClient

client = VeracityClient.from_env()

What To Record

attach_source(...) accepts source files or inline content. CSV sources are sent as text; Excel, SQLite, and DuckDB files are sent as encoded file content.

record_sql(...) records SQL tool calls and their outputs for replay/verification. If your workflow is already instrumented, the optional OpenTelemetry and LangChain integrations can collect supported tool calls for you.

set_artifact(...) records the final output Veracity should check, either as rendered text, an Excel workbook, or both.

Envelope Contract

The SDK sends an Agent-Run Evidence Envelope to POST /workspace/api/agent-runs/ingest with the pairing token in the X-Veracity-Pairing-Token header. The token is never serialized into the JSON payload.

payload = run.to_dict()
payload_json = run.to_json()
restored = VeracityRun.from_dict(payload)

Supported source types are csv, excel, sqlite, and duckdb. JSON sources are rejected until backend replay support exists.

Development

python -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
python -m pip install -e ".[dev]"
python -m pytest
python -m build
python -m twine check dist/*

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

veracity_connect-0.1.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

veracity_connect-0.1.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file veracity_connect-0.1.0.tar.gz.

File metadata

  • Download URL: veracity_connect-0.1.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for veracity_connect-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c48b926c6250c96ece7cd9170d6b0ac3a4ff06862893c72b38e238268c0f1aee
MD5 9ae9dc96befce5325926141075eb3d90
BLAKE2b-256 b3bb7d933f88fdd02f29fd21b917c891107dbdbb03b1922908d0a45b027168f9

See more details on using hashes here.

File details

Details for the file veracity_connect-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for veracity_connect-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed76c0e6b7441d765b4d0a92d74986760c9087da7b1ffef4bd8e59af1ad3f1f2
MD5 997f134d5ba59cd46b9fbedcf46ea691
BLAKE2b-256 a407ce84e6119767b9d8060d34f2b290adcdbdfda18e4fe212e7f7879dcc7574

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