{% extends "base.html" %} {% block title %}Guardrail{% endblock %} {% block body %}

Guardrail simulator

A LangChain agent run gated by FathomCallbackHandler: each tool call is checked against policy before it executes. The scripted path is deterministic and needs no LLM. The live toggle is gated on the LLM endpoint ({{ llm_base_url }}) reachability and drives a LangChain ChatOpenAI agent.

Scripted feeds five canned tool calls (allowed read-only/admin tools plus a shell-exec hard block) through the real callback handler. Live requires langchain + langchain-openai and a reachable LLM.

{% if live_error %}
Live mode: {{ live_error }}
{% endif %} {% if timeline is not none %}

{{ "Live" if mode == "live" else "Scripted" }} run timeline ({{ timeline | length }} event{{ "" if timeline | length == 1 else "s" }})

{% if timeline %} {% for ev in timeline %} {% endfor %}
tooldecisionreasonrules fired
{{ ev.tool }} {{ ev.decision }} {{ ev.reason }} {{ ev.rule_trace | join(", ") if ev.rule_trace else "—" }}
{% else %}

No events were produced.

{% endif %}
{% endif %} {% endblock %}