1.1.2 • Published 4h ago
@verdicter/sdk
Licence
MIT
Version
1.1.2
Deps
0
Size
78 kB
Vulns
0
Weekly
322
@verdicter/sdk
Runtime security for AI agents. Evaluate every tool call against your policies - get ALLOW, DENY, or ESCALATE in under 50ms.
What is Verdicter?
Your agents act fast. Verdicter makes sure they act right.
Every tool call - across every agent, every request - passes through a policy engine in real time before it executes. No per-call code changes needed.
Agent action → verdicter.evaluate() → Policy engine → ALLOW / DENY / ESCALATE → Tool runs
→ Get your free API key at verdicter.dev
Install
npm install @verdicter/sdkQuick start
1. Get an API key at verdicter.dev - free to sign up, 10k evaluations/month on the free plan.
2. Register your agent in the dashboard and create a policy (e.g. "block any send_email where recipient is external").
3. Evaluate before every tool call:
import { Verdicter } from '@verdicter/sdk';
const verdicter = new Verdicter({
apiKey: process.env.VERDICTER_API_KEY!,
});
const { decision, modifiedPayload } = await verdicter.evaluate({
agentId: 'support_bot', // registered in your Verdicter dashboard
tool: 'send_email',
payload: { to: user.email, subject, body },
});
if (decision === 'ALLOW') await sendEmail(payload);
if (decision === 'DENY') throw new Error('Blocked by policy');
if (decision === 'ESCALATE') await requestHumanApproval(payload);Or wrap your tools - zero per-call changes:
const safeSendEmail = verdicter.wrapFn('send_email', sendEmail, {
agentId: 'support_bot',
});
// Evaluation + policy enforcement happens automatically
await safeSendEmail({ to: user.email, subject, body });LangChain adapter
import { VerdicterToolkit } from '@verdicter/sdk/langchain';
const toolkit = new VerdicterToolkit({ client: verdicter, agentId: 'support_bot' });
const guardedTools = toolkit.guardTools(tools); // wrap your existing LangChain toolsVercel AI SDK adapter
import { guardTools } from '@verdicter/sdk/vercel-ai';
const tools = guardTools(verdicter, 'support_bot', {
send_email: tool({ ... }),
});Configuration
const verdicter = new Verdicter({
apiKey: process.env.VERDICTER_API_KEY!,
timeout: 5000, // ms, default 5000
maxRetries: 2, // default 2
failOpen: false, // if true, ALLOW on network errors (default: false = fail closed)
});| Option | Type | Default | Description |
|---|---|---|---|
apiKey |
string |
required | Your Verdicter API key |
timeout |
number |
5000 |
Request timeout in ms |
maxRetries |
number |
2 |
Retries on 429/5xx |
failOpen |
boolean |
false |
ALLOW on network errors instead of throwing |
Decisions
| Decision | Meaning |
|---|---|
ALLOW |
Policy passed - run the tool |
DENY |
Policy blocked it - don't run, inform user |
ESCALATE |
Needs human review - route to your approval flow |
Dashboard
Everything is visible in your Verdicter dashboard:
- Live audit log - every evaluation with risk score, decision, and trace
- Policy editor - create rules in plain language or JSON
- Agents - register agents, track risk scores over time
- Escalations - approve/reject high-risk actions from Slack, email, or the dashboard
- Comply - SOC 2, GDPR, HIPAA reports generated from your audit log
Links
- Sign up free → verdicter.dev
- Dashboard → app.verdicter.dev
- Documentation → docs.verdicter.dev
- npm → npmjs.com/package/@verdicter/sdk
MIT License Verdicter