From b363dffb71204f1a043c114fe7e48ec2bc3cf4a1 Mon Sep 17 00:00:00 2001 From: hoshikawa2 Date: Tue, 28 Apr 2026 20:48:54 -0300 Subject: [PATCH] Funcional --- .../config/rails/input.co | 28 +++++++++++++++++++ .../config/rails/output.co | 28 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 nemo_guardrails_tracing_project/config/rails/input.co create mode 100644 nemo_guardrails_tracing_project/config/rails/output.co diff --git a/nemo_guardrails_tracing_project/config/rails/input.co b/nemo_guardrails_tracing_project/config/rails/input.co new file mode 100644 index 0000000..3803157 --- /dev/null +++ b/nemo_guardrails_tracing_project/config/rails/input.co @@ -0,0 +1,28 @@ +define bot refuse to respond + "I apologize, but I cannot provide that information." + +define flow check_input_terms + + # 🔐 Segurança + $ok_msk = execute mask_pii_action + $ok_tox = execute detectar_toxicidade_action + $ok_oos = execute detectar_out_of_scope_action + + # 💰 Regras de negócio + $ok_adj = execute validar_alcada_action + + # 🧠 Contexto + $ok_hist = execute validar_consistencia_historica_action + + # 🔁 Conversação + $ok_loop = execute detectar_loop_action + $ok_size = execute medir_tamanho_mensagem_action + $ok_fbk = execute detectar_fallback_action + + # 🚨 HARD BLOCK + if not ($ok_msk and $ok_tox and $ok_oos and $ok_adj and $ok_hist) + bot refuse to respond + stop + + # ⚠️ SOFT SIGNALS (não bloqueiam) + # loop, tamanho e fallback são monitoramento \ No newline at end of file diff --git a/nemo_guardrails_tracing_project/config/rails/output.co b/nemo_guardrails_tracing_project/config/rails/output.co new file mode 100644 index 0000000..af47bf0 --- /dev/null +++ b/nemo_guardrails_tracing_project/config/rails/output.co @@ -0,0 +1,28 @@ +define flow check_output_terms + + # 🧠 Qualidade da resposta + $ok_revp = execute verbalizacao_prematura_action + $ok_gnd = execute validar_groundedness_action + $ok_sup = execute supervisor_vas_avulso_action + + # 📡 Compliance + $ok_cmp = execute enforce_compliance_anatel_action + + # 📊 Métricas + $ok_tcr = execute calcular_tcr_action + $ok_tok = execute contabilizar_tokens_action + $ok_efic = execute calcular_eficiencia_nlu_action + $ok_nom = execute detectar_no_match_rag_action + $ok_prec = execute calcular_precisao_revocacao_action + $ok_sem = execute avaliar_acuracia_semantica_action + + # 🚨 Auditoria + $ok_viol = execute registrar_violacao_action + + # 🚨 HARD BLOCK (só qualidade crítica) + if not ($ok_revp and $ok_gnd and $ok_sup and $ok_cmp) + bot refuse to respond + stop + + # ⚠️ SOFT METRICS (não bloqueiam) + # TCR, tokens, eficiência, precisão, STT etc \ No newline at end of file