<!-- SPDX-License-Identifier: Apache-2.0 -->
**Status:** stable · **Owner:** Developer Relations · **License:** Apache-2.0

# KYE Agent Dev Kit™ — OSS Starter Templates

Open-source (Apache-2.0) starter scaffolds for building **self-governing-by-default**
KYE-aware agents with the [KYE Agent Dev Kit™](https://kyeprotocol.com/agent-dev-kit.html)
(constitution §32). Every template wraps your agent with `withKye(...)` so that
the [§0.3 governance event family](../playbooks/govern-your-agent.md) is emitted
on every privileged action — you never write evidence code by hand.

These extend the canonical Agent Dev Kit™ template set (`hello` / `kyc` /
`payment`) with four integration-focused starters. Read the matching
[developer playbook](../playbooks/) for the concept, then copy a template here to
get running.

| Template | What it shows | Playbook |
|---|---|---|
| [`governed-agent`](./governed-agent/) | Minimal agent emitting governance + completion envelopes | [govern-your-agent](../playbooks/govern-your-agent.md) |
| [`agentcore-adapter`](./agentcore-adapter/) | Wrap a (mocked) AgentCore-style gateway verdict with KYE evidence | [agentcore-and-kye](../playbooks/agentcore-and-kye.md) |
| [`policy-resolver`](./policy-resolver/) | Map a policy-engine verdict onto the locked KYE DecisionOutcome set | [policy-resolver-integration](../playbooks/policy-resolver-integration.md) |
| [`byo-ontology`](./byo-ontology/) | Cross-map a sample ontology to a regulatory framework | — |

## Using a template

```bash
# with the KYE CLI (preferred)
kye agent new my-agent --template governed-agent

# or copy the folder directly
cp -r public/oss/agent-dev-kit-templates/governed-agent my-agent
cd my-agent && npm install
```

`{{PROJECT_NAME}}` placeholders are substituted by `kye agent new`; if you copy
manually, replace them yourself.

## The self-governing-by-default contract

Per constitution §32 §0.3, **opt-out is a constitutional violation**. Every
template here emits, at minimum:

- `kye.agent.governance.v1` — the §52 binding at task-start, and
- `kye.agent.completion.v1` — the reconciliation envelope at task-end,

plus the per-decision `kye.evidence.*` family on each privileged step. The
shapes are the public examples in
[`public/examples/agent-governance/`](../../examples/agent-governance/).

## What these templates are *not*

- Not a runtime — the templates produce agent code that runs on Node /
  Cloudflare Workers / Python; KYE governs, it does not run agents (§0.30).
- Not a fork of an agent framework — they wrap LangChain / CrewAI / OpenAI
  Agents SDK / Claude Agent SDK / AgentCore via `withKye(...)`.
- Not a mechanism disclosure — signing, sealing and replay-proof construction
  stay in the SDK/gateway; templates only emit the public envelope shapes (§33).
