"The Firewall for GenAI."
Validates streams, prevents injections, and redacts secrets in real-time—entirely client-side.
We have transitioned from a utility library to a Privacy-First OS.
| Package | Role | Version |
|---|---|---|
@ai-guard/core |
The Kernel. Universal TypeScript logic. Runs in Node, Edge, or Browser (Worker). Contains the Entropy Engine and Injection Heuristics. | |
@ai-guard/react |
The UI Layer. React hooks (useAiGuard) that communicate with the Core Worker via the new Delta-Protocol. |
|
@ai-guard/playground |
Test Lab. Local environment to fuzz-test the security engines. | - |
Detects API keys, private tokens, and high-entropy secrets using Shannon Entropy analysis. It catches secrets regular Regex misses (e.g. sk-ant-12345AaBb...).
A scoring engine that detects Jailbreak attempts like "Ignore previous instructions", "DAN Mode", and "System Override".
Context-aware Regex engines that reduce false positives by checking surrounding words (e.g. 123-45 vs SSN: 123-45).
npm install @ai-guard/reactimport { useAiGuard } from '@ai-guard/react';
// Pipe your LLM stream directly through the Guard
const { scanStream } = useAiGuard({
pii: { redact: true },
blockOnInjection: true
});
// onChunkReceived:
await scanStream(newChunk);
// Returns: { safe: true, text: "[REDACTED]" }See CONTRIBUTING.md.
MIT © ShyamSathish005