Skip to main content

ProofTask SDK for Python

pip install prooftask

ProofTask keeps verifiable acceptance records: the agreed criteria, the exact delivered versions and the buyer's explicit decision, signed by the issuer and checkable offline. What a verifiable acceptance record is · Developer documentation · Sandbox

A client for the Agent API, generated from its OpenAPI contract, plus webhook signature verification, idempotent request IDs, pagination and typed errors. Standard library only, Python 3.9 or later.

Offline record verification: prooftask.conformity. An independent verifier for Conformity 1.0, 1.1 and 1.2 records, written from the published specification and the implementer's guide, not ported from the JavaScript verifier. It passes the whole conformance suite. Ed25519 verification is a pure-Python RFC 8032 implementation tested against the RFC vectors, so the package stays dependency-free.

from prooftask.conformity import verify_record
report = verify_record(open("record.json", "rb").read(), {"issuers": {"https://issuer.example": [
    {"id": "key-1", "publicKeyPem": PEM, "status": "ACTIVE"}]}})
print(report["status"], report["reasons"])   # INVALID, INDETERMINATE, PARTIAL_DISCLOSURE or VERIFIED_WITH_LIMITATIONS

or python -m prooftask.conformity ARTIFACT TRUST [OPTIONS.json] (exit 0 verified, 1 INVALID, 3 INDETERMINATE, 2 usage). You supply the trusted issuer keys; the verifier never fetches them. Not implemented: anchoring evidence (evidence/, trusted timestamps and Bitcoin proofs, package standard 1.2). A 1.1 package that carries it raises UnsupportedEvidence (CLI exit 2) instead of being reported without it; use the Node.js verifier (verify-conformity.mjs: node verify-conformity.mjs RECORD [TRUST]) for those. The ProofTask product record wrapper (prooftask-result-record-*.json, with the product trust bundle) is also Node.js only.

Quickstart

from prooftask import ProofTaskClient, new_request_id, construct_webhook_event

client = ProofTaskClient(token=os.environ["PROOFTASK_AGENT_TOKEN"])
me = client.get_agent()
project = client.get_project(id="delivery_...")["project"]

# Save the whole body (with its request ID) before sending. After an uncertain result, resend it unchanged.
body = {"requestId": new_request_id(), "target": "https://example.com/hooks/prooftask", "projectIds": [project["taskId"]],
        "eventTypes": ["acceptance.decided"], "expiresAt": "2026-12-20T00:00:00.000Z", "confirmed": True}
created = client.create_project_webhook(body=body)

examples/quickstart.py also runs a receiver and verifies a signed test request. The repository's test suite runs it against a local ProofTask server.

Methods

Every operation is a method named after its operationId in snake_case, with keyword arguments: path and query parameters in snake_case (subscription_id, project_id) and the JSON request body. Request and response shapes are TypedDicts in prooftask.types.

Retries, pagination, errors

  • Network failures, timeouts, 429 and 503 are retried (two retries by default). A write is retried only when its body carries a requestId, with the exact same bytes. ProofTaskTransportError.outcome_unknown means: resend the saved body.
  • client.iterate_webhook_deliveries(subscription_id=...) yields every page and follows next; paginate() is generic.
  • Non-success answers raise BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, RateLimitError or ServiceUnavailableError, all ProofTaskApiError with status, code, next_action, field, detail, reason and human_url.

Webhooks

hook = construct_webhook_event(secret, raw_body, request_headers)  # raises WebhookVerificationError
if hook.is_test:
    return  # acknowledge test requests, do not act on them

Pass the exact raw body bytes. The signature is v1= + hex HMAC-SHA256 of timestamp + "." + raw body, compared with hmac.compare_digest; the timestamp must be within five minutes.

Development

Source: cognitive-emergence/prooftask-sdk, a read-only copy synced from ProofTask's main repository. src/prooftask/_generated_*.py are generated from the Agent API contract; never edit them. python3 -I tests/test_sdk.py and python3 -I tests/test_conformity.py run the unit tests. Report problems through ProofTask support.

Changelog

  • 0.1.1: the source is public at cognitive-emergence/prooftask-sdk, and the project's Source URL points there. Updated README and project metadata; the unit tests also run outside the ProofTask repository. No API change.
  • 0.1.0: first release.

License

Apache License, Version 2.0. See LICENSE. Only the SDKs and the offline verifier are open source; the ProofTask service is proprietary.

Metadata

Release files for prooftask 0.1.1

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

Source distribution (sdist)

Source distribution for prooftask 0.1.1
File Size Uploaded Provenance Actions
prooftask-0.1.1.tar.gz 68.3 kB Without provenance Details for prooftask-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 149.3 kB

Release files / prooftask-0.1.1.tar.gz

Download URL prooftask-0.1.1.tar.gz
Size 68.3 kB
Tags Source
SHA-256 checksum
How to use checksums
76ba6571f7e784204e959d9268e776e0699a5948afd102d3e9cbba2d622f4e56
BLAKE2b-256 checksum
How to use checksums
8e1395b2eec46eadcfd2b03ac8de403a45e98620420d470005168ec885d75e39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / prooftask-0.1.1-py3-none-any.whl

Download URL prooftask-0.1.1-py3-none-any.whl
Size 81.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
523f7e27ae6c871652bc92d7147fd9653a6788168b2ef4b94e7b1784363ae7a8
BLAKE2b-256 checksum
How to use checksums
cc3311775fe3d52c82c5cff3fc26b8232d1133ed0a8d6c282d088214c06bda2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for prooftask 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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