Quickstart
Authorize your first agent action in under 2 minutes — no Docker, no server setup.
1
Get an API key
Visit lelu-ai.com/api-key and click Generate Key. No signup, no email — instant anonymous key with 500 requests/day free.
Copy the key and store it as LELU_API_KEY in your .env file. Never commit it to version control.
2
Install the SDK
Add lelu-agent-auth to your project:
terminal
npm install lelu-agent-auth # or: pnpm add lelu-agent-auth | yarn add lelu-agent-auth
3
Connect and authorize
Pass your API key to createClient. The SDK routes to the live cloud engine automatically — no server to start.
TypeScript
import { createClient } from "lelu-agent-auth";
const lelu = createClient({
apiKey: process.env.LELU_API_KEY, // routes to cloud automatically
});
const decision = await lelu.agentAuthorize({
actor: "billing-agent",
action: "refund:process",
resource: { orderId: "ord_123" },
context: { confidence: 0.85 },
});
if (decision.allowed) {
// proceed with the action
} else if (decision.requiresHumanReview) {
// queued — agent pauses, awaiting human approval
} else {
throw new Error(`Denied: ${decision.reason}`);
}Or call the REST API directly:
bash
curl -X POST https://lelu-ai.com/v1/agent/authorize \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LELU_API_KEY" \
-d '{
"actor": "billing-agent",
"action": "refund:process",
"resource": { "orderId": "ord_123" },
"confidence": 0.85
}'4
Read the response
The engine evaluates the request against your policy and returns one of three outcomes:
json
{
"allowed": true,
"requires_human_review": false,
"confidence_used": 0.85,
"reason": "Confidence threshold met",
"trace_id": "tr_7f30c2a4e1b8"
}allowed: trueAction is permitted — proceed immediately.requires_human_review: trueConfidence too low — action queued. Agent should poll /v1/queue/pending until approved or denied.allowed: falseBlocked by policy — do not proceed. Inspect reason for details.5
Add to your AI framework
Lelu ships framework wrappers so you can gate tool calls with one line:
Vercel AI SDK
import { secureTool } from "lelu-agent-auth/vercel";
import { tool } from "ai";
import { z } from "zod";
const processRefund = secureTool(lelu, "billing-agent", {
tool: tool({
description: "Process a customer refund",
parameters: z.object({ orderId: z.string(), amount: z.number() }),
execute: async ({ orderId, amount }) => ({ success: true }),
}),
action: "refund:process",
confidence: 0.9,
});