Policy as Code

Kairotic guardrails for agents: enforce hard rules and inject guidance at the right moment, not only in a giant upfront prompt.

Guardrails And Guidance

Policy hooks can block unsafe transitions and coach the next step in the same moment.

Kanbus policies are Git-style hooks for issue management. They enforce required process rules, then emit warnings and suggestions that help agents recover quickly and stay aligned.

Feature: Epic readiness guardrail

  Rule: Entry transitions require decomposition
    Scenario: Epic entering ready must have children
      Given the issue type is "epic"
      When transitioning to "ready"
      Then the issue must have at least 1 child issues

  Rule: Epic decomposition coaching
    Scenario: Epic creation reminder
      Given the issue type is "epic"
      When creating an issue
      Then warn "Create at least one child story or task before moving an epic to ready."
      Then explain "Epics represent milestones composed of multiple child issues."
      Then suggest "If this is one deliverable, model it as a story or task instead of an epic."

Why Kairos Matters

Right message, right moment, right context.

Programmatic timing beats prompt overload

This feature is about kairos: delivering procedural guidance exactly when the context says it matters. Agents are more reliable when trigger logic decides when to advise, instead of expecting the model to remember every rule from a one-time system prompt.

The result is fewer guardrail collisions, lower retry cost, and more consistent execution of standard operating procedures.

Hooks At Workflow Pace

Guidance runs after show, successful CRUD, list, and ready commands.

List-level hooks are especially useful in planning loops. For example, a policy can remind agents to keep issue states current while they triage and sequence work.

Feature: List guidance

  Rule: Planning loop reminders
    Scenario: Status hygiene reminder
      When listing issues
      Then suggest "Remember to reflect your current status in issue states as you work."

    Scenario: Ready queue reminder
      When listing ready issues
      Then warn "Ready means unblocked and actionable now."

CLI Workflow

Inspect, validate, enforce, and request guidance directly from the terminal.

# Validate policy syntax and structural correctness
kbs policy validate

# Check guardrails on a specific issue
kbs policy check kanbus-123

# Request guidance for a specific issue
kbs policy guide kanbus-123

# Disable guidance for one command
kbs --no-guidance list

# Disable guidance for a session
KANBUS_NO_GUIDANCE=1 kbs show kanbus-123

Step Library

Built-in filters, assertions, and guidance steps for practical policy authoring.

  • Operation filters: create, update, close, delete, view, list, ready
  • Hierarchy checks: parent/child status and minimum child count assertions
  • Field checks: required fields, labels, regex title patterns, custom fields
  • Guidance steps: warn, suggest, and attached explain lines