K
KYE Developers
Request access

Quickstart

Five steps from npm install to a signed evidence pack.

1

Install the SDK

npm install @kye-protocol/sdk
export KYE_API_KEY=sk_test_…
2

Create a governed entity

import { KyeClient } from "@kye-protocol/sdk";
const kye = new KyeClient({ apiKey: process.env.KYE_API_KEY });

const agent = await kye.entities.create({
  entity_type: "ai_agent",
  display_name: "KYC Triage Agent",
  owner_entity_id: "kye:user:acme.compliance_lead",
  accountable_entity_id: "kye:org:acme",
  purpose: "Triage KYC packages and flag for human review when uncertain.",
  lifecycle_state: "pilot",
  approved_capabilities: ["kyc.verify", "kyc.read"],
  prohibited_capabilities: ["kyc.approve_final"]
});
3

Grant a delegation

const delegation = await kye.delegations.create({
  actor: agent.entity_id,
  principal: "kye:user:acme.compliance_lead",
  subject: "kye:business:retail_customer_segment",
  scope: ["kyc.verify", "kyc.read"],
  expires_at: "2026-12-31T00:00:00Z"
});
4

Make a decision

const decision = await kye.decisions.create({
  actor: agent.entity_id,
  principal: "kye:user:acme.compliance_lead",
  capability: "kyc.verify",
  action: "kyc.verify",
  context: { customer_id: "cust_001", region: "EU" }
});

console.log(decision.decision, decision.reason_code);
// → "allow" "policy_allow_default"
5

Download an evidence pack

const pack = await kye.evidencePacks.create({
  use_case_id: "kye:use-case:acme.kyc_triage",
  period: { start: "2026-01-01", end: "2026-03-31" }
});

// Verify locally:
//   kye-cli evidence verify pack.json --key-id kye-evidence-signing-2026-q1

The pack contains: entity authority records, authority gates, commit boundaries, review paths, runtime decision examples, and a revocation drill log — all hash-anchored and Ed25519-signed.

Browse the full API →