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

@infisical/agent-vault-sdk

v0.5.0

Published

The official TypeScript SDK for Agent Vault

Readme

Agent Vault TypeScript SDK

The official TypeScript SDK for Agent Vault, an open-source credential brokerage layer for AI agents. Agent Vault sits between development agents and target services, proxying requests and injecting credentials so agents never see raw keys or tokens.

Installation

npm install @infisical/agent-vault-sdk

Quickstart

Configure a sandbox with transparent proxy

The primary use case: your backend orchestrates agent sandboxes (Docker, Daytona, E2B, etc.) and needs to route their HTTPS traffic through Agent Vault so agents never see credentials. One call gives you everything you need.

import { AgentVault, buildProxyEnv } from "@infisical/agent-vault-sdk";

const av = new AgentVault({
  token: "YOUR_AGENT_TOKEN",
  address: "http://localhost:14321",
});

const vault = av.vault("my-project");

// Mint a scoped session — returns the token + container config in one call
const session = await vault.sessions!.create({ ttlSeconds: 3600 });

// Build the full env var set with your chosen CA cert mount path
const certPath = "/etc/ssl/agent-vault-ca.pem";
const env = buildProxyEnv(session.containerConfig!, certPath);

// Pass to your container runtime — the agent inside just calls
// fetch("https://api.stripe.com/v1/charges") normally.
// Agent Vault intercepts, injects credentials, and forwards.

session.containerConfig includes:

| Field | Description | |---|---| | env.HTTPS_PROXY | MITM proxy URL with the scoped token embedded | | env.NO_PROXY | Bypass list (localhost,127.0.0.1) | | caCertificate | Root CA PEM content — mount this into the container |

buildProxyEnv() expands the config with NODE_USE_ENV_PROXY=1 (for Node.js v22.21.0+ native proxy support) and CA trust variables (SSL_CERT_FILE, NODE_EXTRA_CA_CERTS, REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE, GIT_SSL_CAINFO, DENO_CERT) all pointing at certPath.

containerConfig is null when the server has MITM disabled (--mitm-port 0).

Example: Docker

import { execSync } from "child_process";
import { writeFileSync } from "fs";

const certPath = "/etc/ssl/agent-vault-ca.pem";
const env = buildProxyEnv(session.containerConfig!, certPath);

// Write the CA cert to a temp file for mounting
const tmpCert = "/tmp/agent-vault-ca.pem";
writeFileSync(tmpCert, session.containerConfig!.caCertificate);

const envFlags = Object.entries(env).map(([k, v]) => `-e ${k}=${v}`).join(" ");
execSync(`docker run --rm ${envFlags} -v ${tmpCert}:${certPath}:ro my-agent-image`);

Example: Daytona

import { Daytona } from "@daytonaio/sdk";

const daytona = new Daytona();
const certPath = "/etc/ssl/agent-vault-ca.pem";
const env = buildProxyEnv(session.containerConfig!, certPath);

const workspace = await daytona.create({
  image: "my-agent-image",
  envVars: env,
  // Mount session.containerConfig.caCertificate at certPath
});

Set up a vault

Depending on your use case, vault setup may already be done via the CLI or dashboard. Here's the programmatic equivalent:

import { AgentVault } from "@infisical/agent-vault-sdk";

const av = new AgentVault({
  token: "YOUR_AGENT_TOKEN",
  address: "http://localhost:14321",
});

// Create a vault and get a scoped client
await av.createVault({ name: "my-project" });
const vault = av.vault("my-project");

// Store a credential
await vault.credentials.set({ STRIPE_KEY: "sk_live_abc" });

// Configure a proxy rule — the token field references the credential key above
await vault.services!.set([
  {
    host: "api.stripe.com",
    description: "Stripe API",
    auth: { type: "bearer", token: "STRIPE_KEY" },
  },
]);

Error handling

The SDK throws ApiError for non-2xx responses from Agent Vault control-plane endpoints. Upstream HTTP errors from agent-issued traffic — which travels through HTTPS_PROXY, not the SDK — surface in the agent's normal HTTP client.

Documentation

For comprehensive SDK reference and advanced usage, see the documentation.

Releasing

Releases are automated via GitHub Actions using npm OIDC trusted publishing. Push a git tag matching node-sdk/v<version> (e.g., node-sdk/v0.2.0) to trigger a publish.