ZeroLeaks
API Reference

Runtime Scans

Runtime scan methods, targets, relay options, and provider adapters.

Runtime Scans

Methods

MethodDescription
runtimeScans.create(definition, options?)Start the hosted workflow without a local runner
runtimeScans.get(id, signal?)Read scan state and report
runtimeScans.list(options?)List runtime scans
runtimeScans.run(target, options?)Create the scan, execute relay events, and return the report
runtimeScans.cancel(id)Cancel the hosted workflow

Target contract

interface RuntimeScanTarget {
  describe(): RuntimeTargetDefinition | Promise<RuntimeTargetDefinition>;
  invoke(invocation: RuntimeTargetInvocation):
    | RuntimeTargetResponse
    | string
    | Promise<RuntimeTargetResponse | string>;
  reset?(sessionId: string): void | Promise<void>;
}

Create a target with createRuntimeTarget(options) or preserve a typed target with defineRuntimeTarget(target).

Run options

interface RuntimeRunOptions extends WaitOptions<RuntimeScan> {
  eventConcurrency?: number;
  eventPollIntervalMs?: number;
  workerStallTimeoutMs?: number;
  onEvent?: (event: RuntimeScanEvent) => void | Promise<void>;
  scan?: RuntimeScanOptions;
}

eventConcurrency controls how many isolated target sessions the local runner may execute at once. It defaults to 8 and is capped at 16; events within one session remain ordered. workerStallTimeoutMs defaults to six minutes and cancels a run when the hosted workflow stops making progress.

interface RuntimeScanOptions {
  scanMode?: "full" | "quick"; // defaults to full
  knowledgeProfile?: "baseline" | "production" | "research";
  attackSurfaces?: AttackSurface[];
  // ...model and adaptive-knowledge options
}

Provider adapters are exported from @zeroleaks/sdk/ai-sdk and @zeroleaks/sdk/openai.

On this page