Skip to main content
The official TypeScript/JavaScript SDK for QWED.

Installation

Quick start

Configuration

Verification methods

verify(query)

Auto-detect and verify any claim.

verifyMath(expression)

Verify mathematical expressions.

verifyLogic(query)

Verify logical constraints using QWED-Logic DSL.

verifyCode(code, options)

Check code for security vulnerabilities.

verifyFact(claim, context)

Verify factual claims against a provided context.

verifySQL(query, schema)

Validate SQL queries against a schema.

verifyProcess(reasoningTrace, options)

New in v4.0.1
Validate the structural integrity of LLM reasoning traces. Use this to ensure workflows follow deterministic process steps with IRAC pattern matching or custom milestone validation.
You can also verify custom milestones:

verifyRAG(targetDocumentId, retrievedChunks, options)

New in v4.0.1
Verify that retrieved RAG chunks originate from the expected source document. This prevents Document-Level Retrieval Mismatch (DRM) hallucinations in RAG pipelines.

verifyBatch(items)

Verify multiple items at once.

Agent verification

New in v4.0.1
The TypeScript SDK supports the QWED Agent API for registering AI agents and verifying their actions with per-tenant rate limiting and server-enforced security checks.

registerAgent(registration)

Register an agent and receive credentials for subsequent verification calls.

verifyAgent(agentId, agentToken, query, options)

Updated in v5.0.0
Verify an agent action. Security checks (exfiltration detection and MCP poisoning) are enforced server-side and cannot be disabled by the client.
Breaking change (v5.0.0): The checkExfiltration and checkMcpPoison options have been removed. Exfiltration detection always runs. MCP poison detection runs automatically when you provide a toolSchema.
Breaking change (v5.0.0): The context option with conversationId and stepNumber is now required. Requests without these fields are rejected with error code QWED-AGENT-CTX-001.

getAgentBudget(agentId, agentToken)

Check the remaining budget for a registered agent.

IRAC audit fields

All guard-related verification responses include IRAC-compliant audit fields for compliance reporting:

Risk codes

Security-related responses may include a risk field indicating the type of threat detected:

TypeScript types

VerificationType enum

VerificationStatus enum

New in v5.0.0
The VerificationStatus enum includes all possible status values returned by the verification API. Downstream consumers must handle INCONCLUSIVE, BLOCKED, and UNKNOWN as distinct outcomes.

Error handling