Guardrails and a learning loop for AI coding agents
Joshua Dellemeraldleaf.dev · open source, MIT

Hold your agent to your rules,
and make it better every session

okl wraps your agent: your rules and ADRs briefed before every task, gates that fail when the code drifts from them, and each session's lessons fed back in.

Decided up front

Your rules and ADRs · this codebase · vetted outside advice
once

The store

Rules · decisions · past defects · gates
.

In front of the agent

Task arrives → ranked and filtered → briefing in context
before every task

Re-graded as code moves

A check must pass → drift since the check → push or CI fails
on every push

Kept current

Update keeps proof · retire with a reason · end-of-session recap
at session end
corrections flow back
01

One shape for every lesson

A paragraph can't be routed into an action; a lesson can.

when you seeX
doY
whythe cause
02

Scope decides reach

org reaches repos that load it. repo stays here, so a local quirk never fires elsewhere.

orghereotherother
repohereotherother
03

Selected, not skimmed

Ranked by the task, scoped, capped, and it says how many it trimmed.

+ n lower-ranked, trimmed
04

A stamp is evidence

A check you chose must run and pass. Marking a lesson verified without one is refused.

✓your check passedstamped
✕claimed, not runrefused
05

Stale blocks the push

Files changed since the check passed? The pre-push hook or CI fails until it is re-proven.

check
passed
file
changed
push
fails
06

Corrected, not only added

Wrong or outdated lessons get fixed or retired, and the store keeps why.

updatekeeps the proof
retirekeeps the reason
recapnames what to fix
Fails closedNo briefing is never a clean check.
ObservableEvery check run kept · okl metric · okl show

The loop from a terminal

Brief, prove, gate, retire.
01

Brief

okl check --task "add an invoice endpoint"
02

Prove

okl verify <id> --run "pytest -q" --expect passed
03

Gate

okl drift --gate
04

Retire

okl retire <id> --reason "replaced" --by <new>