Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.visiqlabs.com/llms.txt

Use this file to discover all available pages before exploring further.

The VisIQ SDK ships as TypeScript today. Python, Go, Java, and Ruby SDKs are on the roadmap — they appear in the language picker below with a Coming soon label so you can see what is and is not yet available. If you need governance from another language right now, call the VisIQ HTTP API directly — every SDK is a thin wrapper over it.

Install

npm install @visiq/sdk

Set environment variables

.env
VISIQ_API_KEY=vk_live_...
VISIQ_ENDPOINT=https://api.visiqlabs.com
VISIQ_AGENT_ID=my-bot
VariableDescriptionDefault
VISIQ_API_KEYAPI key from the VisIQ dashboard(required)
VISIQ_ENDPOINTBackend base URLhttps://api.visiqlabs.com
VISIQ_AGENT_IDDefault agent identity (overridable per call)(required)

Wrap your agent

Build your LangChain agent exactly as you normally would, then pass the executor to visiq(). ALLOW, RECALL, and RECORD all activate automatically from that single call — there are no per-tool wrappers, no separate clients, and no module-by-module imports.
import { visiq } from "@visiq/sdk";
import { AgentExecutor, createOpenAIToolsAgent } from "langchain/agents";
import { createRetrieverTool } from "langchain/tools/retriever";
import { ChatOpenAI } from "@langchain/openai";
import { ChatPromptTemplate } from "@langchain/core/prompts";
import { DynamicTool } from "@langchain/core/tools";
import { MemoryVectorStore } from "langchain/vectorstores/memory";
import { OpenAIEmbeddings } from "@langchain/openai";

// Your tools — unchanged
const tools = [
  new DynamicTool({
    name: "issue_refund",
    description: "Issue a refund to a customer",
    func: async (input: string) => {
      const { customerId, amount } = JSON.parse(input);
      return `Refunded $${amount} to ${customerId}`;
    },
  }),
  createRetrieverTool(
    (await MemoryVectorStore.fromTexts(
      ["Q3 revenue: $4.2M", "Internal pricing strategy"],
      [{ classification: "internal" }, { classification: "confidential" }],
      new OpenAIEmbeddings(),
    )).asRetriever(),
    { name: "search_knowledge", description: "Search company knowledge base" },
  ),
];

// Your agent — unchanged
const prompt = ChatPromptTemplate.fromMessages([
  ["system", "You are a helpful assistant."],
  ["human", "{input}"],
  ["placeholder", "{agent_scratchpad}"],
]);
const llm = new ChatOpenAI({ model: "gpt-4o", temperature: 0 });
const agent = await createOpenAIToolsAgent({ llm, tools, prompt });

// One line — ALLOW, RECALL, and RECORD activate here
const executor = visiq(new AgentExecutor({ agent, tools }), { agentId: "support-bot" });

// Use exactly as before
const result = await executor.invoke({ input: "What was Q3 revenue?" });
Use createOpenAIToolsAgent, not createOpenAIFunctionsAgent. The legacy functions agent does not emit the handleToolStart callbacks the harness relies on.

What happens behind the scenes

After visiq():
  • ALLOW intercepts issue_refund at the tool’s invoke() method — evaluates against your rules before the function body runs. Denied calls return a [VisIQ ...] Action blocked message to the agent without executing the underlying function; approval-required calls pause for human decision.
  • RECALL instruments search_knowledge’s retriever — filters each returned document against your suppression policy. Denied documents are silently excluded; redacted documents pass through with masked fields; the agent never sees suppressed content.
  • RECORD captures every decision — signed envelope with Ed25519 signature, SHA-256 hash, and timestamp, written to the immutable audit ledger.
All three are reachable from the single visiq() import. There is no AllowClient, RecallClient, or RecordClient to construct separately — the module-split model from earlier preview builds was retired in favour of one unified entry point.

Create rules in the dashboard

With the SDK wired up, open the VisIQ dashboard to define what your agent can do and see:
  1. ALLOW rule: “Allow support-bot to call search_knowledge freely, but require human approval before issue_refund for amounts over $100”
  2. RECALL rule: “Deny support-bot from accessing any document classified as confidential”
Rules compile to policy and sync to the SDK within 30 seconds.

Next steps

ALLOW

How tool-call authorization works, rules, and human-in-the-loop.

RECALL

How context filtering works, trust tiers, and cryptographic receipts.

RECORD

How the immutable audit ledger works.

SDK Reference

Complete visiq() API, options, framework detection, and error behavior.