Skip to content

kitelogik init

Scaffold a new governed agent project. Writes the five-file starter into the target directory and auto-compiles the YAML policy to Rego so the project runs immediately after docker compose up -d.

Synopsis

bash
kitelogik init [DIRECTORY]
ArgumentDefaultMeaning
DIRECTORY.Target directory — created if it doesn't exist

What it writes

FileContents
policies/policy.yamlStarter governance rules in YAML — the high-level edit surface
policies/policy.regoThe same rules compiled to Rego — what OPA actually evaluates
agent.pyExample agent with two governed tools and a 3-call ALLOW/BLOCK demo
docker-compose.ymlOne-service compose file that runs OPA on :8181 with --watch for hot-reload
.env.exampleEnvironment template (e.g. ANTHROPIC_API_KEY for the optional Claude loop)

Refuses to overwrite

If policies/policy.yaml already exists in the target directory, init exits with code 1 and prints:

text
Error: <target>/policies/policy.yaml already exists.

This is intentional — init won't clobber a project mid-flight. To re-scaffold, remove the existing policies/ directory or init into an empty directory.

Example

bash
$ kitelogik init my-agent
Initialized Kite Logik project in /home/me/my-agent

  Created:
    policies/policy.yaml governance rules (YAML)
    policies/policy.rego compiled Rego policy
    agent.py example governed agent
    docker-compose.yml OPA policy engine
    .env.example environment template

  Next steps:
    cd /home/me/my-agent
    docker compose up -d     # start OPA policy engine
    python agent.py          # run governance demo

  Edit policies/policy.yaml, recompile with 'kitelogik compile policies/policy.yaml',
  restart OPA with 'docker compose restart', and re-run to see changes.

What's in the starter policy

policies/policy.yaml from init contains a small example bundle:

  • Allow read-only customer lookups for support_agent
  • Allow refunds up to $200 for support_agent
  • Deny refunds above $200
  • Hard-deny any shell access

Edit the YAML, re-run kitelogik compile policies/policy.yaml, and OPA hot-reloads on the next request — the bundled docker-compose.yml runs OPA with --watch on the policies mount so the loop stays tight.

Released under the Apache 2.0 License.