For the complete documentation index, see llms.txt. This page is also available as Markdown.

REST API / Local Engine

What you'll learn: How to integrate non-Python agents with Kyvvu using the local HTTP server (kyvvu serve).


kyvvu serve (local engine)

For agents written in JavaScript, Go, Rust, or any language, kyvvu serve runs the engine as a local HTTP server. Your agent makes HTTP calls to evaluate steps — same engine, same sub-millisecond policies, no Python needed in your agent code.

Start the server

pip install kyvvu
kyvvu serve --host 127.0.0.1 --port 8080 --agent-key my-agent

The server needs API credentials to fetch policies. Provide them via flags or environment variables:

export KV_API_URL=https://platform.kyvvu.com
export KV_API_KEY=KvKey-...
export KV_AGENT_KEY=my-agent
kyvvu serve

Endpoints

Method
Path
Purpose

GET

/health

Liveness probe — returns policy status.

POST

/evaluate

Preflight evaluation of an intended behaviour.

POST

/record

Record a completed step into task history.

POST

/end_task

Close a task — evict history and flush logs.

POST

/register_agent

Evaluate agent-registration policies.

Health check

Evaluate a step

Response:

When a policy blocks, blocked is true and action is "block". The server always returns HTTP 200 for policy decisions — read the blocked field to decide whether to proceed.

Record a completed step

Response: {"step": 1, "task_id": "task-abc"}

End a task

Response: {"status": "ok", "task_id": "task-abc"}

Integration pattern

The typical flow for a non-Python agent:


Next steps

Last updated