@glideco/grant-wrapper
v0.1.0
Published
Fresh-read tenant verification for Glide agent banking grants. Re-reads tenant from DB on every tool invocation; cached grant alone never authorizes. Implements the F3 IRON RULE money-safety contract.
Maintainers
Readme
@glideco/grant-wrapper
Fresh-read tenant verification for Glide agent banking grants. Implements the F3 IRON RULE money-safety contract: re-reads tenant from DB on every tool invocation; cached grant alone never authorizes.
Why
A bearer grant is a snapshot of authorization at issue time. Between issue and use, the principal's tenant membership might have changed (revoked, transferred, suspended). The naive pattern — trust the grant and call the tool — leaves a window where a revoked principal can still move money.
@glideco/grant-wrapper closes that window. Every tool invocation re-reads the tenant row from Postgres, compares against the grant's claims, and rejects on mismatch. The DB read is the F3 IRON RULE source of truth.
Install
npm install @glideco/grant-wrapperUsage
import { wrap } from '@glideco/grant-wrapper';
const wrapped = wrap(myTool, {
loadTenant: async (principalUserId) => db.tenants.findById(principalUserId),
});
await wrapped(grant, args); // throws if tenant mismatchLicense
MIT — see LICENSE.
Source
This package lives in the Glide OSS Cathedral monorepo. For the larger context (F-rule money-safety contracts) see apps/mcp/COMPLIANCE.md.
