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

@gns-aip/openai

v0.1.0

Published

GNS-AIP identity, compliance, and delegation for OpenAI Agents SDK

Downloads

19

Readme

openai-gns-aip

GNS-AIP identity, compliance, and delegation for the OpenAI Agents SDK.

Part of the GNS-AIP monorepo — the Agent Identity Protocol for the EU AI Act era.

Quick Start

import { Agent, run, BatchTraceProcessor, setTraceProcessors } from '@openai/agents';
import { GNSAgentHooks, GNSTracingExporter, createGNSDelegationTool } from 'openai-gns-aip';

// 1. Provision agent identity with lifecycle hooks
const hooks = await GNSAgentHooks.provision({
  backendUrl: 'https://gns-browser-production.up.railway.app',
  agentType: 'autonomous',
  agentHandle: 'my-agent',
  homeCells: ['8a2a1072b59ffff'],
});

// 2. Delegate to a human principal
await hooks.delegate('ed25519-human-public-key', {
  scope: { actions: ['search', 'code'] },
});

// 3. Set up tracing exporter for compliance audit trail
const exporter = new GNSTracingExporter({
  backendUrl: 'https://gns-browser-production.up.railway.app',
  agentId: hooks.id!,
});
setTraceProcessors([new BatchTraceProcessor(exporter)]);

// 4. Create agent with GNS-AIP hooks + delegation tool
const agent = new Agent({
  name: 'Compliant Agent',
  instructions: 'Before sensitive actions, verify your authorization using gns_check_delegation.',
  hooks,
  tools: [
    createGNSDelegationTool({
      backendUrl: 'https://gns-browser-production.up.railway.app',
      agentId: hooks.id!,
    }),
  ],
});

// 5. Run — everything is automatically tracked
const result = await run(agent, 'Search for EU AI Act compliance requirements');
console.log(result.finalOutput);

Features

GNSAgentHooks — Lifecycle Identity

Extends the OpenAI Agents SDK AgentHooks interface to create breadcrumbs for every lifecycle event:

| Hook | Event | |------|-------| | onStart | Agent begins execution | | onEnd | Agent produces final output | | onHandoff | Control transfers to another agent | | onToolStart | Tool execution begins | | onToolEnd | Tool execution completes |

Privacy by design — hooks record metadata (timing, tool names, output lengths) but never log actual prompts, completions, or tool inputs.

GNSTracingExporter — Compliance Audit Trail

Plugs into the OpenAI Agents SDK's built-in tracing system via BatchTraceProcessor. Every trace span becomes a GNS-AIP breadcrumb with:

  • Span classification: oai_agent, oai_generation, oai_tool, oai_handoff, oai_guardrail
  • Safe metadata: model name, token counts, duration, error status
  • Zero content leakage: prompts and completions are never stored

createGNSDelegationTool — In-Conversation Verification

A function tool the agent can call mid-conversation to verify its own authorization:

Agent: "Let me verify my authorization before searching..."
→ calls gns_check_delegation({ action: "search" })
→ { authorized: true, complianceTier: "VERIFIED", summary: "✓ Agent authorized..." }

createGNSComplianceGuardrail — Input Gate

An input guardrail that blocks agent execution if compliance tier is below minimum:

const agent = new Agent({
  name: 'Sensitive Agent',
  inputGuardrails: [
    createGNSComplianceGuardrail({
      agentId: hooks.id!,
      minimumTier: 'VERIFIED',
    }),
  ],
});

Compliance Tiers

| Tier | Score | Requirements | |------|-------|-------------| | SHADOW | 0-24 | No delegation, no history | | BASIC | 25-49 | Valid delegation chain | | VERIFIED | 50-74 | + Territory compliance + operation history | | TRUSTED | 75-89 | + Staking + clean record | | SOVEREIGN | 90-100 | Full compliance, all checks passing |

Architecture

┌────────────────────────────────────────────┐
│          Your OpenAI Agent                  │
│  Agent({ hooks, tools, inputGuardrails })   │
├────────────────────────────────────────────┤
│    openai-gns-aip (this package)            │
│  GNSAgentHooks │ GNSTracingExporter │ Tool  │
├────────────────────────────────────────────┤
│         @gns-aip/sdk (core SDK)             │
│    provision │ delegate │ breadcrumbs       │
├────────────────────────────────────────────┤
│         GNS Backend (Railway)               │
│    /agents │ /compliance │ /breadcrumbs     │
└────────────────────────────────────────────┘

License

MIT — GNS Foundation