
Security News
/Company News
Securing the Financial Frontier: How Capital One Uses Socket for Open Source Security
Capital One is partnering with Socket to proactively secure its open source supply chain.
@haiec/kill-switch-sdk
Advanced tools
5-layer AI system kill switch with automated compliance monitoring
5-layer AI system kill switch with automated compliance monitoring for EU AI Act Article 14.
npm install @haiec/kill-switch
import { KillSwitch } from '@haiec/kill-switch';
// Initialize
const ks = new KillSwitch({
apiKey: process.env.HAIEC_API_KEY,
systemId: 'hiring-ai-prod',
mode: 'semi-auto' // 'manual' | 'semi-auto' | 'full-auto'
});
// Report metrics from your AI system
await ks.reportMetrics({
accuracy: 0.85,
biasScore: 0.12,
latencyP95: 1.5,
errorRate: 0.02
});
// SDK automatically triggers kill switch if thresholds exceeded
// Or manually trigger:
await ks.trigger({
layer: 2,
reason: 'Manual intervention - suspicious pattern detected'
});
// Recover system
await ks.recover('Issue resolved - model retrained');
new KillSwitch(config)const ks = new KillSwitch({
apiKey: string, // Your HAIEC API key
systemId: string, // Unique system identifier
mode?: 'manual' | 'semi-auto' | 'full-auto',
baseUrl?: string, // Optional custom API URL
onTrigger?: (event) => void, // Callback when kill switch triggers
onRecover?: (event) => void, // Callback when system recovers
onError?: (error) => void // Error handler
});
reportMetrics(metrics)Report metrics (batched, async):
await ks.reportMetrics({
accuracy?: number,
biasScore?: number,
errorRate?: number,
latencyP50?: number,
latencyP95?: number,
latencyP99?: number,
throughput?: number,
customMetrics?: Record<string, number>
});
reportMetricsSync(metrics)Report metrics and get immediate response with trigger status.
trigger(options)Manually trigger kill switch:
await ks.trigger({
layer: 1 | 2 | 3 | 4 | 5,
reason: string,
escalate?: boolean,
notifyChannels?: ('slack' | 'pagerduty' | 'email' | 'webhook')[]
});
triggerLayer(layer, reason)Shorthand to trigger specific layer.
triggerAll(reason)Trigger all layers (full kill).
recover(notes?)Recover system to healthy state.
getState()Get current system state.
setMode(mode)Change automation mode.
createRule(rule)Create automation rule:
await ks.createRule({
metricName: 'accuracy',
thresholdValue: 0.70,
thresholdOperator: '<',
layer1Action: 'throttle_50',
layer2Action: 'open_circuit',
layer3Action: 'require_approval',
minDurationSeconds: 30,
cooldownMinutes: 5
});
getRules()List all automation rules.
getAuditLog(options?)Get audit log entries.
connectRealtime()Connect WebSocket for real-time updates.
import { killSwitchMiddleware } from '@haiec/kill-switch';
app.use('/api/ai/*', killSwitchMiddleware({
apiKey: process.env.HAIEC_API_KEY,
systemId: 'hiring-ai-prod'
}));
Automatically blocks requests when system is killed or throttled.
const ks = new KillSwitch({
apiKey: process.env.HAIEC_API_KEY,
systemId: 'hiring-ai-prod',
onTrigger: (event) => {
console.log('Kill switch activated!', event);
notifySlack(`AI system killed: ${event.reason}`);
activateFallbackSystem();
},
onRecover: (event) => {
console.log('System recovered', event);
deactivateFallbackSystem();
}
});
All actions require human approval. Alerts sent but no auto-trigger.
All configured layers auto-trigger. Fastest response, highest automation.
MIT
FAQs
5-layer AI system kill switch with automated compliance monitoring
The npm package @haiec/kill-switch-sdk receives a total of 6 weekly downloads. As such, @haiec/kill-switch-sdk popularity was classified as not popular.
We found that @haiec/kill-switch-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
/Company News
Capital One is partnering with Socket to proactively secure its open source supply chain.

Security News
Socket CTO Ahmad Nassri discusses how to keep AI agents from bypassing package blocks, limit credential access, and monitor their actions.

Security News
GPT-6 Astra tried to plant malicious code in simulated open source projects using fake GitHub accounts and deceptive PRs during an assigned CTF challenge.