The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Grantex listing page.
What OAuth 2.0 is to humans, Grantex is to agents.
Docs | Quickstart | Release JSON | LLM Index | Spec | IETF Draft
Ownership: Grantex is owned by Orchestrum Technologies LLP. Inventor and owner: Sanjeev Kumar. Contact: sanjeev@orchestrum.in or mishra.sanjeev@gmail.com.
Grantex is an open-source delegated authorization protocol and reference implementation for AI agents. It gives each agent a verifiable identity and scoped, time-limited, revocable authority from a human or organization, with multi-agent delegation, service-side verification, and audit records.
Grantex complements OAuth 2.0 and MCP: OAuth handles application and user authorization, MCP connects models to tools, and Grantex proves which agent may perform which action for which principal. Use Grantex when an AI agent acts for a person or organization and a relying service must verify exactly what that agent may do.
Repository source includes principal-controlled prepaid wallets for AI agents. A principal can assign one or multiple wallets, apply assignment, wallet, agent, shared budget-group, principal, and developer controls, constrain recipients, resource origins, actions, merchants, purposes, projects, and cost centers, require an exact human approval, govern reload velocity, and block one assignment, one wallet, or all wallets available to an agent. Authorizations reserve value atomically in PostgreSQL and are bound to the agent's DPoP OAuth identity and the policy-evaluated semantic context.
@grantex/x402 uses official x402 v2 PAYMENT-REQUIRED,
PAYMENT-SIGNATURE, and PAYMENT-RESPONSE messages. The old simulated
X-Payment-Proof path is not used. sandbox_ledger is implemented end to end;
external custody records deliberately fail closed unless a configured provider
can verify funding and settlement. The source checkout now includes opt-in
Base native USDC EIP-3009 payments with policy-gated signing, verified funding,
durable signature retries and finalized-chain reconciliation. Python 0.5.0
and Go v0.3.0 publish the EVM response and reconciliation APIs; neither adds
an automatic HTTP payment wrapper. Published TypeScript 0.6.0 and x402 0.4.0
include the opt-in automatic Base 402/sign/retry flow. All four releases are
registry verified. See the
Base USDC custody guide, including the limit
that blocking cannot recall an already issued on-chain signature.
For side-effecting resources, the merchant must durably cache the business result
under Idempotency-Key. Grantex settlement is idempotent, but a settled payment
authorization cannot be verified or execute protected work a second time.
The OAuth grant must include wallet:spend and the exact merchant action scope
advertised as extra.grantexScope; wallet assignment policy can restrict that
human-approved authority but cannot add to it.
Grantex owns delegated agent identity, semantic spend policy, cross-wallet budgets, exact approvals, atomic reservations, stop controls, and audit. An AgenticOrg deployment or another agent runtime owns orchestration and the human interaction. The wallet issuer or custodian remains responsible for KYC/KYB, AML and sanctions controls, custody, network authorization, MCC/geography/card controls, settlement, FX, refunds, disputes, fraud, and reconciliation. The merchant remains responsible for server-trusted price/payee data, order idempotency, settlement gating, and delivery of the paid result.
See Agent Wallet Governance for the complete responsibility matrix, policy composition, exact approval protocol, and honest residual gap list.
The managed clients are implemented in registry-verified @grantex/sdk@0.6.0,
@grantex/x402@0.4.0, Python grantex==0.5.0, and Go v0.3.0. External
custody, principal notification delivery, and
merchant result idempotency remain operator responsibilities.
See the x402 integration
guide, wallet
lifecycle, and production-readiness
guide.
Running the auth-service does not provision every dependency needed for a real-money product. Self-hosting operators must explicitly provide and test:
091_agent_prepaid_wallets.sql and
092_layered_wallet_spend_controls.sql, backups, restore, and reconciliation
for the append-only wallet ledger and policy decisions;/v1/prepaid-wallets and /v1/prepaid-wallets/** (a static-host 404 breaks
agent wallet access even while the origin service is healthy);external wallets; without one, Grantex
deliberately returns 503 CUSTODY_ADAPTER_UNAVAILABLE;Idempotency-Key for
side effects after settlement;The server deployment and each SDK release are separate. Registry consumers should verify an exact version before installing it rather than inferring availability from repository manifests. The production-readiness guide contains the full hosting checklist and a maintainer-only PowerShell publication runbook.
The security workflow audits every tracked npm lockfile, every tracked Python
project and requirements surface, and all three Go modules. Dependabot coverage
is checked against the repository manifests, external GitHub Actions and
container images are pinned to immutable digests, and unreviewed npm license
identifiers fail CI. Run npm run audit:supply-chain and
npm run audit:python locally before a release.
Apache-2.0 covers Grantex source, not third-party dependencies. See
THIRD_PARTY_NOTICES.md for the current
Sharp/libvips LGPL and caniuse-lite CC-BY distribution notes, and the
supply-chain security guide for the
operator checklist. This inventory is an engineering control, not a legal
non-infringement opinion; distributors must review the exact artifacts they
ship.
The hosted auth service and repository TypeScript client implement the three
roles in candidate draft-mishra-oauth-agent-grants-03. The tested profile
requires PAR, PKCE S256, DPoP sender constraints, RFC 9207 response issuer
validation, five-minute access tokens, rotating refresh tokens with family
replay revocation, 300-second exact-request recovery when a refresh response is
lost, AES-256-GCM encrypted recovery state with expiry cleanup, same-resource
RFC 8693 attenuation, and RFC 7009 revocation.
| Discovery and endpoints | URL |
|---|---|
| Authorization-server metadata | https://grantex.dev/.well-known/oauth-authorization-server |
| PAR / authorize / token / revoke | https://grantex.dev/oauth/{par,authorize,token,revoke} |
| Implementation guide | docs.grantex.dev/guides/oauth-agent-grants |
| Evidence | Implementation report and 30 behavioral vectors |
Verification completed with 2,138 auth-service tests, 456 TypeScript SDK tests,
and 255 tests across 23 sequential Docker E2E files. This is self-assessed evidence for
the tested Grantex configuration, not independent interoperability
certification, OAuth Working Group adoption, or IETF endorsement. The
updated OAuthAgentClient is published in registry-verified
@grantex/sdk@0.6.0.
Revision -02 remains the current Datatracker publication. Candidate -03
must not be uploaded before 2026-09-09 and requires a fresh explicit approval
after the scheduled final review.
Open Agentic Commerce Protocol (OACP) is Grantex's agentic-commerce trust and artifact-authority layer. Grantex governs OACP policy, internal artifact issuance or refusal, verification, and compatibility adapters. AgenticOrg owns buyer and seller AI-agent runtime, merchant self-service onboarding, Shopify connector runtime, future merchant connector setup intent, buyer sessions, channel bridges, OACP cache, and provider-owned capability verification.
Merchant systems such as Shopify, future WooCommerce/ERP sources, POS systems, and provider systems remain the source of record. Provider, bank, POS, and payment rails own mandate, payment, and in-store execution. Grantex signs and verifies artifacts; it is not a merchant connector runtime or a toll booth for every buyer and seller message.
| Area | Current posture |
|---|---|
| Grantex C6Z authority route | Implemented at POST /v1/commerce/oacp/c6z/authority-requests for allowlisted AgenticOrg tenants. |
| Artifact families | 11 internal OACP families are issued or refused with source lineage, TTL, freshness, revocation posture, blocked capabilities, non-sensitive evidence refs, and signature metadata. |
| Protocol adapters | Schema.org, UCP-style, ACP-style, AP2-style, A2A, MCP, and OpenAPI mappings are compatibility mappings derived from OACP artifacts. |
| AgenticOrg runtime | Merchant self-service config, Seller onboarding, Shopify sync, future connector/provider intent capture, cache, buyer Q&A, bridges, and provider capability verification live in AgenticOrg. |
| Payment/order/POS execution | Outside OACP artifact authority. Provider, POS, and merchant systems must execute and confirm; agents must not invent success. |
| Historical Commerce V1 docs | Retained for context, but superseded for the AgenticOrg OACP runtime split. |
Start with the OACP runtime launch closure PRD, OACP authority overview, merchant self-service config boundary, truth inventory, AgenticOrg integration guide, POS bridge boundary, and operator runbook. The older Commerce V1 overview remains historical/contextual and should not be used to imply that Grantex owns AgenticOrg merchant connector runtime.
Grantex components are independently versioned. The protocol specification remains v1.0 Final; SDK, MCP package, and roadmap milestone versions are separate release lines and do not represent a monorepo-wide version.
Current public releases and repository versions, verified 2026-09-07:
| Component | Published version | Repository version | Reproducible install |
|---|---|---|---|
| TypeScript SDK | @grantex/sdk 0.6.0 | 0.6.0 | npm install @grantex/sdk@0.6.0 |
| x402 Payment Protocol | @grantex/x402 0.4.0 | 0.4.0 | npm install @grantex/x402@0.4.0 @grantex/sdk@0.6.0 |
| Python SDK | grantex 0.5.0 | - | python -m pip install grantex==0.5.0 |
| Go SDK | github.com/mishrasanjeev/grantex-go v0.3.0 (Go 1.26.1+) | - | go get github.com/mishrasanjeev/grantex-go@v0.3.0 |
| MCP Authorization Server | @grantex/mcp-auth 2.0.2 | - | npm install @grantex/mcp-auth@2.0.2 @grantex/sdk@0.6.0 |
Known published-package limits: MCP Auth
2.0.2keeps authorization codes in process memory, does not render consent, and has an incomplete Grantex code handoff. See the release-status guide for exact workarounds and deployment boundaries.
Repository development status: the auth service enforces Redis-backed Free/Pro/Enterprise developer budgets of 100/500/2,000 requests per minute on API-key routes handled by the standard auth plugin. Custom-auth quota policy remains open and the managed-service rollout remains independent of SDK publication.
Omit a version pin to install the registry's current latest release. See the release-status documentation, COMPATIBILITY.md for the full package matrix, and CHANGELOG.md for release notes.
@grantex/mcp-auth): Published OAuth 2.1 + PKCE endpoint package; review the documented 2.0.2 single-process, consent, and token-exchange limitations@grantex/mcp): Agent-facing Grantex tools for MCP clientsgrantex.dev/registrygrantex verify: Token inspection CLI — no account neededSKILL.md installation for Hermes, OpenClaw, and portable Agent Skills clientsShell-capable agents use the same JSON-first CLI; no agent-specific SDK is required:
The bundle installs use-grantex-cli for delegated-authorization operations and integrate-grantex for service-boundary implementation work. For a different host, use grantex agent install --dir /path/to/skills. Prefer --env, --file, or --stdin token inputs and keep final enforcement inside the protected service.
29 packages across TypeScript, Python, and Go. Integrations for Anthropic SDK, LangChain, OpenAI Agents SDK, Google ADK, Strands Agents SDK, CrewAI, Vercel AI, AutoGen, MCP, Express.js, FastAPI, and Terraform. Use the compatibility matrix for versions, the changelog for release notes, and GitHub Actions for current CI status. Fully self-hostable. Apache 2.0.
AI agents are booking travel, sending emails, deploying code, and spending money — on behalf of real humans. But:
OAuth and IAM provide essential foundations, but many agent deployments still rely on shared credentials that do not identify the individual agent or encode its delegated authority.
Refresh tokens are single-use and rotate on every accepted refresh. If the
refresh HTTP response is lost after the server commits, retry the same previous
refresh token immediately; Grantex can recover the already-rotated token pair
for five minutes (300 seconds). Refresh does not extend token.expiresAt; after
the grant expires, start a new authorization request.
Grantex tokens are standard JWTs (RS256) extended with agent-specific claims. Any service can verify their signatures locally using the issuer's published JWKS. The provided verifiers retrieve those keys from the configured JWKS URL, so applications should account for network availability, caching, and key rotation:
| Claim | Meaning |
|---|---|
sub | The end-user who authorized this agent |
agt | The agent's DID — cryptographically verifiable identity |
dev | The developer org that built the agent |
scp | Exact scopes granted — services should check these |
jti | Unique token ID — used for grant-state and revocation checks |
grnt | Grant record ID — links token to the persisted grant |
aud | Intended audience (optional) — services should reject tokens with a mismatched aud |
Delegation claims (present on sub-agent tokens):
| Claim | Meaning |
|---|---|
parentAgt | DID of the parent agent that spawned this sub-agent |
parentGrnt | Grant ID of the parent grant — full delegation chain is traceable |
delegationDepth | How many hops from the root grant (root = 0) |
Grantex supports multi-agent pipelines where a root agent spawns sub-agents with narrower scopes. Sub-agent tokens carry a full delegation chain that any service can inspect.
Constraints enforced by the protocol:
min(parent expiry, requested expiry) — sub-agents can never outlive their parentGrantex provides OIDC and SAML 2.0 enterprise SSO with multiple identity-provider connections, email-domain routing, enforcement, JIT provisioning, and group-to-scope mapping from identity-provider claims. The LDAP surface is a direct-bind preview: it authenticates a supplied directory identity but does not search directories or retrieve LDAP groups.
Key capabilities:
Grantex supports passkey-based human presence verification using the FIDO2/WebAuthn standard. When enabled, end-users prove they are physically present during the consent flow by authenticating with a passkey (biometric, security key, or platform authenticator). This raises the assurance level of every grant from "user clicked approve" to "user was cryptographically verified."
fidoRequired: true on your developer profile via PATCH /v1/me| Method | Endpoint | Description |
|---|---|---|
POST | /v1/webauthn/register/options | Generate passkey registration options |
POST | /v1/webauthn/register/verify | Verify registration and store credential |
GET | /v1/webauthn/credentials | List WebAuthn credentials for a principal |
DELETE | /v1/webauthn/credentials/:id | Delete a credential |
POST | /v1/webauthn/assert/options | Generate assertion options for consent |
POST | /v1/webauthn/assert/verify | Verify assertion during consent |
PATCH | /v1/me | Update developer settings (FIDO config) |
Grantex can issue W3C Verifiable Credentials (VCs) alongside standard JWTs. While JWTs are optimized for real-time authorization, VCs provide a portable, tamper-evident, standards-based proof of authorization that can be presented to any verifier — including systems outside the Grantex ecosystem.
In agentic commerce, an agent acting on your behalf needs to prove its authorization to third-party services that may not integrate with Grantex directly. A Verifiable Credential is a self-contained, cryptographically signed document that any party can verify using the issuer's published DID document — no API calls, no accounts, no trust relationships required.
When exchanging an authorization code for a grant token, pass credentialFormat: "vc-jwt" to receive a Verifiable Credential alongside the standard grant token:
| Type | Description |
|---|---|
AgentGrantCredential | Issued for direct grants — attests that a principal authorized an agent with specific scopes |
DelegatedGrantCredential | Issued for delegated grants — includes the full delegation chain |
Grantex implements the W3C StatusList2021 revocation mechanism. Each credential references a status list entry. When a grant is revoked, the corresponding bit in the status list is flipped, and any verifier checking the credential sees it as revoked.
When FIDO is enabled and the user completes a WebAuthn assertion during consent, the VC includes a fidoEvidence field that cryptographically proves human presence at the time of authorization. This is compatible with the Mastercard Verifiable Intent specification for agentic commerce.
Grantex publishes a W3C DID document at /.well-known/did.json (did:web:grantex.dev). This document contains the public keys used to sign Verifiable Credentials, enabling any party to verify credentials without contacting Grantex:
| Method | Endpoint | Description |
|---|---|---|
GET | /v1/credentials/:id | Retrieve a Verifiable Credential |
GET | /v1/credentials | List Verifiable Credentials |
POST | /v1/credentials/verify | Verify a VC-JWT |
GET | /v1/credentials/status/:id | StatusList2021 credential |
GET | /.well-known/did.json | W3C DID document |
MPP (Machine Payments Protocol) defines HTTP 402 payment flows for software clients. Grantex can attach an AgentPassportCredential based on W3C Verifiable Credentials 2.0 so a configured merchant can verify agent, principal, category, amount-limit, expiry, and delegation claims after obtaining the issuer keys and current status data. The credential carries authorization context; it does not prove that a payment settled, an order was approved, or a provider accepted the transaction.
A wallet or payment-source identifier may not tell a merchant which internal agent is acting, which principal delegated authority, or which policy limits apply. An agent passport can supply that context when both sides integrate and enforce it.
The current Grantex passport shape uses Ed25519 signatures, a W3C VC 2.0 data model, configured purchase categories, transaction ceilings, expiry, delegation context, and StatusList2021-style status data. A relying merchant must still validate the issuer, refresh keys and status according to its risk policy, enforce the claims at the protected action, and run its own payment, fraud, sanctions, order, and settlement controls.
| Step | Who | What |
|---|---|---|
| 1. Issue | Authorized application | Requests an AgentPassportCredential with configured categories, amount ceiling, delegation context, and expiry |
| 2. Store | Agent host | Stores the credential as sensitive authorization material |
| 3. Present | Agent host | Attaches the credential to a supported MPP request when the integration is configured |
| 4. Verify | Merchant service | Verifies signature, issuer, expiry, category, amount, and sufficiently current status data |
| 5. Decide | Merchant and payment systems | Apply merchant policy plus independent payment, order, provider, and settlement checks before execution |
| 6. Record | Each participating system | Records the events it is configured to observe; credential verification alone is not an execution or settlement audit log |
Verification boundary: cached keys can support local signature checks after retrieval. Current revocation requires refreshed status data, and cache policy determines how quickly a relying service observes a change.
| Field | Description |
|---|---|
id | urn:grantex:passport:<ulid> |
issuer | did:web:grantex.dev |
credentialSubject.id | Agent DID (did:grantex:ag_...) |
credentialSubject.humanPrincipal | DID of the authorizing human |
credentialSubject.organizationDID | Org DID (did:web:<domain>) |
credentialSubject.grantId | Links to underlying Grantex grant |
credentialSubject.allowedMPPCategories | inference, compute, data, storage, search, media, delivery, browser, general |
credentialSubject.maxTransactionAmount | { amount, currency } ceiling per transaction |
credentialSubject.delegationDepth | Inherited from grant delegation chain |
credentialStatus | StatusList2021 revocation entry |
proof | Ed25519Signature2020 |
TypeScript:
cURL:
Standalone verification:
Express middleware (one-liner):
Query any organization's verified trust level — no authentication required:
Revoking a passport updates server-side status immediately. Local verifiers observe the change only after an online revocation check or status-data refresh, so cached results can lag:
| Code | HTTP | Description |
|---|---|---|
PASSPORT_EXPIRED | 403 | Credential validUntil has passed |
PASSPORT_REVOKED | 403 | StatusList2021 bit is set |
INVALID_SIGNATURE | 403 | Signature verification failed |
UNTRUSTED_ISSUER | 403 | Issuer DID not in trusted list |
CATEGORY_MISMATCH | 403 | Categories don't cover required service |
AMOUNT_EXCEEDED | 403 | Max amount below required threshold |
MISSING_PASSPORT | 403 | No X-Grantex-Passport header |
MALFORMED_CREDENTIAL | 403 | Invalid base64url or missing VC fields |
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST | /v1/passport/issue | API key | Issue AgentPassportCredential |
GET | /v1/passports | API key | List passports (filter by agentId, grantId, status) |
GET | /v1/passport/:id | API key | Retrieve passport by ID |
POST | /v1/passport/:id/revoke | API key | Revoke passport (StatusList2021) |
GET | /v1/trust-registry/:orgDID | None | Look up org trust record (public) |
GET | /v1/trust-registry | API key | List all trust records (admin) |
See packages/mpp/ for full package docs. Demo: grantex.dev/mpp-demo.
Grantex supports SD-JWT (Selective Disclosure JWT) for privacy-preserving credential presentation. While a standard VC-JWT reveals all claims to every verifier, SD-JWT lets the holder choose exactly which fields to disclose — keeping everything else hidden.
In agentic commerce, different verifiers need different levels of information. A payment processor needs to know the agent's scopes and budget, but not the principal's identity. A compliance auditor needs the principal and timestamps, but not the scopes. SD-JWT enables minimum-disclosure presentations that satisfy each verifier's requirements without over-sharing.
When exchanging an authorization code, pass credentialFormat: "sd-jwt" to receive an SD-JWT credential:
The holder selects which claims to disclose when presenting to a verifier:
An SD-JWT consists of: <issuer-jwt>~<disclosure1>~<disclosure2>~...~
Each disclosure is a base64url-encoded JSON array [salt, claim-name, claim-value]. The verifier can only see claims for which a disclosure is provided.
| Claim | Description |
|---|---|
principalId | The end-user who authorized the grant |
developerId | The developer who owns the agent |
scopes | The authorized scopes |
agentId | The agent's DID |
grantId | The grant record identifier |
issuedAt | When the credential was issued |
expiresAt | When the credential expires |
| Method | Endpoint | Description |
|---|---|---|
POST | /v1/token | Exchange code for grant token + SD-JWT (with credentialFormat: "sd-jwt") |
POST | /v1/credentials/verify | Verify an SD-JWT presentation |
Grantex provides per-grant budget controls that let developers cap how much an agent can spend. Budget allocations are enforced atomically — if a debit would exceed the remaining balance, it fails with a 402 INSUFFICIENT_BUDGET error. Threshold alerts fire at 50% and 80% consumption, and the remaining budget is embedded in grant tokens via the bdg JWT claim.
| Method | Endpoint | Description |
|---|---|---|
POST | /v1/budget/allocate | Create a budget allocation for a grant |
POST | /v1/budget/debit | Debit against a grant's budget (402 if insufficient) |
GET | /v1/budget/balance/:grantId | Get remaining balance for a grant |
GET | /v1/budget/allocations | List all budget allocations |
GET | /v1/budget/transactions/:grantId | List transactions and total spend for a grant |
Grantex provides real-time event streaming via Server-Sent Events (SSE) and WebSocket. Subscribe to authorization lifecycle events as they happen — grant creation, revocation, token issuance, and budget threshold alerts. Events are published to both webhooks and streaming endpoints, so you can choose push or pull.
| Event | Description |
|---|---|
grant.created | A new grant was approved by an end-user |
grant.revoked | A grant was revoked (by user, developer, or cascade) |
token.issued | A grant token was exchanged or refreshed |
budget.threshold | A budget allocation crossed 50% or 80% usage |
budget.exhausted | A budget allocation reached 0 remaining |
| Method | Endpoint | Description |
|---|---|---|
GET | /v1/events/stream | SSE event stream (Bearer auth) |
GET | /v1/events/ws | WebSocket event stream |
Grantex tracks API usage per developer — token exchanges, authorization requests, and verification calls. Use the metering API to monitor consumption, enforce plan limits, and export usage data for billing.
| Method | Endpoint | Description |
|---|---|---|
GET | /v1/usage | Current period usage for the authenticated developer |
GET | /v1/usage/history?days=N | Daily usage history for the last N days |
Grantex provides domain registration and DNS-based ownership verification so your account is provisioned and ready to host Grantex on your own domain. Today the API covers registration, verification, listing, and deletion; runtime traffic routing through verified domains (consent UI / API endpoints served from your domain) is on the roadmap and currently still served from *.grantex.dev. Track progress in issues.
| Method | Endpoint | Description |
|---|---|---|
POST | /v1/domains | Register a new custom domain |
GET | /v1/domains | List all registered domains |
POST | /v1/domains/:id/verify | Verify domain ownership via DNS TXT |
DELETE | /v1/domains/:id | Remove a custom domain |
Grantex supports pluggable policy backends for fine-grained authorization decisions. In addition to the built-in policy engine, you can connect OPA (Open Policy Agent) or Cedar to evaluate authorization requests against externally managed policy bundles. Policy bundles can be synced via direct upload or triggered automatically from a git repository webhook.
| Backend | Description | Config |
|---|---|---|
| Builtin | Default rule engine — scope matching + delegation constraints | No config needed |
| OPA | Open Policy Agent — Rego policies evaluated at POST /v1/data/grantex/authz | POLICY_BACKEND=opa, OPA_URL=... |
| Cedar | AWS Cedar — Cedar policies evaluated at POST /v1/is_authorized | POLICY_BACKEND=cedar, CEDAR_URL=... |
| Method | Endpoint | Description |
|---|---|---|
POST | /v1/policies/sync | Upload a policy bundle (OPA or Cedar) |
POST | /v1/policies/sync/webhook | Git webhook trigger for policy sync |
GET | /v1/policies/bundles | List uploaded policy bundles |
DPDP Act 2023 support includes structured consent records, purpose limitation, data principal rights workflows (access, erasure, grievance), and audit-ready exports. Available in all SDKs and the CLI. This is a technical control mapping, not a legal certification.
| Method | Endpoint | Description |
|---|---|---|
POST | /v1/dpdp/consent-notices | Register a consent notice |
POST | /v1/dpdp/consent-records | Create a consent record |
GET | /v1/dpdp/consent-records/:id | Get a consent record |
GET | /v1/dpdp/consent-records | List consent records |
POST | /v1/dpdp/consent-records/:id/withdraw | Withdraw consent |
GET | /v1/dpdp/data-principals/:id/records | Right to access (§11) |
POST | /v1/dpdp/data-principals/:id/erasure | Right to erasure (§11) |
POST | /v1/dpdp/grievances | File a grievance (§13(6)) |
GET | /v1/dpdp/grievances/:id | Get grievance status |
POST | /v1/dpdp/exports | Generate compliance export |
GET | /v1/dpdp/exports/:id | Get export data |
Enforce tool-level permissions on any connector — define your own manifests or use the 53 pre-built ones.
| Scope Level | READ tools | WRITE tools | DELETE tools |
|---|---|---|---|
| read | Yes | No | No |
| write | Yes | Yes | No |
| delete | Yes | Yes | Yes |
| admin | Yes | Yes | Yes |
Bring your own manifests: define inline, load from JSON files, load from a directory, or auto-generate from source code via CLI. 53 pre-built manifests included: Salesforce, HubSpot, Jira, Stripe, SAP, S3, Gmail, Slack, GitHub, and 44 more — use as-is or as a starting point.
Framework helpers: wrapTool() wraps LangChain tools with automatic scope enforcement. createGrantexTool() covers TypeScript agent framework helpers including Strands Agents SDK. create_grantex_tool() covers Python OpenAI Agents SDK, Google ADK, and Strands Agents SDK tools. enforceMiddleware() adds one-line enforcement to Express/Fastify routes. FastAPI uses the GrantexEnforcer dependency.
See the Scope Enforcement Guide for full documentation.
Use Node.js 24 LTS for repository installs, builds and tests. The upgraded
Vitest 5 toolchain needs Node.js 22.12 or newer; this contributor requirement
is separate from the runtime requirements of an already published SDK.
Use the checked-in lockfiles with npm ci and see CONTRIBUTING.md.
Start the full stack with one command:
Two API keys are seeded automatically:
| Key | Mode | Use for |
|---|---|---|
dev-api-key-local | live | full consent flow with redirect |
sandbox-api-key-local | sandbox | skip consent UI — get a code immediately |
Sandbox mode is designed for testing. With a sandbox key, POST /v1/authorize returns a code in the response body — no redirect required:
Developer portal is available at grantex.dev/dashboard — sign up or enter an API key to manage agents, grants, policies, anomalies, compliance exports, and billing from the browser.
For local development, the auth service also serves a lightweight dashboard at http://localhost:3001/dashboard.
See the self-hosting guide for production deployment guidance, or DEPLOYMENT.md for the complete deployment reference (system requirements, environment variables, Docker/Kubernetes/Cloud Run options, security checklist, monitoring). Python dependencies are in requirements.txt.
Grantex is built as an open protocol, not a closed SaaS product. Here's why that matters:
Model-neutral. Grantex operates at the SDK or protected-service boundary rather than depending on one model provider. The project documents use with OpenAI, Anthropic, Google, Llama, and Mistral models.
Framework-native. First-class integrations for LangChain, AutoGen, CrewAI, OpenAI Agents SDK, Google ADK, Strands Agents SDK, and plain code. Install one package, get Grantex in your existing stack.
Offline-verifiable signatures. Services verify token signatures locally using published JWKS. Applications should plan for JWKS retrieval and key rotation; availability during an issuer outage depends on their verifier's cache behavior.
Compliance-oriented controls. The EU AI Act, GDPR, and emerging US AI regulations will mandate auditable agent actions. Grantex provides technical controls that can support those programs from day one.
Grantex defines a standard scope format: resource:action[:constraint]
| Scope | Meaning |
|---|---|
calendar:read | Read calendar events |
calendar:write | Create and modify events |
email:send | Send emails on user's behalf |
payments:initiate:max_500 | Initiate payments up to $500 |
files:read | Read user files |
profile:read | Read user profile |
Service providers implement scope definitions for their APIs. Agents declare which scopes they need. Users see plain-language descriptions, never raw scope strings.
This table is a source-and-registry status snapshot as of 2026-09-07. For integration packages, "Published package" identifies a public package surface; check its registry page and compatibility notes before choosing a version.
| Framework | Package | Install | Status |
|---|---|---|---|
| Gemma 4 (Offline Auth) | @grantex/gemma | npm install @grantex/gemma | Published package |
| Gemma 4 (Python) | grantex-gemma | pip install grantex-gemma | Published package |
| DPDP Compliance | @grantex/dpdp | npm install @grantex/dpdp | Published package |
| Adapters | @grantex/adapters | npm install @grantex/adapters | Published package |
| MCP Tool Server | @grantex/mcp (0.1.10) | npm install @grantex/mcp | Published package |
| MCP Authorization Server | @grantex/mcp-auth (2.0.2) | npm install @grantex/mcp-auth@2.0.2 @grantex/sdk@0.6.0 | Published; single-process evaluation only |
| Gateway | @grantex/gateway | npm install @grantex/gateway | Published package |
| Express.js | @grantex/express | npm install @grantex/express | Published package |
| FastAPI | grantex-fastapi | pip install grantex-fastapi | Published package |
| LangChain | @grantex/langchain | npm install @grantex/langchain | Published package |
| AutoGen / OpenAI | @grantex/autogen | npm install @grantex/autogen | Published package |
| CrewAI | grantex-crewai | pip install grantex-crewai | Published package |
| OpenAI Agents SDK | grantex-openai-agents | pip install grantex-openai-agents | Published package |
| Google ADK | grantex-adk | pip install grantex-adk | Published package |
| Strands Agents SDK (TypeScript) | @grantex/strands | npm install @grantex/strands | Published package |
| Strands Agents SDK (Python) | grantex-strands | pip install grantex-strands | Published package |
| Anthropic SDK | @grantex/anthropic | npm install @grantex/anthropic | Published package |
| Vercel AI SDK | @grantex/vercel-ai | npm install @grantex/vercel-ai | Published package |
| TypeScript SDK | @grantex/sdk (0.6.0) | npm install @grantex/sdk@0.6.0 | Registry-verified published package |
| Python SDK | grantex (0.5.0) | python -m pip install grantex==0.5.0 | Registry-verified published package |
| Go SDK | grantex-go (v0.3.0, Go 1.26.1+) | go get github.com/mishrasanjeev/grantex-go@v0.3.0 | Tag and public Go-proxy verified |
| CLI | @grantex/cli (0.3.0) | npm install -g @grantex/cli@0.3.0 | Registry-verified published package |
| Hermes Agent | @grantex/cli 0.3.0+ + Agent Skills | grantex agent install --target hermes | Published in 0.3.0; no dedicated SDK needed |
| OpenClaw | @grantex/cli 0.3.0+ + Agent Skills | grantex agent install --target openclaw | Published in 0.3.0; no dedicated SDK needed |
| Portable Agent Skills | @grantex/cli 0.3.0+ + SKILL.md | grantex agent install --target portable | Published in 0.3.0 |
| Conformance Suite | @grantex/conformance | npm install -g @grantex/conformance | Published package |
| A2A Bridge (TS) | @grantex/a2a | npm install @grantex/a2a | Published package |
| A2A Bridge (Py) | grantex-a2a | pip install grantex-a2a | Published package |
| Event Destinations | @grantex/destinations | npm install @grantex/destinations | Published package |
| Terraform Provider | terraform-provider-grantex | Source-build evaluation | Source only; public registry lookup returned 404 on September 7, 2026 |
| x402 Payment Protocol | @grantex/x402 (0.4.0) | npm install @grantex/x402@0.4.0 @grantex/sdk@0.6.0 | Registry-verified layered x402 v2 release; external custody remains operator-supplied |
The guarded publish-primary-sdks.yml workflow builds and tests each prepared
version once, then publishes those immutable artifacts. Before it can publish, a
maintainer must configure the protected sdk-release GitHub environment, npm
trusted-publisher records for both npm packages, a PyPI trusted publisher for
grantex, and a narrowly scoped Go-repository release token. A manifest version
bump by itself is not a release.
Express.js — grant token verification + scope-based authorization:
FastAPI — dependency injection with scope enforcement:
LangChain — scope-enforced tools + audit callbacks:
Vercel AI SDK — scope checked at construction time:
AutoGen / OpenAI function calling:
CrewAI (Python):
OpenAI Agents SDK (Python):
Google ADK (Python):
Strands Agents SDK (Python):
CLI (90+ commands, all support --json for AI agent / scripting use):
Try the full Grantex authorization flow live in your browser — no signup required:
Walk through all 7 steps of the protocol: register an agent, authorize, exchange tokens, verify, refresh, revoke, and verify revocation. Uses sandbox mode with your API key.
| Example | Description | Run |
|---|---|---|
quickstart-ts | Core authorization flow — register, authorize, exchange, verify, audit, revoke | npm start |
quickstart-py | Same flow in Python | python main.py |
nextjs-starter | Interactive Next.js app — full consent UI flow in the browser | npm run dev |
langchain-agent | LangChain agent with scope-enforced tools | npm start |
anthropic-tool-use | Anthropic SDK tool use with scope enforcement | npm start |
vercel-ai-chatbot | Vercel AI SDK chatbot with Grantex tools | npm start |
crewai-agent | CrewAI agent with Grantex authorization | python main.py |
openai-agents | OpenAI Agents SDK integration | python main.py |
google-adk | Google ADK agent with Grantex tools | python main.py |
gateway-proxy | Gateway reverse proxy with YAML config and scope enforcement | npm start |
adapter-google-calendar | GoogleCalendarAdapter with grant token verification | npm start |
multi-agent-delegation | Parent/child delegation with cascade revocation | npm start |
gemma-raspberry-pi | Gemma 4 agent on Raspberry Pi with offline auth | python agent.py |
gemma-android-kotlin | Android Gemma 4 agent with offline verification | Android Studio |
gemma-ios-swift | iOS Gemma 4 agent with CryptoKit verification | swift run |
quickstart-go | Core authorization lifecycle using the Go SDK | go run . |
multi-agent-email-flow | Multi-agent email automation with delegation, enforcement, and cascade revocation | npm start |
audit-dashboard | Audit trail querying, filtering, and hash chain integrity verification | npm start |
token-expiry-refresh | Active-grant refresh rotation, 300-second lost-response recovery, and expired-grant re-authorization | npm start |
x402-agent-demo | DPoP-bound agent uses an assigned prepaid wallet through official x402 v2 with durable idempotency | npm start |
x402-weather-api | Official x402 v2 resource server using Grantex prepaid verify/settle | npm start |
The current product roadmap prioritizes a 2026.08 production-trust baseline: durable MCP authorization, primary-SDK parity and release safety, revocation-aware enforcement, plan throughput, and production Commerce consent. Repository progress is recorded under Unreleased; the release-status guide, compatibility matrix, and package-specific documentation remain authoritative for published versions, deployment status, and limitations. The labels below are historical source milestones, not release or production-readiness claims.
| Milestone | Historical scope | Current interpretation |
|---|---|---|
| v0.1 - Foundation | Protocol spec, TypeScript and Python SDKs, auth service, consent UI, audit trail, multi-agent delegation, sandbox mode | Historical source milestone |
| v0.2 - Integrations | LangChain, AutoGen, webhooks, Stripe billing, CLI | Historical source milestone; verify package status |
| v0.3 - Enterprise | CrewAI, Vercel AI, compliance exports, policy engine, SCIM/SSO, anomaly detection | Historical source milestone; feature boundaries vary |
| v1.0 - Stable Protocol | Protocol specification v1.0, security material, SOC 2 readiness mapping, individual IETF Internet-Draft | Protocol v1.0 is final; mappings and the draft are not certifications or IETF endorsement |
| v2.0 - Platform | MCP authorization package, Credential Vault, adapters, webhook delivery log, examples | Historical source milestone; MCP Auth 2.0.2 is single-process evaluation software |
| v2.1 - Enterprise Scale | Event streaming, budget controls, observability, Terraform source, gateway, conformance | Historical source milestone; verify each deployment surface |
| v2.2 - Ecosystem | OPA/Cedar backends, A2A bridge, usage metering, custom-domain registration, policy-as-code | Historical source milestone; custom-domain runtime routing varies |
| v2.3 - Trust and Identity | Passkeys, Verifiable Credentials, SD-JWT, DID infrastructure, status data, intent mappings | Historical source milestone; mappings are not third-party certification |
| v2.4 - Enterprise SSO | OIDC and SAML 2.0 multi-IdP support, JIT provisioning, group mapping, enforcement, sessions, LDAP direct-bind preview | Historical source milestone; LDAP directory search and group retrieval are not implemented |
Grantex is open-source and welcomes contributions:
Read CONTRIBUTING.md before submitting a PR.
| OWASP | Covers ASI-01, ASI-03, ASI-05, ASI-10 from the Agentic Security Top 10 (Dec 2025) |
| EU AI Act | Technical control mapping only, not legal advice. Application is phased: transparency rules from Aug 2026, certain high-risk rules from Dec 2027, and product-integrated high-risk rules from Aug 2028 under the political agreement. See the European Commission timeline. |
| NIST AI RMF | Govern 1.1, Map 5.1, Measure 2.5 — repository comment draft; no public submission receipt or endorsement |
| IETF | Active individual Internet-Draft; revision -02 is published. Revision -03 and its self-assessed client/authorization-server/resource-server implementation are under review in docs/ietf-draft/, with no upload before 2026-09-09. This is not independent certification, adoption, or IETF endorsement (Datatracker) |
| AuthZEN | Conformance mapped |
| SOC 2 | Readiness control mapping published; formal third-party attestation not published |
| Protocol Spec | v1.0 Final — frozen, open, Apache 2.0 |
Full compliance matrix: docs.grantex.dev/guides/compliance-matrix
Using Grantex in production? Open a PR to add your company here.
Is this just another auth library?
Human identity systems and Grantex solve different layers. Human auth establishes who the person is; Grantex carries the scoped authority that person or organization delegated to a specific agent. Current revocation requires an online state check or synchronized revocation data at the enforcement point.
Why not just use OAuth 2.0?
OAuth 2.0 was designed for "user grants app permission to access their data." Agents introduce new requirements: the agent needs a verifiable identity separate from its creator, grants need to be chainable across multi-agent pipelines, and every autonomous action must be attributable and auditable. We extend OAuth 2.0 concepts but add the agent-specific primitives it lacks.
What about MCP (Model Context Protocol)?
MCP connects clients to tools and resources and defines optional OAuth-based authorization for HTTP transports. Grantex adds agent-specific delegated authority at the tool or service boundary: which agent may perform which action for which principal. The two layers are complementary.
Who owns the standard?
The v1.0 protocol specification is open (Apache 2.0). Grantex is owned by Orchestrum Technologies LLP, and Sanjeev Kumar is listed as inventor and owner. Orchestrum Technologies LLP maintains the reference implementation. Revision -02 is published as an active individual IETF Internet-Draft, and revision -03 is under review; neither publication nor repository implementation is working-group adoption, independent certification, or IETF endorsement.
Can I self-host?
Yes. The reference implementation is fully open-source. Docker Compose deploy in one command. See DEPLOYMENT.md for the complete guide or the self-hosting docs.
Protocol specification and SDKs: Apache 2.0
Third-party packages retain their own licenses. Review
THIRD_PARTY_NOTICES.md before redistribution.
Product ownership: Grantex is owned by Orchestrum Technologies LLP. Inventor and owner: Sanjeev Kumar. Ownership contact: sanjeev@orchestrum.in or mishra.sanjeev@gmail.com.