Quickstart

Run your first ALLOW + DENY decision in under 5 minutes.

Goal: start the KYA reference implementation and see one ALLOW + one DENY decision.

Prerequisites#

  • Docker Desktop (running)
  • Python 3.12+
  • make
  • Node.js 18+ (for JS examples)

Step 1 — Install & start services#

terminal
# Clone the repo
git clone https://github.com/qurveai/know-your-agent
cd kya

# Install dependencies
make install

# Copy env template
cp apps/api/.env.example apps/api/.env

# Generate Ed25519 keypair (paste output into .env)
make generate-dev-keypair

# Start API + Postgres + Redis
docker compose up -d
make migrate-up
make dev

The API is now running at http://localhost:8000. Swagger UI available at http://localhost:8000/docs.

Playground (UI)#

The repository ships apps/playground — a local UI to test all API flows without writing code. Useful for exploring the API before integrating.

terminal
# From the repo root (API must be running)
pnpm install

# Generate TS types from the OpenAPI snapshot (CI-safe, default)
pnpm --filter playground types:api

# Or generate from a live running API
OPENAPI_SOURCE=url pnpm --filter playground types:api

# Start the playground UI
pnpm --filter playground dev

Re-run types:api after any API schema change to keep playground request/response types aligned.

Step 2 — Run the ALLOW demo#

terminal
cd examples/reference-implementation
make demo-allow

Expected output:

✅ workspace created
✅ agent registered
✅ policy bound
✅ capability issued
✅ verify = ALLOW
✅ action executed

Step 3 — Run the DENY demo#

terminal
make demo-deny

Expected output:

✅ verify = DENY (reason=SPEND_LIMIT_EXCEEDED)

Protect a Purchase in 5 Minutes#

Try the e-commerce example to see KYA integrated into a real purchase flow:

terminal
cd examples/purchase-target
cp .env.example .env
# Add your bootstrap token to KYA_BOOTSTRAP_TOKEN
npm install
npm run dev

# In a second terminal:
set -a; source .env; set +a
npm run demo

Troubleshooting#

ErrorFix
connection refusedServices not ready — run make up and wait 10–20s
WORKSPACE_BOOTSTRAP_DISABLEDAPI missing bootstrap token in .env
SIGNATURE_INVALIDPayload/signature mismatch — check canonicalization
POLICY_NOT_BOUNDSetup flow interrupted before policy bind — restart demo
# Inspect running services
docker compose ps