
Security News
Re-Enabled GitHub Actions Expose Thousands of Repositories to Mini Shai-Hulud
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.
ai-agent-guardrails
Advanced tools
Production-grade tool firewall for AI SDK agents with approval gates, budgets, and audit logging
Security middleware for AI SDK that adds production-grade controls to agent tool calling.
npm install ai-agent-guardrails ai zod
# or
pnpm add ai-agent-guardrails ai zod
import { streamText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { guardTools, createSimplePolicy, ConsoleAuditSink } from 'ai-agent-guardrails';
// Define policy
const policy = createSimplePolicy({
denylist: ['delete_database'], // Block dangerous tools
requireApprovalForRisk: ['write', 'admin'], // Require approval for these
});
// Wrap tools with guardrails
const tools = guardTools(myTools, {
policy,
audit: new ConsoleAuditSink(),
timeoutMs: 10_000,
});
// Use in AI SDK
const result = streamText({
model: openai('gpt-4o-mini'),
messages,
tools, // ← Guarded tools
});
import { createMCPClient } from '@ai-sdk/mcp';
import { guardTools, createSimplePolicy } from 'ai-agent-guardrails';
// Connect to MCP server
const mcp = await createMCPClient({ transport: ... });
const mcpTools = await mcp.tools();
// Apply guardrails
const policy = createSimplePolicy({
requireApprovalForRisk: ['write', 'admin'],
});
const tools = guardTools(mcpTools, { policy });
'use client';
import { useChat } from '@ai-sdk/react';
export default function Chat() {
const { messages, addToolApprovalResponse } = useChat();
return (
<>
{messages.map(m =>
m.parts?.map(part => {
if (part.state === 'approval-requested') {
return (
<div>
<p>Tool requires approval: {part.type}</p>
<button onClick={() => addToolApprovalResponse({ id: part.approval.id, approved: true })}>
Approve
</button>
<button onClick={() => addToolApprovalResponse({ id: part.approval.id, approved: false })}>
Deny
</button>
</div>
);
}
})
)}
</>
);
}
import { createDefaultContext } from 'ai-agent-guardrails';
const ctx = createDefaultContext();
ctx.maxToolCalls = 5; // Limit to 5 tool calls
ctx.maxDurationMs = 30_000; // 30 second timeout
const tools = guardTools(myTools, { policy, ctx });
import { InMemoryAuditSink, ConsoleAuditSink, FileAuditSink } from 'ai-agent-guardrails';
// Console (dev)
const audit = new ConsoleAuditSink();
// Memory (testing)
const audit = new InMemoryAuditSink();
const events = audit.getEvents();
// File (production)
const audit = new FileAuditSink('./audit.jsonl');
import { createDefaultRedactor, createFieldRedactor } from 'ai-agent-guardrails';
// Automatic pattern-based redaction
const redactor = createDefaultRedactor();
// Field-based redaction
const redactor = createFieldRedactor(['password', 'apiKey', 'secret']);
const tools = guardTools(myTools, { policy, redactor });
MIT © Krish Gupta
FAQs
Production-grade tool firewall for AI SDK agents with approval gates, budgets, and audit logging
The npm package ai-agent-guardrails receives a total of 0 weekly downloads. As such, ai-agent-guardrails popularity was classified as not popular.
We found that ai-agent-guardrails 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
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.

Research
/Security News
The compromise affects MemTensor's MemOS, an open source memory framework for large language models (LLMs) and AI agents. Both npm package @memtensor/memos-cloud-openclaw-plugin and the PyPI package MemoryOS are compromised. They drop cross-platform Go binaries that exfiltrate developer secrets.