JSPM

@keylessai/sdk

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q35354F
  • License MIT

AI Action Governance Kernel — Every AI action must pass through the Kernel.

Package Exports

  • @keylessai/sdk

Readme

@keylessai/sdk

AI Action Governance Kernel — every AI action must pass through the Kernel.

No direct execution. No bypass. No shortcuts.

Install

npm install @keylessai/sdk

Quick start

import { KeylessAI } from '@keylessai/sdk';

const keyless = new KeylessAI({
  apiKey: 'ka_live_xxxxx',
  orgId:  'org_xxxxx',
  agentId:'agent_xxxxx',
});

// 1. Simulate first (dry-run)
const sim = await keyless.simulate({
  action: 'ads.budget_increase',
  amount: 5000,
});
console.log(sim.policyDecision); // 'allow' | 'require_approval' | 'deny'

// 2. Execute for real
const result = await keyless.execute({
  action: 'ads.budget_increase',
  amount: 5000,
  target: { campaign: 'camp_abc' },
});

if (result.status === 'awaiting_approval') {
  const approved = await keyless.waitForApproval(result.intentId);
  if (approved) {
    const final = await keyless.resume(result.intentId);
    console.log('Done:', final.executionId);
  }
}

// 3. Query the ledger
const history = await keyless.ledger({ limit: 10 });
console.log(history.summary.total_cost);

API

Method Description
execute(input) Run a governed action through the full pipeline
simulate(input) Dry-run to preview risk score & policy decision
ledger(query?) Query the immutable decision ledger
waitForApproval(intentId, opts?) Poll until an intent is approved or denied
resume(intentId) Execute an already-approved intent

How it works

Every call flows through a strict 10-step pipeline:

  1. Intent — declare what the AI wants to do
  2. Policy — 7 rules evaluated (permissions, budgets, rate limits, risk)
  3. Approval — high-value actions routed to humans
  4. Execute — atomic, once-only execution
  5. Ledger — immutable audit trail

Configuration

new KeylessAI({
  apiKey: 'ka_live_xxxxx',      // required
  orgId: 'org_xxxxx',           // required
  agentId: 'agent_xxxxx',       // required
  baseUrl: 'https://...',       // default: app.keyless-ai.com/api/v3
  autoPolicy: true,             // $1000+ requires approval
  timeout: 30000,               // request timeout (ms)
  maxRetries: 2,                // retries on transient failures
});

License

MIT