
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@agentmark-ai/sdk
Advanced tools
The SDK for tracing LLM calls and integrating with AgentMark Cloud. Built on OpenTelemetry.
npm install @agentmark-ai/sdk
import { AgentMarkSDK, trace } from "@agentmark-ai/sdk";
// Initialize the SDK with your API key
const sdk = new AgentMarkSDK({
apiKey: process.env.AGENTMARK_API_KEY!,
appId: process.env.AGENTMARK_APP_ID!,
});
// Start the OpenTelemetry tracer
sdk.initTracing();
// Wrap any LLM call in a trace
const { result, traceId } = await trace(
{ name: "customer-support", userId: "user-123" },
async (ctx) => {
// Your LLM call here — works with any SDK
const response = await generateText({ /* ... */ });
// Create child spans for sub-operations
await ctx.span({ name: "save-to-db" }, async () => {
await db.saveResponse(response);
});
return response;
}
);
console.log(`Trace: ${traceId}`);
AgentMarkSDKMain SDK class for initialization and cloud integration.
const sdk = new AgentMarkSDK({
apiKey: string; // Your AgentMark API key
appId: string; // Your AgentMark app ID
baseUrl?: string; // Custom API URL (default: https://api.agentmark.co)
});
Methods:
sdk.initTracing(options?) — Start the OpenTelemetry tracer. Options: { disableBatch?: boolean }.sdk.getApiLoader() — Get an ApiLoader instance for loading prompts from AgentMark Cloud.sdk.score(props) — Submit an evaluation score for a trace.trace(options, fn)Create a root trace span. Returns { result, traceId }.
const { result, traceId } = await trace(
{
name: "my-trace", // Required
userId: "user-123", // Optional: associate with a user
sessionId: "session-456", // Optional: group related traces
sessionName: "chat", // Optional: human-readable session name
metadata: { env: "prod" }, // Optional: key-value metadata
},
async (ctx) => {
// ctx.traceId — the trace ID
// ctx.spanId — the root span ID
// ctx.setAttribute(key, value) — set span attributes
// ctx.addEvent(name, attributes?) — add span events
// ctx.span(options, fn) — create child spans
return await doWork();
}
);
ctx.span(options, fn)Create a child span within a trace. Available on the TraceContext passed to trace() and nested span() callbacks.
await trace({ name: "request" }, async (ctx) => {
const user = await ctx.span({ name: "fetch-user" }, async (spanCtx) => {
return await db.getUser(id);
});
await ctx.span({ name: "generate-response" }, async (spanCtx) => {
return await llm.generate({ user });
});
});
ApiLoaderRe-exported from @agentmark-ai/loader-api for convenience. Load prompts from AgentMark Cloud or a local dev server.
// Cloud loader (via SDK)
const loader = sdk.getApiLoader();
// Or create directly
import { ApiLoader } from "@agentmark-ai/sdk";
const cloudLoader = ApiLoader.cloud({
apiKey: "...",
appId: "...",
});
const localLoader = ApiLoader.local({
port: 9418,
});
Full documentation at docs.agentmark.co.
FAQs
SDK for communicating with the Agentmark hosted platform
We found that @agentmark-ai/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.