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

@tanolabs/shield

v0.1.0

Published

API client for Tano Shield AI security services

Readme

Tano Shield

A JavaScript client library for interacting with the Tano Shield AI security services.

Installation

npm install @tanolabs/shield
# or
yarn add @tanolabs/shield

Note: This package uses ES modules (type: "module") and requires Node.js 14.0.0 or higher. If you're using CommonJS modules, you'll need to use dynamic imports or update your project to use ES modules.

Features

  • AI Issue Detector: Protect your AI applications from harmful inputs and outputs
  • PII Redaction: Detect and redact personally identifiable information

Usage

Quick Start

import TanoShield from '@tanolabs/shield';

// Initialize the client with your API key
const tanoShield = new TanoShield({
  apiKey: 'your-api-key',
});

// Use the services
async function example() {
  try {
    // Check user input with the Issue Detector
    const firewallResult = await tanoShield.firewall.checkInput({
      system_prompt: "You are a helpful AI assistant",
      user_input: "Tell me about AI security",
      response: "I can provide information about AI security...",
      event_id: "conversation-12345",
      securityChecks: [
        "sycophancy",
        "faithfulness",
        "harmfulness",
        "implausible_output",
        "information_disclosure",
        "jailbreak"
      ]
    });
    console.log('Issue Detector check result:', firewallResult);
    
    // Redact PII from text
    const piiResult = await tanoShield.pii.redactText({
      text: 'My email is [email protected] and my phone is 555-123-4567',
    });
    console.log('Redacted text:', piiResult.redactedText);
  } catch (error) {
    console.error('Error:', error);
  }
}

example();

Using Individual Services

You can also use each service independently:

import { FirewallClient, PIIClient } from '@tanolabs/shield';

// Initialize just the Issue Detector client
const firewall = new FirewallClient({
  apiKey: 'your-api-key',
});

// Check user input
const result = await firewall.checkInput({
  user_input: 'User message here',
  system_prompt: 'You are a helpful assistant',
});

API Reference

TanoShield

The main client that provides access to all services.

const tanoShield = new TanoShield({
  apiKey: 'your-api-key',
  baseUrl: 'https://api.example.com', // Optional
  timeout: 30000, // Optional (default: 30000)
  version: 'v1', // Optional (default: 'v1')
});

Properties

  • firewall: FirewallClient instance
  • pii: PIIClient instance
  • CREDIT_CONSTANTS: Credit cost constants

Methods

  • setApiKey(apiKey): Update the API key for all services

FirewallClient (Issue Detector)

Client for the AI Issue Detector service.

Methods

  • checkInput(params): Check user input for security issues
    • params.system_prompt: The system prompt (optional)
    • params.user_input: The user input to check (required)
    • params.response: The AI response to check (optional)
    • params.event_id: A unique identifier for the event (optional)
    • params.securityChecks: Array of security checks to perform (optional)
  • getSettings(): Get Issue Detector settings
  • updateSettings(settings): Update Issue Detector settings
  • getHistory(options): Get Issue Detector call history
  • getAnalytics(options): Get Issue Detector analytics

PIIClient

Client for the PII Redaction service.

Methods

  • redactText({ text, entityTypes, maskMode }): Redact PII from text
  • detectPII({ text, entityTypes }): Detect PII in text without redacting
  • getSupportedEntityTypes(): Get supported PII entity types

Credit System

Tano Shield uses a credit system for API usage. Each API call consumes credits based on the service used.

import { CREDIT_CONSTANTS } from '@tanolabs/shield';

console.log(CREDIT_CONSTANTS.FREE_CREDITS_PER_MONTH); // 1000
console.log(CREDIT_CONSTANTS.FIREWALL_CHECK_COST);    // 1
console.log(CREDIT_CONSTANTS.PII_REDACTION_COST);     // 1

Error Handling

The library provides custom error classes for different types of errors:

import { TanoShieldError, AuthenticationError, ApiRequestError } from '@tanolabs/shield';

try {
  await tanoShield.firewall.checkInput({ user_input: 'test' });
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.error('Authentication failed:', error.message);
  } else if (error instanceof ApiRequestError) {
    console.error('API request failed:', error.message, error.status);
  } else if (error instanceof TanoShieldError) {
    console.error('Tano Shield error:', error.message, error.code);
  } else {
    console.error('Unknown error:', error);
  }
}

Example API Call

Here's an example of how to use the Issue Detector with curl:

curl -X POST https://api.tanolabs.com/api/v1/firewall-check \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "prompt": "Tell me about AI security",
  "system_prompt": "You are a helpful AI assistant",
  "user_input": "Tell me about AI security",
  "response": "I can provide information about AI security...",
  "event_id": "conversation-12345",
  "securityChecks": ["sycophancy", "faithfulness", "harmfulness", "implausible_output", "information_disclosure", "jailbreak"]
}'

License

MIT