View as Markdown

SDK reference · Python SDK

prov.mandate.grants

prov.mandate.grants in the Python SDK: 30 methods. The mandate.grants methods.

Methods

create

prov.mandate.grants.create(**body: Any = …) -> Any

Calls POST /v1/mandate/grants.

list

prov.mandate.grants.list(**query: Any = …) -> Any

Calls GET /v1/mandate/grants.

get

prov.mandate.grants.get(mandate_id: str) -> Any

Calls GET /v1/mandate/grants/{id}.

spend

prov.mandate.grants.spend(mandate_id: str, include_descendants: Optional[bool] = …, limit: Optional[int] = …, cursor: Optional[str] = …) -> Any

What the mandate spent, newest first (one entry per debit, with what caused it).

Calls GET /v1/mandate/grants/{id}/spend.

spend_summary

prov.mandate.grants.spend_summary(group_by: Optional[str] = …, window: Optional[str] = …, currency: Optional[str] = …) -> Any

What your agents spent under their grants in a window, per day and per group: by category of spend (the default) or by agent.

Calls GET /v1/mandate/spend_summary.

usual_spend

prov.mandate.grants.usual_spend(mandate_id: str) -> Any

The usual spend of the person who gave this grant, per category of spend: the median of their purchases over the last 90 days and whether it is a baseline (five or more).

Calls GET /v1/mandate/grants/{id}/usual_spend.

over_limit_settings

prov.mandate.grants.over_limit_settings() -> Any

The account's over-limit settings: what each lock does when a purchase goes past it.

Calls GET /v1/mandate/settings/delegation.

limits

prov.mandate.grants.limits() -> Any

Slice 11: the account's mandate limits over 's fields (the built-in ones, is_default, until one is published).

Calls GET /v1/mandate/settings/limits.

set_limits

prov.mandate.grants.set_limits(document: dict, note: Optional[str] = …) -> Any

Slice 11: save the mandate limits as a new live version (a key with the mandate scope).

Calls PUT /v1/mandate/settings/limits.

limit_versions

prov.mandate.grants.limit_versions(draft_group: Optional[str] = …, limit: Optional[int] = …, cursor: Optional[str] = …) -> Any

Slice 11: the mandate limits' versions, newest first (a sandbox draft group's drafts with draft_group).

Calls GET /v1/mandate/settings/limits/versions.

limit_version

prov.mandate.grants.limit_version(version: int) -> Any

Slice 11: one version of the mandate limits, with its document.

Calls GET /v1/mandate/settings/limits/versions/{version}.

publish_limits

prov.mandate.grants.publish_limits(version: int) -> Any

