Skip to content

Guardrails: Filter validator API #1256

Closed

Description

@AkhileshNegi

Is your feature request related to a problem?
The current GET /api/v1/guardrails endpoint exposes the entire validator catalogue, including non-supported types. This can mislead tenants and result in confusion when integrating Glific guardrails v1.0.

Describe the solution you'd like

  • Filter the validators array to include only: topic_relevance_llm, uli_slur_match, gender_assumption_bias, and pii_remover.
  • Ensure the OpenAPI example and per-type reference document the same filtered set.
  • Maintain full functionality for POST/PATCH /guardrails/validators/configs without filtering.
  • Update the documentation in docs/wiki/modules/guardrails.md.
Original issue

Motivation

GET /api/v1/guardrails proxies the full validator catalogue from kaapi-guardrails (12 types today, including internal/experimental ones such as llm_critic, nsfw_text, llamaguard_7b, answer_relevance_custom_llm).

For the Glific guardrails v1.0 integration only four validators are productised and should be offered to tenants:

  • topic_relevance_llm (Scope Control)
  • uli_slur_match (Slur Match; replaces content_safety, v1.0 wants slur redaction only, no profanity pass)
  • gender_assumption_bias (Gender Neutrality)
  • pii_remover (Privacy Protection)

Exposing the rest in the list response lets UIs render validators we do not support yet.

Proposal

  • Filter the upstream validators array in the list route to an explicit EXPOSED_VALIDATOR_TYPES set, preserving upstream order and leaving non-catalogue payloads (error bodies, empty responses) untouched.
  • Render the OpenAPI example and the per-type reference in api/docs/guardrails_schemas.py from the same set so docs and response agree.
  • Only the list is filtered; POST/PATCH /guardrails/validators/configs still forward any type upstream.
  • Update docs/wiki/modules/guardrails.md.

Activity

  1. changed the title [-]Guardrails: limit GET /guardrails validator catalogue to the v1.0 types[/-] [+]Guardrails: Filter validator API[/+] on Oct 15, 2026
  2. added a commit that references this issue on Oct 15, 2026
    4f28e1b
  3. moved this from To Do to In Progress in Kaapi-devon Oct 15, 2026
  4. self-assigned this
    on Oct 15, 2026
  5. moved this from In Progress to Closed in Kaapi-devon Oct 15, 2026
  6. github-actions commented on Oct 16, 2026

    @github-actions

    🎉 This issue has been resolved in version 1.8.0-main.11 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions