This release is a pre-release and may not be stable for production use.
Verdict Python SDK
PyPI distribution: cognifity-verdict. Python import: verdict.
The Verdict Python SDK. Auto-instruments your LLM calls via wrapt and
captures them into a vendor-neutral Trace schema (attribute names follow
the OpenTelemetry GenAI semantic conventions, but no OTel spans are emitted).
Traces are written to SQLite by default (or any Storage adapter). Content
capture (prompts/completions) is off by default — opt in with
capture_content=True; when enabled, captured content is run through built-in
pattern redaction recursively across supported JSON-compatible message and tool
structures before Trace assignment and again at storage. Card candidates use
Luhn validation; IPv6 candidates use standard-library address validation so
clock values such as 12:34:56 remain intact, and email candidates use a linear
@-anchored scanner so malformed or very long input cannot trigger regex
backtracking. Unsupported objects fail closed.
Traversal is bounded by node and character budgets, and cycles or repeated
container references fail closed at every occurrence so sanitized output never
retains caller-owned aliases. Redacted mapping-key collisions keep every value
under deterministic suffixed keys rather than overwriting one entry.
This is best-effort matching, not a compliance guarantee; keep content capture
off when its documented coverage is insufficient.
For a customer proof of concept, follow the versioned
0.1.0a4 POC release profile.
It pins the package set, provider entry points, persistence mode, and privacy
boundary used for release verification.
Supported streams finalize after full consumption, iteration error, explicit
close() / aclose(), context exit, or async cancellation. Garbage collection
of a never-iterated unclosed stream is not a persistence guarantee. A supported
instrumented provider call made inside a manual span records the innermost
span's ID in Trace.parent_span_id. This is the sole automatic direction because
multiple provider traces may share one manual span; automatic capture never
chooses one reverse SpanRecord.trace_id. Manual-only work can bind to an
existing stored trace with
trace_context(trace_id) or set_context(trace_id=...). An unknown explicit
trace ID is recorded as an unlinked span with a link-status attribute rather
than as an orphan; spans with no provider call or explicit context remain
standalone.
Provider SDK unset sentinels and other non-primitive numeric metadata are
normalized to unavailable (None) before a Trace reaches storage. A
synchronous telemetry persistence failure never replaces the provider call's
result or exception; Verdict emits one warning per provider, storage type, and
exception type instead of flooding application logs.
sample_rate controls the fraction of supported calls retained, and
buffered_writes=True moves persistence to a background batched writer. Stored
manual spans do not wait for provider acknowledgement or receive repair writes;
each ended span is persisted once independently of provider success. flush() is
a FIFO point-in-time barrier and accepts an optional timeout. close() rejects
new reads/writes, drains every accepted FIFO write, stops and joins the worker,
then closes the inner adapter; post-close flush() is an idempotent no-op.
The 0.1.0a4 POC profile uses buffered_writes=False. Buffered mode requires
an explicit shutdown() imported from verdict.client before process exit.
Completed drift analyses use atomic DriftRun snapshots, including explicit
zero-signal runs. Storage readers select a run marker and its exact signals from
one snapshot; deleting a matched attributed signal window removes the completed
run as a unit. prune_before()
removes expired standalone and orphan span rows while preserving an old span
referenced by a retained Trace. SQLite and PostgreSQL execute multi-table trace
deletion and pruning atomically and serialize concurrent trace writers while
they decide which shared parent spans must survive.
Stored costs are best-effort estimates from Verdict's dated static base-price table;
unknown models remain unpriced, and the values are not billing truth.
import verdict
from anthropic import Anthropic
verdict.init(service_name="my-app", storage="sqlite:///./verdict.db")
client = Anthropic()
# Use Anthropic normally — supported SDK calls are captured.
For 0.1.0a4, supported POC entry points are Anthropic
messages.create(...) (including stream=True), OpenAI
chat.completions.create(...) and its stream helper, and Google
models.generate_content(...) / generate_content_stream(...). Anthropic
messages.stream(...) and the OpenAI Responses API are not captured in this
release.
See the repository README for the full picture, the architecture decisions, and the examples.
Apache 2.0.
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 cognifity_verdict-0.1.0a4.tar.gz.
File metadata
- Download URL: cognifity_verdict-0.1.0a4.tar.gz
- Upload date:
- Size: 112.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
637c738d5046b419532777962a3570603f6af9ea2d53d84155dc22d258204b28
|
|
| MD5 |
43cf3da4180ca86a2728308e62834ef1
|
|
| BLAKE2b-256 |
9697da3bfb89e64560d468730338dd1b851ead767726ac4c37cef9350ad32fa0
|
Provenance
The following attestation bundles were made for cognifity_verdict-0.1.0a4.tar.gz:
Publisher:
publish.yml on cognifityai/verdict
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognifity_verdict-0.1.0a4.tar.gz -
Subject digest:
637c738d5046b419532777962a3570603f6af9ea2d53d84155dc22d258204b28 - Sigstore transparency entry: 2500738509
- Sigstore integration time:
-
Permalink:
cognifityai/verdict@49eae0a67d471b087d7c146c5abbd215e723f3ad -
Branch / Tag:
refs/tags/v0.1.0a4 - Owner: https://github.com/cognifityai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@49eae0a67d471b087d7c146c5abbd215e723f3ad -
Trigger Event:
release
-
Statement type:
File details
Details for the file cognifity_verdict-0.1.0a4-py3-none-any.whl.
File metadata
- Download URL: cognifity_verdict-0.1.0a4-py3-none-any.whl
- Upload date:
- Size: 78.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeceaa085c90c81b81a344515f721a30d117db63e6f0db5dac97894886dbb9d2
|
|
| MD5 |
9ec136a88e1708f75177e08b867aedb7
|
|
| BLAKE2b-256 |
491c14f0d150579366753c25606e027f52b5edaf33b796ae455a165b50b2421a
|
Provenance
The following attestation bundles were made for cognifity_verdict-0.1.0a4-py3-none-any.whl:
Publisher:
publish.yml on cognifityai/verdict
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognifity_verdict-0.1.0a4-py3-none-any.whl -
Subject digest:
eeceaa085c90c81b81a344515f721a30d117db63e6f0db5dac97894886dbb9d2 - Sigstore transparency entry: 2500738529
- Sigstore integration time:
-
Permalink:
cognifityai/verdict@49eae0a67d471b087d7c146c5abbd215e723f3ad -
Branch / Tag:
refs/tags/v0.1.0a4 - Owner: https://github.com/cognifityai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@49eae0a67d471b087d7c146c5abbd215e723f3ad -
Trigger Event:
release
-
Statement type: