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) and workspaces (workspaces, create_workspace, update_workspace, delete_workspace). 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 waits for the owner's approval unless the owner trusts the recipients.
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).
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
Sealed handoff — no link at all
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.