Follow this guide to integrate Intent Firewall into your infrastructure and start protecting your APIs from malicious AI interactions.
npm install @vibe-security/intent-firewallpip install vibe-security-firewallVIBE_SECURITY_API_KEY=your_api_key_here
VIBE_SECURITY_ENDPOINT=https://api.vibesecurity.com
FIREWALL_MODE=proxy # or sidecarimport { IntentFirewall } from '@vibe-security/intent-firewall';
const firewall = new IntentFirewall({
apiKey: process.env.VIBE_SECURITY_API_KEY,
mode: 'proxy',
policies: ['data-protection', 'rate-limiting']
});import express from 'express';
import { IntentFirewall } from '@vibe-security/intent-firewall';
const app = express();
const firewall = new IntentFirewall({ /* config */ });
// Apply firewall to all routes
app.use(firewall.middleware());
// Or protect specific routes
app.get('/api/users', firewall.protect(), (req, res) => {
// Your API logic here
res.json({ users: [] });
});// Pre-request validation
const validation = await firewall.validateRequest({
method: 'GET',
url: '/api/users',
headers: req.headers,
body: req.body,
agentId: 'ai-assistant-v1'
});
if (!validation.allowed) {
return res.status(403).json({
error: 'Request blocked by Intent Firewall',
violations: validation.violations
});
}
// Your API logic here
const apiResponse = await yourApiLogic();
// Post-response validation
const responseValidation = await firewall.validateResponse(
validation.context,
apiResponse
);
if (!responseValidation.allowed) {
// Log the violation and return filtered response
console.warn('Response validation failed:', responseValidation.violations);
return res.json(responseValidation.filteredResponse);
}
res.json(apiResponse);curl -X GET "http://localhost:3000/api/users?limit=10" \
-H "Content-Type: application/json" \
-H "X-Agent-ID: ai-assistant-v1"
# Expected: 200 OK with user datacurl -X GET "http://localhost:3000/api/users/export" \
-H "Content-Type: application/json" \
-H "X-Agent-ID: malicious-agent"
# Expected: 403 Forbidden with violation details