SDK

TypeScript SDK

Install @limetry/sdk, build an ActionIntent, and evaluate it against a self-run Limetry node.

@limetry/sdk is open source. Point baseUrl at your evaluation server (http://localhost:3810 or your origin). Use LIMETRY_BEARER_TOKEN unless you issue your own API tokens on that node.

Prefer the Python SDK when your agent loop is Python.

Install the SDK

npm install @limetry/sdk

This installs the published package, so npm install, yarn add, and pnpm add are equivalent. For local source development, use the repository's Yarn Berry workspace; see INSTALL.md.

Build an ActionIntent

import type { ActionIntent, ActionPolicy } from "@limetry/sdk"
import { createSlimActionPolicy, redactActionIntent } from "@limetry/sdk"

const policy = createSlimActionPolicy({
  agentId: "demo_agent",
  allowedActionTypes: ["http_get"],
  deniedActionTypes: ["http_post", "deploy"],
  blockedResourcePatterns: ["https://prod.example.com/*"],
  maxCostMinor: 100,
  auditMode: "minimal",
})

const intent: ActionIntent = {
  intent_id: crypto.randomUUID(),
  policy_id: policy.policy_id,
  agent_id: "demo_agent",
  action_type: "http_post",
  resource: "https://prod.example.com/api/charge",
  issued_at: new Date().toISOString(),
}

const safeForLogs = redactActionIntent(intent)

Evaluate over HTTP

import { createRemoteEngine } from "@limetry/sdk"

const engine = createRemoteEngine({
  baseUrl: "http://localhost:3810",
  apiKey: process.env.LIMETRY_BEARER_TOKEN,
})

const decision = await engine.evaluateAction(intent)

createRemoteEngine() also reads LIMETRY_API_KEY / LIMETRY_BEARER_TOKEN and LIMETRY_BASE_URL.

Handle evaluate errors

ErrorWhen
PolicyViolationErrorEvaluate returned deny
EngineLoadErrorServer unreachable or non-OK HTTP
RateLimitExceededErrorClient velocity circuit breaker

Continue

Contact

Talk to the Limetry team

Questions about self-run Limetry, Limetry Cloud, or partnerships — send a note.  Open contact.