SDK reference · Node SDK

prov.trace

prov.trace in the Node SDK: 7 methods. The trace methods.

Methods

models

prov.trace.models(): Promise<TraceModel[]>

Public models + your account's private registry builds.

Calls GET /v1/trace/models.

check

prov.trace.check(params: TraceCheckParams): Promise<TraceCheckResult>

Allow | flag | block for a hosted traced inference or a sidecar reading, decided by the account's Trace rules at stage completion (request thresholds win for this check).

Calls POST /v1/trace/check.

assess

prov.trace.assess(params: TraceAssessParams): Promise<TraceAssessment>

Assess an agent's action before it runs (POST /v1/trace/assessments); the raw call under.

guardTool

prov.trace.guardTool<R>(action: TraceActionInput, fn: () => R | Promise<R>, opts?: GuardToolOptions): Promise<GuardToolResult<R>>

Assess action and run fn only on allow; on challenge wait for the person (waitForApproval) or return the pending assessment; when Provenance can't answer, pay, send and delete never run, write is blocked and read runs unchecked (onUnavailable changes the last two), and an unchecked run is posted later as unassessed.

guard

prov.trace.guard<R>(fn: (completion: TracedChatCompletion) => R | Promise<R>, opts?: TraceGuardOptions): (params: ChatCompletionParams) => Promise<R>

Wrap fn so it only ever sees a completion the account's Trace rules let through.

compare

prov.trace.compare(a: string, b: string, params?: { pattern?: string }): Promise<TraceComparison>

Two runs of one prompt side by side (canary + activation delta).

Calls GET /v1/trace/compare.

health

prov.trace.health(): Promise<TraceHealth>

The configured trace backend + worker status.

Calls GET /v1/trace/health.

Was this page helpful? Send us feedback

LLM? Read llms.txt.