Overview
Thegrants sub-client provides operations on grant records: retrieving, listing, revoking, delegating to sub-agents, and verifying grant tokens online.
grants.get()
Retrieve a single grant by its ID.Parameters
Response: Grant
grants.list()
List grants with optional filters.Parameters
Response: ListGrantsResponse
grants.revoke()
Revoke a grant by its ID. This immediately invalidates the grant and any associated tokens.Parameters
Response
Returnsvoid.
grants.delegate()
Create a delegated grant for a sub-agent. This implements the delegation chain described in SPEC section 9. The parent agent passes its grant token, and the sub-agent receives a new grant token with scopes that are a subset of the parent’s.Parameters
Duration for the delegated grant (e.g.
'1h', '30m'). Cannot exceed the parent grant’s remaining lifetime.Response
grants.verify()
Verify a grant token online and return aVerifiedGrant with full claim details. The SDK uses the server-verified claims returned by POST /v1/grants/verify — it does not decode the caller-supplied token locally, so forged or tampered tokens are always rejected by the server before any claim is surfaced.
Parameters
Response: VerifiedGrant
Returns a VerifiedGrant object with all decoded claims. See Offline Verification for the full field reference.