Node.js / TypeScript SDK for the SIGIL Protocol — crowdsourced scanner patterns and security policies for AI agents and MCP tools.
npm install sigil-sdkFor pattern/policy submission (write operations), also install the Ed25519 signer:
npm install @noble/ed25519import { RemoteScanner } from 'sigil-sdk';
// Fetches 43+ verified patterns at startup, falls back to built-ins if offline
const scanner = await RemoteScanner.fromRegistry();
console.log(`Loaded ${scanner.ruleCount} rules from: ${scanner.source}`);
const hit = scanner.scan('Authorization: Bearer sk-abc123...');
if (hit) {
console.log(`Sensitive: ${hit.name} (${hit.severity})`);
// → { name: 'openai_api_key', category: 'credential', severity: 'critical', hint: '[SIGIL-VAULT: OPENAI_KEY]' }
}const clean = scanner.redact(`
export OPENAI_API_KEY=sk-abc123...
export DB_URL=postgres://user:pass@host/db
`);
// → All matches replaced with their vault hintsconst scanner = await RemoteScanner.fromUrl('http://localhost:3100/patterns/bundle');import { SigilClient } from 'sigil-sdk';
import { etc } from '@noble/ed25519';
const privateKey = etc.randomPrivateKey(); // or load from secure store
const client = new SigilClient();
await client.submitPattern({
name: 'my_api_key',
description: 'My service API key (msk_ prefix)',
category: 'credential',
pattern: 'msk_[a-zA-Z0-9]{32}',
severity: 'high',
authorDid: 'did:sigil:my_namespace_01',
privateKey,
});| Method / Property | Description |
|---|---|
RemoteScanner.fromRegistry() |
Static async constructor — fetches from registry.sigil-protocol.org |
RemoteScanner.fromUrl(url) |
Static async constructor — fetches from a custom URL |
.scan(text) |
Returns ScanHit | null |
.redact(text) |
Returns text with all matches replaced by vault hints |
.ruleCount |
Number of compiled rules loaded |
.source |
'registry' or 'fallback' |
interface ScanHit {
name: string; // e.g. "aws_access_key_id"
category: string; // e.g. "credential"
hint: string; // e.g. "[SIGIL-VAULT: AWS_KEY_ID]"
severity: string; // "low" | "medium" | "high" | "critical"
}| Method | Description |
|---|---|
new SigilClient(base?) |
Optionally point at a custom registry base URL |
.submitPattern(opts) |
POST a new scanner pattern (requires Ed25519 private key) |
.submitPolicy(opts) |
POST a new security policy (requires Ed25519 private key) |
SigilClient.signMessage(key, msg) |
Static signing helper using @noble/ed25519 |
Live API: registry.sigil-protocol.org
API Docs: sigil-protocol.org/registry.html
Rust crate: crates.io/crates/sigil-protocol
MIT