Quick start

Self-host the evaluation server, apply a policy, deny a production HTTP POST, and tail the audit log.

Run this path against a self-run Limetry node. Point the CLI at your local API and use LIMETRY_BEARER_TOKEN (or scoped API tokens you issue on that node).

Choose the installation path

  • Node.js ≥ 20
  • A self-run Limetry node, or Limetry Cloud

For a consumer project, install the published CLI with npm, Yarn, or pnpm:

npm install -g @limetry/cli

For a global CLI, use pnpm add --global @limetry/cli; for a one-off CLI invocation with Yarn Berry, use yarn dlx @limetry/cli. To run the MCP server without installing it, use npx -y @limetry/mcp, yarn dlx @limetry/mcp, or pnpm dlx @limetry/mcp.

If you cloned the Limetry repository, use Yarn Berry 4.13 for the checkout:

corepack enable
yarn install
yarn build:sdk
yarn build:server

Do not run npm install or pnpm install at the repository root. See Run the server yourself for the complete source checkout path.

Start the server

Set a bearer token (minimum 32 characters in production) and start the governance server:

export LIMETRY_BEARER_TOKEN="dev-local-bearer-token-min-32-chars"
node packages/server/dist/index.js

The API listens on http://localhost:3810 by default.

Docker alternative:

docker build -f packages/server/Dockerfile -t limetry-server .
docker run -p 3810:3810 \
  -e LIMETRY_BEARER_TOKEN="dev-local-bearer-token-min-32-chars" \
  limetry-server

Verify health:

curl -s http://localhost:3810/health

Configure the CLI

Point the CLI at your self-run server:

limetry setup

Enter http://localhost:3810 and paste the same LIMETRY_BEARER_TOKEN.

Run doctor to confirm connectivity:

limetry doctor

Apply a policy

Deny http_post to a production URL pattern (allow GET for contrast):

limetry policy apply \
  --allow http_get \
  --deny http_post \
  --block-resource "https://prod.example.com/*"

Prefer policies with audit_mode: "minimal" (slim builder default) unless you need forensics retention of redacted metadata.

Record the policy_id printed in the JSON response. You need it for evaluation.

Evaluate an intent

Pipe an ActionIntent JSON document to limetry eval:

echo '{
  "policy_id": "PASTE_POLICY_ID_HERE",
  "agent_id": "demo_agent",
  "action_type": "http_post",
  "resource": "https://prod.example.com/api/deploy"
}' | limetry eval

Expect DENY with reasons referencing the blocked resource or denied action type.

Evaluate an allowed GET to the same host (adjust policy if needed) to see ALLOW.

Tail the audit log

limetry audit tail --event-type policy.evaluated

Look for policy.evaluated events with your agent id and decision outcome. Stored events are privacy-safe records (default audit_mode=minimal) — not raw metadata bags. Do not put API keys or chat transcripts in intent metadata or record details. See Minimize audit data.

Connect Cursor MCP (optional)

{
  "mcpServers": {
    "limetry": {
      "command": "npx",
      "args": ["-y", "@limetry/mcp"],
      "env": {
        "LIMETRY_API_KEY": "dev-local-bearer-token-min-32-chars",
        "LIMETRY_BASE_URL": "http://localhost:3810"
      }
    }
  }
}

Available tools: limetry_evaluate, limetry_record_action, limetry_list_audit, limetry_upsert_policy.

Instruct Cursor to call limetry_evaluate before irreversible tool calls.

Evaluate from the SDK

import { RemotePolicyEngine } from "@limetry/sdk"

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

const decision = await engine.evaluateAction({
  policy_id: process.env.POLICY_ID!,
  agent_id: "demo_agent",
  action_type: "http_post",
  resource: "https://prod.example.com/api/deploy",
})

if (!decision.approved) {
  console.error("Denied:", decision.reasons)
}

Block the tool call in your agent loop when approved is false. The SDK does not enforce deny for you.

Choose an adapter

These packages connect evaluate to your stack. Install only what you need. The HTTP API stays the same across adapters.