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

shield-aeris

v0.1.0

Published

Shield of Aeris - AI Security SDK for TypeScript/JavaScript

Readme

Shield of Aeris TypeScript SDK

Protect your LLM applications from prompt injection, data leakage, and other AI security threats.

Installation

npm install @shield-aeris/sdk
# or
yarn add @shield-aeris/sdk
# or
pnpm add @shield-aeris/sdk

Quick Start

import { Shield } from '@shield-aeris/sdk';

// Initialize the client
const shield = new Shield({ apiKey: 'sk_test_your_api_key' });

// Scan a prompt
const result = await shield.scanPrompt('Hello, how can you help me today?');
console.log(`Safe: ${result.safe}`);
console.log(`Risk Score: ${result.riskScore}`);

// Handle unsafe prompts
if (!result.safe) {
  console.log(`Threats detected:`, result.threats);
}

OpenAI Integration

Automatically protect all your OpenAI API calls:

import OpenAI from 'openai';
import { Shield, UnsafePromptError } from '@shield-aeris/sdk';

const shield = new Shield({ apiKey: 'sk_test_your_api_key' });

// Wrap your OpenAI client
const client = shield.wrapOpenAI(new OpenAI());

// All calls are now automatically protected
try {
  const response = await client.chat.completions.create({
    model: 'gpt-4',
    messages: [
      { role: 'user', content: 'What is the weather like?' }
    ]
  });
  console.log(response.choices[0].message.content);
} catch (error) {
  if (error instanceof UnsafePromptError) {
    console.log('Blocked:', error.scanResult.threats);
  }
}

Manual Scanning

For more control, scan prompts and outputs manually:

import { Shield, UnsafePromptError } from '@shield-aeris/sdk';

const shield = new Shield({ apiKey: 'sk_test_your_api_key' });

async function handleUserMessage(userInput: string) {
  // Scan before sending to LLM
  const promptResult = await shield.scanPrompt(userInput);
  if (!promptResult.safe) {
    return { error: 'Your message was blocked for security reasons' };
  }

  // Call your LLM
  const llmResponse = await callYourLLM(userInput);

  // Scan the output before returning to user
  const outputResult = await shield.scanOutput(llmResponse);
  if (!outputResult.safe) {
    return { error: 'Response contained sensitive information' };
  }

  return { response: llmResponse };
}

Express/Hono Middleware

import express from 'express';
import { Shield } from '@shield-aeris/sdk';

const app = express();
const shield = new Shield({ apiKey: 'sk_test_your_api_key' });

// Add middleware to scan all incoming messages
app.use(express.json());
app.use('/api/chat', shield.middleware({ fieldName: 'message' }));

app.post('/api/chat', (req, res) => {
  // Request is already scanned - safe to process
  res.json({ response: 'Hello!' });
});

Configuration

const shield = new Shield({
  apiKey: 'sk_test_your_api_key',
  baseUrl: 'https://api.shieldofaeris.com', // Custom endpoint
  timeout: 10000, // Request timeout in milliseconds
});

Threat Types

The scanner detects the following threat types:

  • prompt_injection - Direct prompt manipulation attempts
  • indirect_injection - Injection via external content
  • jailbreak - Safety bypass attempts (DAN, etc.)
  • pii_detected - Personal identifiable information
  • data_leakage - Sensitive data exposure
  • toxic_content - Harmful or inappropriate content

Error Handling

import { 
  Shield, 
  ShieldError, 
  UnsafePromptError, 
  UnsafeOutputError 
} from '@shield-aeris/sdk';

try {
  const result = await shield.scanPrompt(userInput);
} catch (error) {
  if (error instanceof UnsafePromptError) {
    // Handle blocked prompts
    console.log('Risk score:', error.scanResult.riskScore);
    console.log('Threats:', error.scanResult.threats);
  } else if (error instanceof ShieldError) {
    // Handle API errors
    console.log('API error:', error.message);
  }
}

License

MIT License - see LICENSE for details.

Links