Skip to main content

Install

Scope-Enforced Tools

Wrap any tool function with createGrantexTool to enforce Grantex scope authorization before execution:
Before executing the tool, the wrapper verifies the token signature and claims with verifyGrantToken(), using the configured JWKS endpoint, and then checks the verified scp claim. The verifier may contact that endpoint to resolve keys, so it must be reachable. Invalid tokens and missing scopes fail before your function runs.

Audit Logging

Attach GrantexAuditHandler as a LangChain callback to automatically log every tool invocation to the Grantex audit trail:
Each tool call logs:
  • tool:<toolName> with status: 'success' on success
  • tool:error with status: 'failure' on error

API Reference

createGrantexTool(options)

Creates a LangChain DynamicTool with Grantex scope enforcement.

GrantexAuditHandler

LangChain callback handler that writes tool invocations to the Grantex audit trail.

Requirements

  • Node.js 18+
  • @grantex/sdk >= 0.1.0
  • @langchain/core >= 0.3.0

Ownership

Grantex is owned by Orchestrum Technologies LLP. Inventor and owner: Sanjeev Kumar. Ownership contact: sanjeev@orchestrum.in or mishra.sanjeev@gmail.com.

Current Authority and Human Identity

Use the exact integration version and minimum primary SDK in Release Status. Per-invocation issuer authority and trusted principal/agent binding are opt-in. Configure the callback with the trusted issuer and derive identity from the host’s authenticated session; signature and scope checks alone do not prove current revocation or human consent. See SDK execution authority for configuration, denial behavior and manifest/decision/caps boundaries.
Last modified on September 29, 2026