
Security News
GPT-6 Astra Attempts Supply Chain Attacks Against Open Source Maintainers in Testing
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.
@grantex/strands
Advanced tools
Strands Agents SDK integration for the Grantex delegated authorization protocol
Strands Agents SDK integration for the Grantex delegated authorization protocol.
Create Strands tools that verify Grantex grant tokens and enforce scopes before tool execution.
npm install @grantex/strands @grantex/sdk @strands-agents/sdk zod
import { Agent } from '@strands-agents/sdk';
import { createGrantexTool } from '@grantex/strands';
import { z } from 'zod';
const readCalendar = createGrantexTool({
name: 'read_calendar',
description: 'Read upcoming calendar events',
inputSchema: z.object({
date: z.string().describe('Date in YYYY-MM-DD format'),
}),
grantToken,
requiredScope: 'calendar:read',
callback: async ({ date }) => {
return `events for ${date}`;
},
});
const agent = new Agent({
tools: [readCalendar],
});
If the verified grant token does not include the required scope, the tool throws GrantexScopeError before invoking your callback.
Verified mode is the default. It verifies the grant token against JWKS and checks the verified scp claim:
const tool = createGrantexTool({
name: 'read_calendar',
description: 'Read upcoming calendar events',
inputSchema: z.object({ date: z.string() }),
grantToken,
requiredScope: 'calendar:read',
callback: async ({ date }) => getCalendarEvents(date),
});
Online mode delegates enforcement to a Grantex client:
const tool = createGrantexTool({
name: 'read_calendar',
description: 'Read upcoming calendar events',
inputSchema: z.object({ date: z.string() }),
grantToken,
requiredScope: 'calendar:read',
client: grantexClient,
connector: 'calendar',
online: true,
callback: async ({ date }) => getCalendarEvents(date),
});
createGrantexTool(options)Creates a Strands-compatible tool with Grantex scope enforcement.
| Option | Type | Description |
|---|---|---|
name | string | Tool name |
description | string | Tool description |
inputSchema | z.ZodType | Zod schema for tool input |
grantToken | string | JWT grant token from Grantex |
requiredScope | string | Scope that must be present in the token |
callback | (input, context?) => Promise<Result> | Result | Tool implementation |
jwksUri | string | JWKS URL used to verify the grant token |
issuer, issuerDid, audience | string | Optional JWT claim validation settings |
clockTolerance | number | Clock tolerance in seconds for token verification |
client | GrantexEnforcer | Grantex client instance for online mode |
connector | string | Connector name for online mode |
online | boolean | Use client.enforce() instead of JWKS-backed local verification |
amount | number | Optional capped-amount value for online enforcement |
getGrantScopes(grantToken)Returns the scopes embedded in a grant token. Invalid tokens return an empty array. This helper decodes the token payload only; it does not verify the signature.
GrantexScopeErrorError thrown when the verified grant token is missing the required scope.
@grantex/sdk >= 0.3.11@strands-agents/sdk >= 1.6.0zod >= 4.1.12This package is part of the Grantex ecosystem. See also:
@grantex/sdk - Core TypeScript SDK@grantex/langchain - LangChain integration@grantex/vercel-ai - Vercel AI SDK integration@grantex/autogen - AutoGen integrationApache 2.0
FAQs
Strands Agents SDK integration for the Grantex delegated authorization protocol
The npm package @grantex/strands receives a total of 21 weekly downloads. As such, @grantex/strands popularity was classified as not popular.
We found that @grantex/strands demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.

Product
Socket can now send alerts and supply chain attack notifications to Microsoft Teams, with filters that route the right updates to each channel.

Security News
pnpm 12 rewrites the package manager in Rust, cutting install times by up to 90% while preserving pnpm 11 workflows and lockfiles.