Skip to main content
Use vx.bindHarness(...) after await initVerifiedX() to promote your own methods into named VerifiedX surfaces.

Basic usage

import { initVerifiedX } from "@verifiedx-core/sdk";

const harness = {
  async callModel(messages) {
    return { messages };
  },

  async lookupInternalWorkflow({ workflowId }) {
    return { workflowId, status: "legal_complete" };
  },

  async setWorkflowStatus({ workflowId, status }) {
    return { ok: true, workflowId, status };
  },
};

const vx = await initVerifiedX();

vx.bindHarness(harness, {
  llm: {
    callModel: "gpt-5.4-mini",
  },
  retrievals: {
    lookupInternalWorkflow: "internal workflow evidence",
  },
  actions: {
    setWorkflowStatus: "set_workflow_status",
  },
});
This is the raw TypeScript path. You keep your existing harness and declare which methods should be treated as LLM calls, retrievals, protected actions, durable memory writes, or general tools.

Parameters

target
object
required
The object whose methods you want VerifiedX to wrap in place.
llm
object
Optional LLM method bindings.You can use either:
  • string shorthand: { callModel: "gpt-5.4-mini" }
  • object form: { callModel: { modelName: "gpt-5.4-mini" } }
retrievals
object
Optional retrieval bindings for reads and lookups that should contribute decision context.You can use:
  • string shorthand: { lookupInternalWorkflow: "internal workflow evidence" }
  • tuple-style shorthand: { searchPublicWeb: ["public web context", "external_retrieval"] }
  • object form with query and optional objectType
actions
object
Optional high-impact business method bindings such as record mutations, workflow updates, or message sends.You can use either:
  • string shorthand: { setWorkflowStatus: "set_workflow_status" }
  • object form: { setWorkflowStatus: { toolName: "set_workflow_status" } }
You can also attach optional schema and docstring metadata.
memories
object
Optional durable memory-write bindings.You can use either:
  • string shorthand: { rememberCustomerPreference: "remember_customer_preference" }
  • object form: { rememberCustomerPreference: { toolName: "remember_customer_preference" } }
You can also attach optional schema and docstring metadata.
tools
object
Optional general tool bindings for helper methods and tool history.If a method is definitely a durable memory write or another high-impact effect, prefer memories or actions.

What it does

bindHarness(...) wraps the methods you name and turns them into first-class VerifiedX surfaces. That means you can give your own business methods clearer names and better receipts, instead of relying only on lower-seam runtime capture. High-impact methods bound under actions are protected before they execute. Durable writes bound under memories are protected as memory writes.
initVerifiedX() already installs lower-seam runtime fallbacks by default. bindHarness(...) is how you add cleaner business-level boundaries on top of that runtime capture.

Return value

Returns the same VerifiedX runtime object, so you can keep using it after binding.

Example

import { initVerifiedX } from "@verifiedx-core/sdk";

const harness = {
  async callModel(messages) {
    return { messages };
  },

  async lookupInternalWorkflow({ workflowId }) {
    return { workflowId, status: "legal_complete" };
  },

  async setWorkflowStatus({ workflowId, status }) {
    return { ok: true, workflowId, status };
  },

  async rememberCustomerPreference({ customerId, value }) {
    return { ok: true, customerId, value };
  },
};

const vx = await initVerifiedX();

vx.bindHarness(harness, {
  llm: {
    callModel: "gpt-5.4-mini",
  },
  retrievals: {
    lookupInternalWorkflow: "internal workflow evidence",
  },
  actions: {
    setWorkflowStatus: {
      toolName: "set_workflow_status",
      docstring: "Update an internal workflow record.",
    },
  },
  memories: {
    rememberCustomerPreference: {
      toolName: "remember_customer_preference",
    },
  },
});
In this example, VerifiedX will:
  • observe callModel as an LLM call
  • record lookupInternalWorkflow as retrieval context
  • protect setWorkflowStatus as a high-impact boundary
  • protect rememberCustomerPreference as a durable memory write