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/sdkQuick 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.