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

@devendurance/agentguard-sdk

v0.1.1

Published

AgentGuard is a risk firewall and middleware SDK for AI trading agents. It wraps a trading or execution client, evaluates each order intent against deterministic policy rules, and only forwards approved or resized orders.

Readme

AgentGuard SDK

AgentGuard is a risk firewall and middleware SDK for AI trading agents. It wraps a trading or execution client, evaluates each order intent against deterministic policy rules, and only forwards approved or resized orders.

It is built for Bitget-style trading infrastructure demos where model-generated trade intent must pass through a hard safety boundary before execution.

Install From Packed Tarball

From the repository root:

npm pack ./packages/sdk
npm install ./agentguard-sdk-0.1.0.tgz

For local development in this repo, you can also import directly from packages/sdk/src.

Judge Quickstart

From the repository root:

npm install
npm run demo:judge
npm run sdk:pack

demo:judge does not require private Bitget API keys. It runs the trading-agent dry-run demo, regenerates sample dashboard data, and builds the SDK package.

Paper authentication is optional:

npm run demo:paper-auth

The paper auth probe requires Bitget Demo API keys and all paper env flags. It is read-only and does not place orders.

Minimal Usage

import {
  AgentGuard,
  BitgetMcpAdapter,
  createAgentGuardedClient,
  type AccountState,
  type MarketState,
  type RiskPolicy,
} from "@agentguard/sdk";

const policy: RiskPolicy = {
  mode: "active",
  maxLeverage: 5,
  maxOrderUsd: 250,
  maxDailyDrawdownPct: 3,
  allowedSymbols: ["BTCUSDT", "ETHUSDT", "SOLUSDT"],
  failClosed: true,
  actions: {
    onOversizedOrder: "resize",
    onDrawdownBreach: "flatten",
    onUnknownRiskState: "block",
  },
};

const guard = new AgentGuard({ policy });
const executionClient = new BitgetMcpAdapter({ mode: "dry_run" });

const accountStateProvider = async (): Promise<AccountState> => ({
  equityUsd: 1000,
  dailyPnlUsd: 0,
  dailyDrawdownPct: 0,
});

const marketStateProvider = async (): Promise<MarketState> => ({
  symbol: "BTCUSDT",
  riskRegime: "normal",
  sentiment: "neutral",
  source: "mock",
});

const guardedClient = createAgentGuardedClient(
  executionClient,
  guard,
  accountStateProvider,
  marketStateProvider
);

const result = await guardedClient.placeOrder({
  symbol: "BTCUSDT",
  side: "buy",
  orderType: "market",
  notionalUsd: 100,
  leverage: 2,
});

console.log(result.decision.action);
console.log(result.forwarded);

Safety Modes

  • dry_run: default demo execution mode. It returns Bitget-shaped payloads but does not send orders.
  • paper: paper/demo trading is gated and not enabled for order placement by default.
  • live: live trading is not implemented for this hackathon build.

AgentGuard is designed to fail closed when required account or market state is missing and failClosed is enabled.

What Is Real Today

  • SDK policy loading, validation, risk decisions, guarded wrapping, and event logging work.
  • Real Bitget public market data works through the read-only public market provider.
  • Paper read-only auth probing works with Bitget demo credentials and paptrading: 1.
  • Execution is dry-run by default. Paper order execution is planned but remains safety-gated and is not enabled by default.
  • No live trading implementation is included.

Demo Commands

Run these from the repository root:

npm run demo:basic
npm run demo:bitget-dry-run
npm run demo:market-risk
npm run demo:skill-hub-state
npm run demo:dashboard-data
npm run demo:bitget-public-market
npm run demo:trading-agent-integration
npm run demo:bitget-auth-preflight
npm run demo:bitget-env-doctor
npm run demo:bitget-paper-connectivity
npm run demo:paper-auth

Use the paper account probe only with Bitget Demo API credentials and the required paper flags. Do not use live keys for paper testing.