Dual-process stack

Last updated:

Steps

  1. Define the typed contract for System One decisions (route enums, safety booleans).
  2. Place the Decision Model before tool calls and LLM invocations.
  3. If the decision is “simple/safe”, return without System Two.
  4. If “complex/allowed”, forward context + decision to the LLM.
  5. Log decision + confidence for audit — not only the LLM reply.
decision = system_one.decide(context, question="Is this tool call safe?", type="boolean")
if not decision.answer:
    return deny(decision.probability)
return system_two.complete(prompt)