Skip to main content

Python API reference

This inventory is generated from the package's public export surface. Unknown or internal symbols are deliberately excluded.

  • __version__ โ€” Constant. Public __version__ constant.
  • ACCOUNT_TOKEN_LOCKS โ€” Constant. Public ACCOUNT_TOKEN_LOCKS constant.
  • AccountRefreshResult โ€” Class. What a refresh did, without the Account Token itself.
  • AccountRevocationResult โ€” Class. A revocation the company acknowledged; the local copy is gone.
  • AccountTokenClient โ€” Class. Use a stored Account Token without ever handing it to a caller.
  • AccountTokenContext โ€” Class. Where an Account Token is used, and for whom (all non-secret).
  • AccountTokenLock โ€” Class. Serialize every use of one Account Token (PAP ยง4.8 rotation).
  • AgentIdentityClient โ€” Class. Fetch and verify a personal agent's public identity documents.
  • ApiClient โ€” Class. Read and change through a company's API, the credentials host-owned.
  • ApiError โ€” Class. The company refused an API call; code is its error, never its body.
  • ApiResponse โ€” Class. A successful API answer: the body, or the operation it proposes.
  • APPROVAL_SURFACES โ€” Constant. Public APPROVAL_SURFACES constant.
  • ApprovalRequest โ€” Class. A live-session action that changes or ends what the user holds, to approve first.
  • ApprovalSurface โ€” Class. The host's own approval surface: the user, not a model, answers.
  • approve โ€” Function. Record the user's approval of the revision the host just showed them.
  • ApprovedUrl โ€” Class. A URL the safety policy approved, and the addresses it approved for its host.
  • AUTHORIZATION_STATE_STORES โ€” Constant. Public AUTHORIZATION_STATE_STORES constant.
  • AuthorizationCodeGrant โ€” Class. Redacted PAP authorization-code exchange values.
  • AuthorizationError โ€” Class. An authorization flow failed without exposing callback secrets.
  • AuthorizationStateStore โ€” Class. Persist and atomically consume short-lived authorization state.
  • BROWSER_ASSERTION_TYPE โ€” Constant. Public BROWSER_ASSERTION_TYPE constant.
  • BROWSER_FORM_POSTS โ€” Constant. Public BROWSER_FORM_POSTS constant.
  • BROWSER_HANDOFFS โ€” Constant. Public BROWSER_HANDOFFS constant.
  • BrowserAssertionClaims โ€” Class. Claims that bind a controlled browser to one PAP Session.
  • BrowserAssertionReplayCache โ€” Class. Public BrowserAssertionReplayCache class.
  • BrowserFormPost โ€” Class. Submit protected fields as a controlled top-level browser navigation.
  • BrowserHandoff โ€” Class. Hand a human-only authorization URL to a trusted browser surface.
  • BrowserSessionClient โ€” Class. Sign and POST a browser assertion without putting it in a URL.
  • BrowserSessionError โ€” Class. A browser-session handoff or assertion failed safely.
  • BrowserSessionStart โ€” Class. Safe status after a controlled form POST has started.
  • build_browser_assertion_claims โ€” Function. Build unsigned PAP section 5 claims for protected signing.
  • build_direct_sign_in_request โ€” Function. Build a user-browser authorization URL with random state and S256 PKCE.
  • build_pap_reactor โ€” Function. Build a PAP Reactor host with plugins and return any HTTP client it owns.
  • build_session_assertion_claims โ€” Function. Build unsigned PAP 4.2 claims; a key-custody provider signs them.
  • CACHES โ€” Constant. Public CACHES constant.
  • ClientMetadata โ€” Class. Public ClientMetadata class.
  • Clock โ€” Class. Supply timezone-aware wall-clock time to expiring protocol state.
  • CLOCKS โ€” Constant. Public CLOCKS constant.
  • ConfirmOutcome โ€” Class. What a confirmation did.
  • ConversationClient โ€” Class. Start and continue PAP conversations through a proof-bound transport.
  • ConversationError โ€” Class. A PAP conversation request failed without exposing its body.
  • ConversationEvent โ€” Class. One ordered PAP conversation event, including unknown future types.
  • ConversationEventPage โ€” Class. A cursor page returned by a PAP conversation read or waited write.
  • ConversationReceipt โ€” Class. State returned after a message when the caller does not wait for events.
  • ConversationResponse โ€” Constant. Public ConversationResponse constant.
  • covers โ€” Function. Whether a standing permission covers this revision, term by term.
  • create_resolving_client โ€” Function. An httpx client whose every request goes through a ResolvingTransport.
  • CursorExpiredHandler โ€” Constant. Public CursorExpiredHandler constant.
  • DEVICE_CODE_GRANT โ€” Constant. Public DEVICE_CODE_GRANT constant.
  • DeviceAuthorizationResponse โ€” Class. Validated response from the OAuth device authorization endpoint.
  • DeviceSignInClient โ€” Class. Start and poll PAP Device Sign-In without exposing the device code.
  • DeviceSignInPoll โ€” Class. One poll result; pending responses tell callers when to try again.
  • DeviceSignInStart โ€” Class. User-facing device instructions without the private device code.
  • DirectSignInCallback โ€” Class. Validated one-time authorization code.
  • DirectSignInClient โ€” Class. Orchestrate one-use browser authorization and proof-bound code exchange.
  • DirectSignInRequest โ€” Class. Authorization request state that redacts its URL and PKCE values.
  • DirectSignInResult โ€” Class. Signed-in Session plus any scopes the company did not grant.
  • DirectSignInStart โ€” Class. Non-secret status returned after handing authorization to the user.
  • DiscoveredCompany โ€” Class. Public DiscoveredCompany class.
  • DISCOVERY_TRANSPORTS โ€” Constant. Public DISCOVERY_TRANSPORTS constant.
  • DiscoveryClient โ€” Class. Discover and authenticate a company's PAP declaration.
  • DiscoveryDocument โ€” Class. Public DiscoveryDocument class.
  • DiscoveryError โ€” Class. Discovery could not be completed safely.
  • DPOP_PROOF_PROVIDERS โ€” Constant. Public DPOP_PROOF_PROVIDERS constant.
  • DpopHttpClient โ€” Class. Send replay-safe DPoP requests without forwarding credentials across origins.
  • DpopKeyMaterial โ€” Class. Private signing handle and separately exportable public JWK.
  • DpopProofProvider โ€” Class. Create a fresh DPoP proof while keeping its private key protected.
  • DpopProofRequest โ€” Class. Inputs for one fresh proof-of-possession JWT.
  • DpopReplayCache โ€” Class. Atomically remember a proof ID until its acceptance window ends.
  • FINAL_STATES โ€” Constant. Public FINAL_STATES constant.
  • generate_message_id โ€” Function. Generate a user-global message ID with at least 128 random bits.
  • generate_pairwise_user_id โ€” Function. Generate a non-PII user ID to persist for one user/company issuer pair.
  • IdentityError โ€” Class. Personal-agent metadata or public keys could not be verified safely.
  • InMemoryProtocolCache โ€” Class. Default pap.cache: a bounded, least-recently-used map in one process.
  • InMemoryStandingPermissionStore โ€” Class. A single-process store of standing permissions, for examples and tests.
  • InProcessAccountTokenLock โ€” Class. Default Account Token lock for a single process.
  • JoseAlgorithm โ€” Constant. Public JoseAlgorithm constant.
  • JoseDpopProofProvider โ€” Class. Create fresh RFC 9449 proofs using per-user/company key material.
  • JoseSigner โ€” Class. Sign PAP assertions with an injected asymmetric private key or handle.
  • JsonWebKey โ€” Class. One asymmetric public signing key published by a personal agent.
  • JsonWebKeySet โ€” Class. A non-empty set of public keys suitable for PAP assertion verification.
  • JWT_BEARER_GRANT โ€” Constant. Public JWT_BEARER_GRANT constant.
  • JWT_CLIENT_ASSERTION โ€” Constant. Public JWT_CLIENT_ASSERTION constant.
  • MediatedSignInClient โ€” Class. Relay a user's credentials to the company's mediated endpoint, once.
  • MediatedSignInResult โ€” Class. Where a Mediated Sign-In stands, without any credential.
  • Message โ€” Class. Message sent by either side or returned in a conversation event.
  • MetadataFetch โ€” Class. The bounds of one public metadata fetch: size, total time, approved addresses.
  • OAuthServerMetadata โ€” Class. Public OAuthServerMetadata class.
  • openapi_url โ€” Function. The company's OpenAPI description, when it advertises one.
  • OpenTelemetrySink โ€” Class. pap.telemetry as OpenTelemetry spans, one per event, under the current span.
  • Operation โ€” Class. Public Operation class.
  • OperationConfirmation โ€” Class. Public OperationConfirmation class.
  • OperationError โ€” Class. An operation could not be read, confirmed, or cancelled.
  • OperationResult โ€” Class. Public OperationResult class.
  • operations_endpoint โ€” Function. The company's operations endpoint when both sides list version 1, else None.
  • OPERATIONS_EXTENSION โ€” Constant. Public OPERATIONS_EXTENSION constant.
  • OPERATIONS_VERSION โ€” Constant. Public OPERATIONS_VERSION constant.
  • OperationsClient โ€” Class. Read, confirm, and cancel operations at a negotiated endpoint.
  • PAIRWISE_USER_ID_STORES โ€” Constant. Public PAIRWISE_USER_ID_STORES constant.
  • PairwiseUserIdStore โ€” Class. Persist stable random identities by tenant, local user, and issuer.
  • PapCorePlugin โ€” Class. Contribute PAP's secure defaults through Reactor.
  • PersonalAgentProtocolError โ€” Class. Base error whose string representation never includes response bodies.
  • pin_connections โ€” Function. Make client's socket transports dial approved addresses during metadata fetches.
  • PinnedNetworkBackend โ€” Class. Dial the address the URL safety policy approved, never the host name again.
  • ProofError โ€” Class. A signed assertion or proof-of-possession value is invalid.
  • PROTECTED_INPUTS โ€” Constant. Public PROTECTED_INPUTS constant.
  • ProtectedInput โ€” Class. Collect protected values from the user outside model context (PAP ยง4.7).
  • ProtectedInputField โ€” Class. One field a human types into the host's own trusted surface.
  • ProtectedInputRequest โ€” Class. What the host must ask the user for, and for which company.
  • PROTOCOL_PROFILE โ€” Constant. Public PROTOCOL_PROFILE constant.
  • PROTOCOL_REVISION โ€” Constant. Public PROTOCOL_REVISION constant.
  • ProtocolCache โ€” Class. Bound cached public protocol data by an absolute expiry.
  • ProtocolValidationError โ€” Class. A protocol document is malformed or internally inconsistent.
  • RANDOM_SOURCES โ€” Constant. Public RANDOM_SOURCES constant.
  • RandomSource โ€” Class. Supply cryptographically secure random bytes.
  • RATE_LIMIT_BUDGETS โ€” Constant. Public RATE_LIMIT_BUDGETS constant.
  • RateLimitBudget โ€” Class. A company's request budget, shared by every task and user of the host.
  • RecordingTelemetrySink โ€” Class. pap.telemetry in memory: every event, in order.
  • REFRESH_TOKEN_GRANT โ€” Constant. Public REFRESH_TOKEN_GRANT constant.
  • resolve_pairwise_user_id โ€” Function. Resolve the active Reactor store and return its stable pairwise ID.
  • ResolvingTransport โ€” Class. Every request to an untrusted host resolved, vetted, and pinned.
  • RETRY_POLICIES โ€” Constant. Public RETRY_POLICIES constant.
  • RetryPolicy โ€” Class. When to retry a refused request (Guides, retries).
  • SessionAssertionClaims โ€” Class. Claims signed by the personal agent when starting or renewing a session.
  • SessionClient โ€” Class. Start and renew signed-out PAP sessions over the OAuth token endpoint.
  • SessionError โ€” Class. A session request failed without exposing response secrets.
  • SessionGrant โ€” Class. Redacted form values for a PAP JWT-bearer session request.
  • SessionToken โ€” Class. Opaque token response returned by a PAP company.
  • SharedRateLimitBudget โ€” Class. Default pap.rateLimitBudget: per-company budgets in one process.
  • Signer โ€” Class. Sign a compact assertion without exposing private key material.
  • SIGNERS โ€” Constant. Public SIGNERS constant.
  • SqlitePairwiseUserIdStore โ€” Class. Atomically persist random pairwise IDs in a local SQLite database.
  • STANDING_PERMISSION_STORES โ€” Constant. Public STANDING_PERMISSION_STORES constant.
  • StandingPermission โ€” Class. What the user allowed in advance: one company, account, and action.
  • StandingPermissionRequest โ€” Class. Public StandingPermissionRequest class.
  • StandingPermissionStore โ€” Class. Reserve, commit, and release uses of standing permissions.
  • StreamItem โ€” Constant. Public StreamItem constant.
  • StreamReconnected โ€” Class. The stream was reopened from Last-Event-ID.
  • SystemClock โ€” Class. Default UTC wall clock.
  • SystemRandomSource โ€” Class. Default operating-system cryptographic randomness.
  • TELEMETRY_ATTRIBUTES โ€” Constant. Public TELEMETRY_ATTRIBUTES constant.
  • TELEMETRY_EVENTS โ€” Constant. Public TELEMETRY_EVENTS constant.
  • TELEMETRY_SINKS โ€” Constant. Public TELEMETRY_SINKS constant.
  • TelemetryEvent โ€” Class. One finished protocol stage: a span for traces, an event for analytics.
  • TelemetrySink โ€” Class. Receive each finished protocol stage (telemetry.TelemetryEvent), redacted already.
  • TermLimit โ€” Class. A bound on one term, named by its dotted path in terms.
  • terms_digest โ€” Function. A digest of exactly what a revision says: its summary and its terms.
  • TextDelta โ€” Class. A piece of a message still being written (SSE text-delta, ยง7.6).
  • TOKEN_STORES โ€” Constant. Public TOKEN_STORES constant.
  • TokenStore โ€” Class. Keep credentials behind opaque references and explicit deletion.
  • TransportError โ€” Class. An authenticated PAP resource request failed safely.
  • URL_SAFETY_POLICIES โ€” Constant. Public URL_SAFETY_POLICIES constant.
  • UserApproval โ€” Class. The user approved this revision, as it was shown to them.
  • validate_direct_sign_in_callback โ€” Function. Validate redirect location, state, and issuer before exposing the code.
  • VerifiedBrowserAssertion โ€” Class. Public VerifiedBrowserAssertion class.
  • VerifiedDpopProof โ€” Class. Safe identity of a verified, newly accepted DPoP proof.
  • verify_browser_assertion โ€” Function. Verify type, signature, bindings, lifetime, return target, and replay.
  • verify_dpop_proof โ€” Function. Verify signature, binding, freshness, nonce, token hash, and replay state.