Precedent

Agents ask first.
People decide.

Your team’s chat, turned into approved rules every agent checks before acting.

Get it on GitHub
pip install precedent-ai

Three situations, three decisions

Real output from the sample bakery rulebook.

Delivery 1.5 hours late

Act

“Message the customer before they message us…”

Rule
R-004 v1
Confidence
0.89

Birthday cake arrived damaged

Needs approval

“Ask for a photo first…”

Rule
R-003 v1
Confidence
0.88

Supplier’s bank details changed

Escalate

No rule covers it. A person decides.

Closest rule
R-006
Coverage
0.21 < 0.30

An escalation becomes a rule

Answered once, never escalated again.

  1. Agent

    Escalates the bank details email.

    G-20261109T1154-fa941c3ce6
  2. Ayesha, owner

    “Never change supplier bank details from an email…”

  3. Ayesha, owner

    Approves the drafted rule.

    R-012 v1
  4. Agent

    Asks again: covered, sent for approval.

    confidence 0.95
  5. Regression eval

    The case is now a CI test.

    1/1 passed

Five checks outside the model

The first to fail hands it to a person.

  1. Coverage

    No approved rule covers it.

  2. Judgement

    The model says the rules don’t settle it.

  3. Grounding

    A cited rule it wasn’t shown, or an invented number.

  4. Confidence

    Below your bar for that risk level.

  5. Risk

    Money, legal, health or data: a person signs off.

Then every step is checked again

Approving the start isn’t enough. A step beyond the decision halts the whole run, and the halt leaves a record.

  1. Ayesha, owner

    Signs off the damaged cake refund.

    R-003 v1
  2. Agent

    Asks the customer for a photo. Continue

    run-cake
  3. Agent

    “Refunding 5000 to the customer’s card.” No rule or decision mentioned 5000. Halt

    H-20261109T1428-e1f2fb8921
  4. Agent

    Checks again after Done: the run stays halted. Halt

    same halt
  5. Halt record

    Rule R-003 v1, run run-cake, during the action, created by precedent:check. A gap opens for the owner.

    G-20261109T1428-80363d1ecc

Same chat, three reasoners

Five situations, unedited. Full transcripts

SituationGemini gemini-3.8-flashKimi kimi-k3Offline baseline
Nut allergy questionApprovalApprovalApproval
Delivery 1.5 h lateActApprovalAct
Cancel, delivery in two daysApprovalApprovalEscalate
Cake arrived damagedApprovalApprovalApproval
Supplier bank changeEscalateEscalateEscalate

Questions people ask

How is this different from Parlant or Mem0?

They run rules developers write, or remember users. Precedent learns and tests yours.

What if the agent goes further than what was approved?

It re-checks before each step and after Done. A new amount, a riskier action, a changed rule or a stale approval halts the run for good.

Where does our data go?

Secrets and personal data are stripped first. Offline mode keeps everything local.

Does it fit our automations?

Python, MCP, or precedent ask --json from n8n or Make.

Try it without an API key

Terminal
git clone https://github.com/burhan-mujahid/precedent
cd precedent && pip install -e .
bash examples/demo.sh
agent.py
from precedent import Precedent

kb = Precedent.open("./my-rulebook")
d = kb.resolve("Order arrived 3 days late", run_id="run-42")
d.outcome   # answer, needs_approval or escalate

kb.check(d.id, "Refunding the delivery fee").outcome   # continue or halt