Slice 11: make a waiting draft of the mandate limits live (a rules embed session's, say).

Calls POST /v1/mandate/settings/limits/versions/{version}/publish.

set_over_limit_settings

prov.mandate.grants.set_over_limit_settings(over_limit: Optional[dict] = …, require_same_person: Optional[bool] = …, at_verify: Optional[str] = …, require_holder_proof: Optional[bool] = …, external: Optional[str] = …, external_online_above: Optional[float] = …) -> Any

Change the settings for the locks given (an admin key); a grant's own over_limit still comes first.

Calls PUT /v1/mandate/settings/delegation.

hand_off

prov.mandate.grants.hand_off(mandate_id: str, receiver: dict, holder_key: dict, agent_session_id: str, purpose: str, purpose_tags: Optional[list] = …, constraints: Optional[dict] = …, max_depth: Optional[int] = …, run_id: Optional[str] = …, budget: Optional[dict] = …, offline_checks: Optional[str] = …, handoff_id: Optional[str] = …) -> Any

Hand a narrower grant to an agent outside the account, bound to its key (holder_key, its P-256 public JWK).

Calls POST /v1/mandate/grants/{id}/delegate.

external_handoff

prov.mandate.grants.external_handoff(handoff_id: str) -> Any

An external hand-off as the account reads it (pending, minted with the grant's id, or declined).

Calls GET /v1/mandate/external_handoffs/{id}.

list_incoming_grants

prov.mandate.grants.list_incoming_grants(agent_id: Optional[str] = …, limit: Optional[int] = …, cursor: Optional[str] = …) -> Any

Grants other accounts handed to your registered agents, newest first (agent_id narrows to one agent).

Calls GET /v1/mandate/incoming_grants.

incoming_grant

prov.mandate.grants.incoming_grant(incoming_grant_id: str) -> Any

One incoming grant, with the grant's live status (the grant itself stays the other account's).

Calls GET /v1/mandate/incoming_grants/{id}.

list_trusted_agents

prov.mandate.grants.list_trusted_agents(limit: Optional[int] = …, cursor: Optional[str] = …) -> Any

The company's trusted outside agents.

Calls GET /v1/mandate/trusted_agents.

add_trusted_agent

prov.mandate.grants.add_trusted_agent(receiver: dict, max_amount: Optional[float] = …, budget_amount: Optional[float] = …) -> Any

Add a trusted outside agent (an admin key): {"kind": "provenance_agent", "agent_id":...} or {"kind": "key", "name":..., "origin": "https://...", "holder_key": <P-256 public JWK>}, with optional caps.

Calls POST /v1/mandate/trusted_agents.

remove_trusted_agent

prov.mandate.grants.remove_trusted_agent(trusted_agent_id: str) -> Any

Take an agent off the company's list (an admin key).

Calls DELETE /v1/mandate/trusted_agents/{id}.

list_holder_bindings

prov.mandate.grants.list_holder_bindings(limit: Optional[int] = …, cursor: Optional[str] = …) -> Any

The company's per-agent holder-binding settings.

Calls GET /v1/mandate/holder_bindings.

set_holder_binding

prov.mandate.grants.set_holder_binding(agent_id: str, holder_binding: str) -> Any

required (grants to your own agent carry holder_key) or not_required (an outside agent may get a bearer hand-off).

Calls PUT /v1/mandate/holder_bindings/{agent_id}.

clear_holder_binding

prov.mandate.grants.clear_holder_binding(agent_id: str) -> Any

Put an agent back on the default holder binding.

Calls DELETE /v1/mandate/holder_bindings/{agent_id}.

revoke

prov.mandate.grants.revoke(mandate_id: str, reason: Optional[str] = …) -> Any

Calls POST /v1/mandate/grants/{id}/revoke.

delegate

prov.mandate.grants.delegate(mandate_id: str, agent_session_id: str, purpose: str, purpose_tags: Optional[list] = …, agent_id: Optional[str] = …, constraints: Optional[dict] = …, max_depth: Optional[int] = …, run_id: Optional[str] = …, budget: Optional[dict] = …, limits_version: Optional[int] = …, draft_group: Optional[str] = …) -> Any

Mint a narrower child mandate for a subagent (omitted constraints inherit the parent's).

Calls POST /v1/mandate/grants/{id}/delegate.

delegate_as_holder

prov.mandate.grants.delegate_as_holder(mandate_id: str, parent_token: str, private_jwk: Mapping[str, Any], directory_url: str, agent_session_id: str, purpose: str, purpose_tags: Optional[list] = …, agent_id: Optional[str] = …, constraints: Optional[dict] = …, max_depth: Optional[int] = …, run_id: Optional[str] = …, budget: Optional[dict] = …, keyid: Optional[str] = …) -> Any

Delegate as the agent that holds the mandate, with no account key (holder proof).

Calls POST /v1/mandate/grants/{id}/delegate.

propose

prov.mandate.grants.propose(mandate_id: str, children: list, supersedes: Optional[str] = …, expires_in: Optional[int] = …, notify: Optional[bool] = …, limits_version: Optional[int] = …, draft_group: Optional[str] = …, approver: Optional[dict] = …) -> Any

Propose a delegation structure under a mandate you hold.

Calls POST /v1/mandate/grants/{id}/delegation_proposals.

propose_as_holder

prov.mandate.grants.propose_as_holder(mandate_id: str, parent_token: str, private_jwk: Mapping[str, Any], directory_url: str, children: list, supersedes: Optional[str] = …, expires_in: Optional[int] = …, notify: Optional[bool] = …, keyid: Optional[str] = …) -> Any

propose as the agent that holds the mandate, with no account key (holder proof, as delegate_as_holder).

Calls POST /v1/mandate/grants/{id}/delegation_proposals.

get_proposal

prov.mandate.grants.get_proposal(proposal_id: str) -> Any

A proposal, with the approved structure, the person's edits and the minted children (their tokens to an API key), and approval_context: how the person decided, None while pending.

Calls GET /v1/mandate/delegation_proposals/{id}.

list_proposals

prov.mandate.grants.list_proposals(status: Optional[str] = …, parent_grant_id: Optional[str] = …, limit: Optional[int] = …, cursor: Optional[str] = …) -> Any

This account's proposals, newest first.

Calls GET /v1/mandate/delegation_proposals.

Was this page helpful? Send us feedback

LLM? Read llms.txt.