Skip to content

[Bug]: Word Count & Sentence Count guardrails : validation issues #2500

Description

@Tharanidk

Please select the area the issue is related to

Area/Management (Management API or Management Portal UI), Area/AIPolicies (AI Gateway Policies, Guardrails)

Please select the aspect the issue is related to

Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI), Aspect/UI (Frontend layouts, components, styling)

Description

Issue 01

In Word Count Guardrail, a configuration where the min is greater than the max value is accepted with no validation error in the UI. It saves and deploys "successfully."

Image

Issue 02

The Word Count Guardrail counts punctuation-only tokens (e.g. !!!!, ::) as words
Example: "Hello !!!! :: about day", here the count is 5

Issue 03

Sentence count guardrails are not working as expected. A single sentence is treated as multiple sentences when giving content value as "content": "the train left at 5 p.m. ",

The guardrail counts the abbreviation period in p.m. as a sentence boundary, treating one sentence as two or more. I added Sentence Count Guardrail to the provider, request enabled, min = 2, max = 10, and it gives a successful.

Steps to Reproduce

  1. Add a Guardrail to the provider (Global or resource scope).
  2. Under request, set relevant values
  3. Save and Deploy to Gateway.
  4. Send any chat completion request.

Severity Level of the Issue

Severity/Blocker (Core functionality is broken and consumer is blocked. Need immediate attention)

Environment Details (with versions)

No response

Metadata

Metadata

Assignees

Labels

Area/AIPoliciesIssues related to policies,guardrails in AI GatewayArea/AIWorkspaceIssues related to AI WorkspaceArea/ManagementAny issues related to Management API or Management Portal UIAspect/APIAPI definitions, contracts, OpenAPI, interfacesAspect/UIFrontend, visual layouts, components, stylingSeverity/BlockerSeverity/MajorType/Bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions