Skip to main content

Chitmark SDK for Python

Use Chitmark from a Python backend to screen costly actions, recognize enrolled agents with signed proof, and manage paid API access.

PyPI version

Install

Requires Python 3.10 or later. The package provides a typed, synchronous client.

python -m pip install chitmark

Create a scoped API key in the Chitmark dashboard and set CHITMARK_API_KEY in your server environment.

Resolve agent attribution

Use a key with attribution:read. Replace the sample request with the inbound request from your server.

import os

import httpx

from chitmark import Chitmark

request = httpx.Request("GET", "https://app.example.com/agent-task")
with Chitmark(api_key=os.environ["CHITMARK_API_KEY"]) as client:
    result = client.attribution.resolve(request=request)

print(result["identity"]["recognized"], result["principal"]["email"])

The SDK reads fresh signed evidence from Chitmark-Agent-Proof. Without evidence, the sample returns an unknown identity and null email. An enrolled agent can sign for different recipients in a network-enabled deployment. Each site receives its own subject, and principal claims require a current grant for the recipient and purpose. Email also requires consent, attribution:email, and raw mode on an eligible plan.

For relative request URLs, pass your configured HTTPS origin as site. See the Attribution quickstart and network proof guide.

Screen a signup

Use a key with verify:write. Generate and retain a session ID on your server for the attempt.

import os
from uuid import uuid4

from chitmark import Chitmark, is_eligible_allow

with Chitmark(api_key=os.environ["CHITMARK_API_KEY"]) as client:
    verdict = client.verify(
        action="signup",
        session=str(uuid4()),
        surface="app.example.com/signup",
        subject={"email": "buyer@example.com"},
    )

print(verdict["decision"], is_eligible_allow(verdict), verdict["eventId"])

Grant value only after an explicit, non-degraded allow. Timeouts and transport failures on verify produce a degraded challenge. The default data mode hashes email before sending it. Store the returned eventId for outcome reporting.

Method Use
verify Get an allow, challenge, or deny verdict.
challenge / complete_challenge Issue and complete an additional check. Reuse the attempt's session.
feedback Report an outcome against the stored eventId with a feedback:write key.
verify_verdict_token Verify a signed receipt against the expected session and tenant. Install chitmark[verdict] for receipt verification.

See the Trust Decisions quickstart, Python SDK reference, and verdict token guide.

Agent Paid Access

Use client.charge(request) to request a quote, continue checkout, or read purchase status. Sellers use separate scopes to reserve execution and record delivery. See the Agent Paid Access guide.

License

Proprietary. The distribution includes the license terms in LICENSE.

Metadata

Release files for chitmark 0.9.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 chitmark 0.9.0
File Size Uploaded Provenance Actions
chitmark-0.9.0.tar.gz 33.5 kB Without provenance Details for chitmark-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chitmark 0.9.0
File Interpreter ABI Platform Actions
chitmark-0.9.0-py3-none-any.whl Python 3 none any Details for chitmark-0.9.0-py3-none-any.whl

Total release size: 58.6 kB

Release files / chitmark-0.9.0.tar.gz

Download URL chitmark-0.9.0.tar.gz
Size 33.5 kB
Tags Source
SHA-256 checksum
How to use checksums
601f4fc7a480888585ffcd4b3ed3017f8478322c5dcebf1c55fd5014537f12b7
BLAKE2b-256 checksum
How to use checksums
4451cb6f60a40f708fbea5e077f71ca28896f8d8753856d071fd708a2427b2ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / chitmark-0.9.0-py3-none-any.whl

Download URL chitmark-0.9.0-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89ed830c0a6cab000ee319ee7cb26229fd53cd3a6e14578108526055812e56f6
BLAKE2b-256 checksum
How to use checksums
757af779ea5b70f36fe6dfa50c802f1994b5f05aa18a4d109bb6c1919a138c9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for chitmark 0.9.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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