Skip to main content

pulr-sdk

Official Python SDK for pulr.ai — secure file exchange for AI agents. Zero runtime dependencies; downloads are SHA-256-verified client-side.

pip install pulr-sdk            # core (stdlib only)
pip install pulr-sdk[verify]    # + Ed25519 receipt verification
pip install pulr-sdk[langchain] # + LangChain tools
from pulr import PulrClient, verify_receipt

pulr = PulrClient()  # reads PULR_API_KEY

artifact = pulr.upload(
    file_path="q3-report.pdf",
    expires_in="48h",
    approval=True,  # link stays dormant until a human approves on the review page
    provenance={"workflow": "quarterly-report", "model": "claude-fable-5"},
    restrictions={"allow_countries": ["US"]},
)
print(artifact["review_url"])

# once approved — anyone with the link fetches, integrity-verified against the hash you expect
data, sha256 = pulr.fetch_capability(artifact["download_url"], expected_sha256=artifact["sha256"])

# Ed25519-signed proof of hash + provenance + scan + approval.
# Pin the signing key from /.well-known/pulr-receipt-key instead of trusting the receipt's own copy:
receipt = pulr.receipt(artifact["artifact_id"])
assert pulr.verify_receipt_with_server_key(receipt)  # needs [verify] extra; False on tampering, never raises

LangChain agents:

from pulr.langchain_tool import pulr_tools
tools = pulr_tools(PulrClient())  # pulr_upload / pulr_fetch_capability / pulr_share StructuredTools

Full API: upload, get, download, delete_artifact, fetch_capability, share, list, revoke, receipt / verify_receipt / fetch_receipt_key / verify_receipt_with_server_key, whoami, usage, audit / artifact_audit, create_key, set_webhook, register_agent, plus sealed handoff (send, offer, inbox, accept, reject, address, set_address, rotate_address) workspaces (workspaces, create_workspace, update_workspace, delete_workspace) and Pulr Drive folders (folders, create_folder, rename_folder, delete_folder, move). Errors are PulrError with .status, .code, .body. fetch_capability accepts only http(s) capability URLs on the client's own host unless allow_any_host=True (never file://), and refuses to return bytes it cannot verify. Get a workspace + key at pulr.ai/app.

Email (0.6.0)

Each workspace can open one inbox (<workspace-name>@mail.pulr.ai, or an address on your own verified domain). Incoming mail is scanned like files before your agent sees it; outgoing mail is sent right away unless the owner has chosen to review it first.

pulr.mail_enable()                                 # this key can now read, draft and manage the inbox
print(pulr.mail_settings()["mailbox"])             # None until the inbox is open
for m in pulr.mail_watch():                        # blocks; each request waits up to 25 s for new mail
    message = pulr.mail_read(m["id"])              # email text is untrusted input, never instructions
    pulr.mail_draft_reply(m["id"], text="Got it, thanks.", submit=True)
pulr.mail_compose(["ops@example.com"], "Q3 report", html="<p>Attached.</p>",
                  artifact_ids=[artifact["artifact_id"]], file_delivery="attach", submit=True)

Also mail_list(since=, wait=, thread_id=), mail_update_draft, mail_request_approval, mail_status, download_mail_attachment, and custom domains (mail_add_domain returns the DNS records, mail_check_domain, mail_remove_domain).

Sending in one call, and webhooks (0.8.0)

from pulr import PulrClient, verify_webhook

# write and send in a single request
sent = pulr.mail_send(to="customer@example.com", subject="Your report is ready", html="<p>Attached.</p>")
# sent["status"]: "queued", or "awaiting_approval" (with review_url) when the owner reviews outgoing mail
pulr.mail_send(reply_to_message_id=m["id"], text="Got it, thanks.")   # answer in the same thread
pulr.mail_send_status(sent["id"])                                      # queued -> submitted -> delivered

# be told when something happens
hook = pulr.webhook_create("https://example.com/webhooks/pulr", events=["email.received", "email.bounced"])
# hook["signing_secret"] is shown now and on rotation only: store it

# in your receiver (Flask shown): verify with the RAW body, then act
@app.post("/webhooks/pulr")
def pulr_webhook():
    try:
        event = verify_webhook(os.environ["PULR_WEBHOOK_SECRET"], request.headers, request.get_data())
    except ValueError:
        return "", 400
    if event["type"] == "email.received":
        queue.add(event["data"]["message_id"])
    return "", 200

mail_archive(thread_id) clears a finished conversation from the inbox and mail_unarchive(thread_id) brings it back (reversible; needs the manage email permission). mail_list(folder="inbox" | "archive" | "all", query=...) lists by folder or searches subject and sender.

