Silvanexumdocs
Guides

Capture & run an agent

Wrap an existing agent with the SDK and execute it so it emits a signed trace.

This guide walks through capturing an agent you already have and running it through Silvanexum so every execution produces a signed trace. It is the foundational task — everything else builds on a captured, runnable agent.

You will install the SDK, wrap your agent's entry point, and trigger a run from the CLI or programmatically.

These calls need an API key with the run scope. Creating the agent first also needs manage. Set SILVANEXUM_API_KEY in your environment before you start.

Install the SDK

npm install @silvanexum/sdk

Capture an agent

Wrap your existing prompt + model configuration as a Silvanexum agent. This is the captured artifact every run is attributed to.

import { Silvanexum } from "@silvanexum/sdk";
 
const sx = new Silvanexum({ apiKey: process.env.SILVANEXUM_API_KEY! });
 
const agent = await sx.agents.create({
  name: "Release Notes Writer",
  description: "Summarizes merged PRs into a changelog entry.",
  config: {
    provider: "anthropic",
    model: "claude-opus-4-8",
    systemPrompt: "You write concise, accurate release notes.",
    maxTokens: 1024,
  },
});
 
console.log(agent.id);

Run it

Every run is captured, secret-scrubbed, and signed by the server. The response returns the output alongside the trace and signing fields.

const run = await sx.runs.create({
  agentId: agent.id,
  prompt: "Summarize: merged #421 (fix retry backoff), #430 (new /export route).",
});
 
console.log(run.status);   // "completed"
console.log(run.output);
console.log(run.latencyMs);

Read the signed trace

The execution carries a trace[] of every step, a contentHash (sha256 of the canonical run) and a server signature (HMAC). Fetch the execution any time to re-read it.

const exec = await sx.runs.get(run.id);
 
console.log(exec.trace);        // ordered steps
console.log(exec.contentHash);  // sha256 of the canonical run
console.log(exec.signature);    // server HMAC over the contentHash

Share it publicly (optional)

Flip a run to public to get a shareable, verifiable link at https://silvanexum.com/runs/{id}.

await sx.runs.setVisibility(run.id, "public");
console.log(sx.runs.shareUrl(run.id)); // https://silvanexum.com/runs/exec_...

On this page