npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gatra-sdk

v0.1.9

Published

Official TypeScript/JavaScript SDK for GATRA Zero-Trust AI Agent Security Engine

Readme

gatra-sdk: Zero-Trust AI Agent Security SDK

Official Node.js & TypeScript client SDK for GATRA — the Zero-Trust Security Proxy & Control Plane for AI Agents, Model Context Protocol (MCP) servers, and LLM tool calls.


Overview

gatra-sdk provides native, zero-dependency TypeScript/JavaScript utilities for orchestrating autonomous AI agents behind a GATRA Security Proxy. It enables agent orchestrators (LangChain, CrewAI, AutoGen, or custom MCP clients) to mint local Ed25519 capability tokens and route tool calls through GATRA's cryptographic policy engine.

┌─────────────────┐       ┌───────────────────────────────┐       ┌─────────────────┐
│                 │  HTTP │    GATRA Security Proxy       │  HTTP │                 │
│   LLM Agent /   ├──────>│  • Ed25519 Token Auth         ├──────>│   Downstream    │
│  Orchestrator   │       │  • Stateful Trajectory Caps   │       │   MCP Tool /    │
│  (gatra-sdk)    │       │  • Schema Auto-Discovery      │       │   API Target    │
└─────────────────┘       └───────────────────────────────┘       └─────────────────┘

Key Features

  • Asymmetric Token Minting: Mint short-lived, Ed25519-signed capability tokens locally without contacting a central authorization server.
  • Proxy Client Wrapper: Executing requests through GatraClient automatically injects security headers (X-Capability-Token, X-Gatra-Directive).
  • Ephemeral Task Directives: Pass runtime, per-task guardrails directly in requests while preserving GATRA's Monotonic Restriction Principle.
  • Zero Heavy Dependencies: Fully typed, lightweight, and optimized for Node.js (>= 18), Bun, and modern JS runtimes.

Installation

npm install gatra-sdk

Quickstart

Prerequisite: Ensure you have generated an Ed25519 keypair and the GATRA proxy is running locally on port 8080:

# 1. Generate Ed25519 keypair (prints Public Key and Private Key)
./bin/gatra gen-keys -t session_101 -p "*" --json

# 2. Start proxy using the generated PUBLIC key
./bin/gatra start -c policy.json -k "<YOUR_PUBLIC_KEY>" --port 8080 --target http://localhost:3000

1. Basic Token Minting & Tool Execution

import { GatraTokenIssuer, GatraClient } from 'gatra-sdk';

// Step 1: Initialize Token Issuer with your generated PRIVATE key
const issuer = new GatraTokenIssuer('YOUR_BASE64_PRIVATE_KEY');

// Step 2: Mint a capability token bound to a specific trajectory/session
const capabilityToken = issuer.mintToken('session_101', '*');

// Step 3: Initialize GATRA Client pointing to your proxy instance at localhost:8080
const client = new GatraClient('http://localhost:8080', capabilityToken);

// Step 4: Execute a tool call safely through GATRA Proxy
async function runTool() {
  const { status, data, latencyMs } = await client.executeTool('/v1/action', {
    amount: 25.00,
    currency: 'USD'
  });

  console.log(`[HTTP ${status}] Executed in ${latencyMs}ms:`, data);
}

runTool();

Ephemeral Task Directives

Orchestrators can dynamically inject tighter guardrails for a specific execution step without altering global proxy policies:

// Define an ephemeral constraint for this specific invocation
const ephemeralDirective = JSON.stringify({
  max_per_call: 30.00,
  condition: "payload.currency == 'USD'"
});

// Execute request with directive attached
const { status, data } = await client.executeTool(
  '/v1/action',
  { amount: 25.00, currency: 'USD' },
  { directive: ephemeralDirective }
);

API Reference

GatraTokenIssuer

  • constructor(privateKeyBase64: string) — Initializes issuer with an Ed25519 private key.
  • mintToken(trajectoryId: string, toolPattern: string, options?: TokenOptions): string — Signs and returns a compact Ed25519 capability token.

GatraClient

  • constructor(proxyUrl: string, capabilityToken?: string) — Initializes proxy client targeting a GATRA gateway.
  • executeTool(path: string, payload: Record<string, any>, options?: ExecuteOptions) — Dispatch HTTP POST requests with automatically managed security headers.

Resources


License

Distributed under the MIT License.