OpenProgram Docs

Proactive layer

Model rm -rf ~ Event tool.before Rule DangerousCommandGuard evaluate(event, state) Action Gate.ask command stopped
  1. Modelrm -rf ~
  2. Eventtool.before
  3. RuleDangerousCommandGuardevaluate(event, state)
  4. ActionGate.ask

    command stopped

Rules never watch Agent internals; they watch the event stream. Landing the action is the framework's job.

ConceptIsDetail
EventA record that something just happened; append-onlyEvent layer
PolicyA Python class: which events it watches, and how it decides. A new capability is a new class.Rules and how they run
LaneGate blocks before and must be fast; observer watches after and may be slow. Opposite timing, so they stay apart.Rules and how they run
ActionFixed set: block, allow or ask; remind; inject a hint; prepare in the backgroundThree template rules
StateThe current situation, folded from eventsEvents and state

State is why this is more than a hook. A rule that only looks at one moment needs nothing else. “Same tool failed three times in a row” needs memory, and with hooks every such rule hand-rolls a counter, its resets and session isolation.

Left out on purpose

Each can be added without rework; research notes are in _research_archive/.

  • Crash recovery and tamper resistance for persisted events
  • Offline replay to measure a new rule's false-positive rate
  • Adversarial security and secret redaction
  • Interruption budgets and automatic breakers; cooldown_s carries the load

Implementation status

The code is in openprogram/runtime/proactive/, tested but not installed at worker start. Per-action state: Rules and how they run.

Events and state

Last updated · 2026-11-25