JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 43
  • Score
    100M100P100Q58301F
  • License MIT

ArcShield AI platform SDK - integrate threat detection and model security into your applications

Package Exports

  • @arcshield-ai/sdk
  • @arcshield-ai/sdk/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@arcshield-ai/sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@arcshield-ai/sdk

Official Node.js SDK for the ArcShield AI security platform.

Installation

npm install @arcshield-ai/sdk

Quick Start

const { ArcShieldClient } = require("@arcshield-ai/sdk");

const client = new ArcShieldClient({
  apiKey: process.env.ARCSHIELD_API_KEY,
});

// Scan a prompt for injection attacks
const result = await client.scanPrompt("Summarize this document", {
  model: "gpt-4",
  threshold: 0.9,
});

if (result.blocked) {
  console.log(`Threat detected: ${result.threat_type}`);
}

Express Middleware

const { ArcShieldClient, ArcShieldMiddleware } = require("@arcshield-ai/sdk");

const client = new ArcShieldClient();
const shield = new ArcShieldMiddleware(client);

app.use("/api/chat", shield.expressMiddleware({ policies: ["prompt-injection", "data-exfil"] }));

Configuration

Option Environment Variable Default
apiKey ARCSHIELD_API_KEY
baseUrl ARCSHIELD_BASE_URL https://api.arcshield.ai/v2
timeout 30000

License

MIT - ArcShield AI, Inc.