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

@vantio/agent-sdk

v0.2.4

Published

Vantio Optics Node SDK — shield() for Sight Loop observe. Metadata only; no prompts. Upgrade path to Gate and Phantom Engine.

Downloads

483

Readme

@vantio/agent-sdk

Vantio is the infrastructure control layer for autonomous AI. This package is Vantio Optics Observe for Node: a trace ID around your agent. It does not wrap fetch by itself — Node wrap lives in @vantio/cli (vantio run).

Optics does not block on its own. Gate enforces rules on the wrapped path. Phantom Engine is runtime protection on enrolled Linux.

npm install @vantio/agent-sdk

Quick start

import { shield } from "@vantio/agent-sdk";

await shield(async () => {
  await runMyLLMAgent();
});

Wrap your agent in shield(). Vantio generates a trace ID and propagates it through async hops — without reading your prompts. Node LLM wrap (fetch, undici, http/https, …) is vantio run from @vantio/cli, not this package.


API

shield(callback, options?) — trace context

import { shield } from "@vantio/agent-sdk";

const result = await shield(async () => {
  return await runMyAgent();
});

// With options:
await shield(async () => { ... }, {
  traceId: "custom-uuid",   // optional — generated if omitted
});

withVantio() is an alias for shield() — use either.


reportAnomaly(event, opts?) — send metadata to Gate ingest

import { shield, reportAnomaly } from "@vantio/agent-sdk";

await shield(async () => {
  await runMyAgent();

  await reportAnomaly({
    target_host:   "api.openai.com",
    bytes_severed: 14382,
    // VantioActionTaken: "OBSERVED" | "ALLOWED" | "REDACTED" | "BLOCKED_HOST" | "BLOCKED_SIZE" | "BLOCKED_SPEND"
    action_taken:  "BLOCKED_HOST",
    pid:           process.pid,
  });
});

Requires VANTIO_CLOUD_INGEST=true and VANTIO_API_KEY to be set. Non-fatal — telemetry failures never crash your agent.


Policy & redaction (Vantio Gate)

Enforcement policy is served by the Vantio Pro control plane; the SDK applies it locally — Vantio is not a network proxy. The SDK ships two building blocks so you can fetch and enforce that policy yourself.

fetchPolicy(apiKey, opts?) — load the cloud-managed policy

import { fetchPolicy, type VantioPolicy } from "@vantio/agent-sdk";

const policy: VantioPolicy = await fetchPolicy(process.env.VANTIO_API_KEY!);
// { enforce, redact_pii, pii_types, allowed_hosts,
//   blocked_hosts, max_request_bytes, spend_cap_usd }

GETs /api/v1/config with the x-vantio-identity header. Fails open: on any error — network failure, non-2xx, malformed body, or timeout — it returns a permissive copy of DEFAULT_POLICY so an unreachable control plane can never block your agent. Options: ingestUrl, timeoutMs (default 5000), signal.

redactPII(text, piiTypes?) — strip PII locally

import { redactPII } from "@vantio/agent-sdk";

const { text, redactions } = redactPII("ssn 123-45-6789, mail [email protected]");
// text       → "ssn [VANTIO_REDACTED:SSN], mail [VANTIO_REDACTED:EMAIL]"
// redactions → ["ssn", "email"]

A pure, side-effect-free function — nothing ever leaves your process. Supports ssn, email, credit_card, and phone (defaults to all four), using the same patterns and [VANTIO_REDACTED:LABEL] tokens as the CLI interceptor.

The VantioActionTaken union ("OBSERVED" | "ALLOWED" | "REDACTED" | "BLOCKED_HOST" | "BLOCKED_SIZE" | "BLOCKED_SPEND") is also exported for typing your own enforcement reporting.


getCurrentTraceId() — read the active trace ID

import { getCurrentTraceId } from "@vantio/agent-sdk";

await shield(async () => {
  const id = getCurrentTraceId(); // always defined inside shield()
  console.log(`Trace: ${id}`);
});

getCurrentTraceId(); // undefined — outside shield() frame

Environment variables

| Variable | Description | |---|---| | VANTIO_API_KEY | Gate API key from a trial ([email protected]) or Stripe once live — /dashboard redirects to docs | | VANTIO_INGEST_URL | Ingest endpoint (default: https://vantio.ai) | | VANTIO_CLOUD_INGEST | Set to true to enable cloud routing | | VANTIO_AUDIT_MODE | Set to 1 to flag events as audit mode |


Zero-line Node wrap

No code changes for Node — use the CLI:

npx @vantio/cli run node agent.js

Python needs vantio-agent-sdk on that interpreter. Prefixing vantio run python does not intercept by itself.


What gets captured

  • Which LLM endpoint was called
  • Response size in bytes
  • Process ID and timestamp
  • A trace ID linking all calls in the same agent run

What never gets captured: prompts, completions, or any content from your requests.


vantio.ai · Optics · Pricing · MIT License