Skip to content
4 changes: 4 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@
# to streaming requests for OpenAI-compatible providers
# ENFORCE_RETURNING_USAGE_DATA=true

# Enable/disable guardrails globally (default: false)
# When enabled, configured guardrails can run for workflows that reference them
# GUARDRAILS_ENABLED=false

# Guardrails for inline batch processing (default: false)
# When true, guardrails are applied to inline /v1/batches request items
# (e.g. /v1/chat/completions and /v1/responses items).
Expand Down
23 changes: 23 additions & 0 deletions internal/admin/dashboard/dashboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,29 @@ func TestStatic_ServesExecutionPlansModuleJS(t *testing.T) {
}
}

func TestStatic_ServesGuardrailsModuleJS(t *testing.T) {
h, err := New()
if err != nil {
t.Fatalf("New() returned error: %v", err)
}

e := echo.New()
req := httptest.NewRequest(http.MethodGet, "/admin/static/js/modules/guardrails.js", nil)
rec := httptest.NewRecorder()
c := e.NewContext(req, rec)

if err := h.Static(c); err != nil {
t.Fatalf("Static() returned error: %v", err)
}

if rec.Code != http.StatusOK {
t.Errorf("expected 200, got %d", rec.Code)
}
if rec.Body.Len() == 0 {
t.Error("expected non-empty body for guardrails module JS file")
}
}

func TestStatic_ServesFavicon(t *testing.T) {
h, err := New()
if err != nil {
Expand Down
Loading
Loading