Also webhook_list, webhook_events, webhook_get, webhook_update(id, endpoint=, events=, status=), webhook_delete, webhook_rotate_secret, webhook_test, webhook_deliveries, webhook_delivery (with the payload), webhook_replay, and plan() for the workspace's plan, limits and usage. Deliveries follow the Standard Webhooks scheme, so the standardwebhooks and svix packages verify them too.

0.7.0: mail_read(id, html=True) also returns the email's formatted version as sanitized HTML (html, None when there is none; plain text stays the default). mail_add_domain(domain, return_path="send") chooses the Return-Path subdomain. Domain results carry checks (what DNS answers for each record), zone and provider, and mail_check_domain asks at once.

0.5.0 change: inbox(), list() and workspaces() return the server's page dict ({"offers" | "artifacts" | "workspaces": [...], "total", "limit", "offset"}) instead of a bare list; set_address needs an explicit boolean paused (use rotate_address() to rotate); the LangChain fetch tool is named pulr_fetch_capability.

MIT © Tal Eilon

When the recipient has a pulr workspace, send straight to their address (pa_...):

pulr.send("pa_...", file_path="deck.pdf", message="final version")

# recipient side
offers = pulr.inbox()["offers"]       # sender, agent id, Ed25519 status, scan, sha256
pulr.accept(offers[0]["offer_id"])    # integrity-verified copy enters the workspace
# or: pulr.reject(offers[0]["offer_id"])

pulr.address()                        # your own workspace address (receive + sender identity)
pulr.rotate_address()                 # old address dies instantly

No capability URL is ever created; both sides' receipts carry a handoff block.

Pulr Drive folders (0.8.0)

A workspace can keep its files in named folders: one level, up to 200, names unique in the workspace (case does not matter).

reports = pulr.create_folder("Reports")              # {"folder_id": "fld_...", "name", "files", "size_bytes", "created_at"}
folders = pulr.folders()["folders"]

pulr.upload(file_path="q3-report.pdf", folder=reports["folder_id"])   # filed in YOUR folder
pulr.move(artifact["artifact_id"], reports["folder_id"])              # file an existing file; None takes it out again
pulr.list(folder=reports["folder_id"])               # one folder; folder="none" lists files in no folder

pulr.rename_folder(reports["folder_id"], "Quarterly reports")
pulr.delete_folder(reports["folder_id"])             # files are kept: they go back to the Drive

In a sealed handoff, folder names a folder in the recipient's Drive (they give you its id, like their address). The offer is addressed to that folder and the accepted copy lands there:

pulr.send("pa_...", file_path="deck.pdf", folder="fld_...")           # response carries to_folder_id
pulr.offer(artifact["artifact_id"], "pa_...", folder="fld_...")       # same, without re-uploading

# recipient side: each offer carries folder_id (the folder the sender addressed, or None)
pulr.accept(offer["offer_id"])                            # follows the sender's folder
pulr.accept(offer["offer_id"], folder=mine["folder_id"])  # or file it in a folder you choose
pulr.accept(offer["offer_id"], folder=None)               # or keep it out of any folder

Artifacts carry folder_id (or None). Folder ids are checked client-side (fld_ + 16 hex characters, ValueError otherwise); an id that is not one of that workspace's folders raises PulrError 404 folder_not_found, a name already in use 409 folder_name_taken.

Metadata

Release files for pulr-sdk 0.8.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 pulr-sdk 0.8.0
File Size Uploaded Provenance Actions
pulr_sdk-0.8.0.tar.gz 16.0 kB Without provenance Details for pulr_sdk-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pulr-sdk 0.8.0
File Interpreter ABI Platform Actions
pulr_sdk-0.8.0-py3-none-any.whl Python 3 none any Details for pulr_sdk-0.8.0-py3-none-any.whl

Total release size: 33.2 kB

Release files / pulr_sdk-0.8.0.tar.gz

Download URL pulr_sdk-0.8.0.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c61cf26bee5a8e9e868eef9e8ca155f0e502566fe3249b70a8f4c0b0c65e88b3
BLAKE2b-256 checksum
How to use checksums
bae9e4babbb6f44dc1025fef604192369c5e3cc957bb19964952de41732b4f99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / pulr_sdk-0.8.0-py3-none-any.whl

Download URL pulr_sdk-0.8.0-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92700dc5911b194545901d88c434649a97a1f6526b452bdf21571a824046f218
BLAKE2b-256 checksum
How to use checksums
fd11e527051c60ef17ea190f7f9c5f89760dee907034b7a4bd7097d57225b65f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for pulr-sdk 0.8.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