> ## Documentation Index
> Fetch the complete documentation index at: https://docs.verifiedx.me/llms.txt
> Use this file to discover all available pages before exploring further.

# bindHarness

> Bind the VerifiedX runtime to your TypeScript harness.

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

## Basic usage

```typescript theme={null}
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",
  },
});
```

<Note>
  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.
</Note>

## Parameters

<ParamField path="target" type="object" required>
  The object whose methods you want VerifiedX to wrap in place.
</ParamField>

<ParamField path="llm" type="object">
  Optional LLM method bindings.

  You can use either:

  * string shorthand: `{ callModel: "gpt-5.4-mini" }`
  * object form: `{ callModel: { modelName: "gpt-5.4-mini" } }`
</ParamField>

<ParamField path="retrievals" type="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`
</ParamField>

<ParamField path="actions" type="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.
</ParamField>

<ParamField path="memories" type="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.
</ParamField>

<ParamField path="tools" type="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`.
</ParamField>

## 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.

<Note>
  `initVerifiedX()` already installs lower-seam runtime fallbacks by default. `bindHarness(...)` is how you add cleaner business-level boundaries on top of that runtime capture.
</Note>

## Return value

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

## Example

```typescript theme={null}
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
