{% extends "base.html" %} {% block title %}Behavioral Rules — Agent Wasp{% endblock %} {% block page_css %} {% endblock %} {% block content %}

Behavioral Rules

Learned from user corrections — shape every response

{{ rule_count }}
Total rules
{{ active_count }}
Active
{{ rule_count - active_count }}
Disabled
{{ learning_examples|length }}
Examples
{% if type_counts %}

By Type

{% for t, n in type_counts.items() %} {% set tcolor = {"refusal":"#ef4444","hallucination":"#f59e0b","wrong_skill":"#8b5cf6","missing_context":"#3b82f6"}.get(t, "#6b7280") %}
{{ t }} {{ n }}
{% endfor %}
{% endif %}
Learned Rules
{% if rules %}
{% for rule in rules %} {% set tcolor = {"refusal":"#ef4444","hallucination":"#f59e0b","wrong_skill":"#8b5cf6","missing_context":"#3b82f6"}.get(rule.rule_type, "#6b7280") %}
{{ rule.rule_type }}

{{ rule.description }}

{{ rule.created_at }} applied {{ rule.times_applied }}×
{{ (rule.confidence * 100)|int }}%
{% if rule.skill_poison %} ⚠ skill poison {% endif %}
{% endfor %}
{% else %}

No rules learned yet

Rules are created automatically when the agent detects correction patterns

{% endif %}
{% if learning_examples %}
Learning Examples top {{ learning_examples|length }} by usage
{% for ex in learning_examples %} {% endfor %}
Input Skills Outcome Used
{{ ex.user_input }} {{ ex.skill_calls }} {% if ex.outcome == "positive" %} positive {% else %} negative {% endif %} {{ ex.use_count }}
{% endif %} {% endblock %} {% block extra_scripts %} {% endblock %}