Skip to main content

Planisphere — Python client

Official Python client for the Planisphere compliant-AI API. Gate an AI action before it executes, get a signed, offline-verifiable evidence receipt, and route what needs a human. Zero dependencies — standard library only.

pip install planisphere

Quickstart

from planisphere_sdk import Planisphere, PlanisphereNeedsReview, PlanisphereBlocked

ps = Planisphere(api_key="ps_live_...")   # or ps_test_ for a free sandbox key

decision = ps.gate(
    pack="law",
    proposed_action="File this motion with the court.",
    surface="agent",
    source_key="agent:run:42",
    law_context={"matter_band": "litigation", "tool_id": "harvey"},
    idempotency_key="run-42",   # safe to retry — returns the original result, meters once
)

if decision["decision"] == "allow":
    ...  # proceed, and keep decision["evidence_packet"] as your receipt

Prefer exceptions? require_allow raises unless the action is allowed:

try:
    ps.require_allow(pack="law", proposed_action="...", surface="agent",
                     source_key="agent:run:42", law_context={...})
    do_the_thing()
except PlanisphereNeedsReview as e:
    route_to_reviewer(e.decision)   # pause the workflow
except PlanisphereBlocked as e:
    stop(e.decision)                # hard stop

Verify a receipt

kit = ps.verify_kit()                       # how to verify offline
result = ps.verify(seal_verification_payload)  # or check server-side
record = ps.get_record("law:check-citations:...")  # fetch a stored evidence packet

Reviews

ps.record_review(action_key="law:...", reviewer="jane@firm.com", decision="approved")
queue = ps.review_queue(status="pending")

Errors

PlanisphereError (base) → PlanisphereAuthError (401/403), PlanisphereRateLimited (429, with .retry_after), plus the decision signals PlanisphereBlocked / PlanisphereNeedsReview (both carry .decision). Every error carries .status and the parsed .body.

Sandbox

Get a free ps_test_ key with no card at POST /signup/test-key. Sandbox receipts are signed with a non-production key (dev_key: true) so they can never be mistaken for production evidence. Upgrade in place by completing checkout with the same email.


Records, never certification. Planisphere US, Corp.

Metadata

Release files for planisphere 0.1.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 planisphere 0.1.0
File Size Uploaded
planisphere-0.1.0.tar.gz 5.1 kB Details

Built distribution (wheel)

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

Total release size: 10.4 kB

Release files / planisphere-0.1.0.tar.gz

Download URL planisphere-0.1.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e4f43bc1a62c866300bc7233e42a7ce56f91d5e004e6711de555ef0437ca07a9
BLAKE2b-256 checksum
How to use checksums
c7f97e1942741131c9dbdfbd9fe8fa350e2308ade8425dd199e1d41443e01b5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 22, 2026.

Transparency log

Release files / planisphere-0.1.0-py3-none-any.whl

Download URL planisphere-0.1.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2304340813fc0600d925b14d1ae6ac8b3e16fa7dd4bdda7481ef92c22fa0c417
BLAKE2b-256 checksum
How to use checksums
b132cb98e494be4b535822cc58280ef539a0b49f16c43a23e8f20d1cf29e494b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 22, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

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