Forge Verify SDK for JavaScript/TypeScript. Verify AI agent decisions with cryptographic attestation.
npm install @veritera.ai/forge-verifyimport { ForgeVerify } from "@veritera.ai/forge-verify";
const forge = new ForgeVerify({ apiKey: "vt_live_..." });
const result = await forge.verifyDecision({
agentId: "agent-1",
action: "payment.create",
params: { amount: 100, currency: "USD" },
policy: "finance-controls",
});
if (result.verified) {
// Action approved — execute it
} else {
console.log("Blocked:", result.reason);
}| Option | Type | Default | Description |
|---|---|---|---|
apiKey |
string |
required | API key (vt_live_..., vt_sandbox_...) |
baseUrl |
string |
https://forge.veritera.ai |
API base URL |
timeout |
number |
10000 |
Request timeout (ms) |
maxRetries |
number |
2 |
Retries on 5xx errors |
failClosed |
boolean |
true |
Return denied instead of throwing on errors |
debug |
boolean |
false |
Enable debug logging |
Aliases: Forge, Veritera (backward compatibility)
verifyDecision(request)— Verify an agent action against policygetProof(proofId)— Retrieve a verification proofverifyProofLocally(verification)— Verify attestation offline (Ed25519)createDelegation(request)— Create a scoped agent delegationgetUsage(period?)— Get billing usage statshealth()— Check API health
import { ForgeError, RateLimitError } from "@veritera.ai/forge-verify";
try {
await forge.verifyDecision({ ... });
} catch (err) {
if (err instanceof RateLimitError) {
// Wait err.retryAfterMs before retrying
} else if (err instanceof ForgeError) {
console.log(err.code, err.status, err.message);
}
}When failClosed: true (default), network/server errors return a denied result instead of throwing. The agent is blocked, not crashed.
After 5 consecutive failures, the SDK opens a circuit breaker for 30 seconds, immediately returning errors without hitting the API. After 30s, one request is allowed through (half-open). On success, the circuit closes.
npm uninstall @veritera.ai/sdk
npm install @veritera.ai/forge-verifyUpdate imports:
// Before
import { Veritera } from "@veritera.ai/sdk";
// After (Veritera still works as alias)
import { ForgeVerify } from "@veritera.ai/forge-verify";- Node.js >= 18.0.0
- Works with CommonJS and ESM