
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
@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 3 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.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.