@openclueo/clueobots
v1.0.14
Published
Official ClueoBots SDK for AI security integration
Maintainers
Readme
ClueoBots
AI security for your app. One line of code.
Install
npm install @openclueo/clueobotsSetup
1. Get your API key: https://clueobots.com/api-keys
2. Add to .env:
CLUEOBOTS_API_KEY=sk_cb_your_key_here3. Choose your integration style:
Simple Direct Scanning (Manual Control)
import { scan } from '@openclueo/clueobots'
// Scan any text content
const result = await scan("User input to check")
if (result.threatDetected) {
console.log(`Threat found: ${result.primaryThreat}`)
}Middleware Integration (Automatic Scanning)
Express.js:
import { expressMiddleware } from '@openclueo/clueobots'
import express from 'express'
const app = express()
app.use(expressMiddleware()) // Scans all JSON responses automaticallyFastify:
import { fastifyPlugin } from '@openclueo/clueobots'
app.register(fastifyPlugin())Koa:
import { koaMiddleware } from '@openclueo/clueobots'
app.use(koaMiddleware())Legacy Auto-Detection (Zero Config)
CommonJS:
require('@openclueo/clueobots')() // Auto-detects frameworkES Modules:
import clueobots from '@openclueo/clueobots'
clueobots() // Auto-detects frameworkNext.js (Manual Output Scanning)
import { scanOutput } from '@openclueo/clueobots/nextjs'
export async function POST(req: Request) {
const { message } = await req.json()
// Generate AI response
const aiResponse = await openai.chat.completions.create({
messages: [{ role: 'user', content: message }]
})
const content = aiResponse.choices[0].message.content
// Scan output before sending
const scan = await scanOutput(content)
if (!scan.allowed) {
return Response.json({ error: 'Response blocked for security' }, { status: 403 })
}
return Response.json({ message: content })
}Done. ClueoBots is now protecting your AI app from:
- 🛡️ Prompt injection attacks (that succeed)
- 🔒 Data exfiltration in AI responses
- ⚠️ Jailbreak attempts that bypass your defenses
- 🚨 Harmful content in AI outputs
Questions? [email protected]
Docs: https://clueoai.com/docs
License: MIT
