wso2 / wso2/api-platform

[Bug]: Unwanted params attached to guardrails

Open
#1,592 1 comment 0 reactions 1 assignee View on GitHub

@Sithumli is already working on this.

Since Apr 13, 2026.

1.0.0 Area/AIGateway Area/Management Aspect/AI Aspect/API Severity/Trivial Type/Bug
Dominant language
Go
Stars
71
Forks
111
Avg merge
1d 14h
Merged PRs (30d)
110

Description

Please select the area the issue is related to

Area/Management (Management API or Management Portal UI), Area/AIGateway (AI Gateway runtime/control plane)

Please select the aspect the issue is related to

Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI), Aspect/AI (AI/LLM integration, MCP, AI readiness)

Description

There are some unwanted params attached to the guardrails deployed in the gateway. This can be observed through the policy engine config dump. This does not seem to impact the functionality.

{
            "name": "word-count-guardrail",
            "version": "v1",
            "enabled": true,
            "execution_condition": null,
            "parameters": {
              "attachedTo": "route",
              "completionTokens": {
                "identifier": "$.usage.completion_tokens",
                "location": "payload"
              },
              "promptTokens": {
                "identifier": "$.usage.prompt_tokens",
                "location": "payload"
              },
              "remainingTokens": {
                "identifier": "x-ratelimit-remaining-tokens",
                "location": "header"
              },
              "request": {
                "enabled": true,
                "invert": false,
                "jsonPath": "$.messages[-1].content",
                "max": 5,
                "min": 3,
                "showAssessment": false
              },
              "requestModel": {
                "identifier": "$.model",
                "location": "payload"
              },
              "response": {
                "enabled": false,
                "invert": false,
                "jsonPath": "$.choices[0].message.content",
                "max": 0,
                "min": 0,
                "showAssessment": false,
                "streamingJsonPath": "$.choices[0].delta.content"
              },
              "responseModel": {
                "identifier": "$.model",
                "location": "payload"
              },
              "totalTokens": {
                "identifier": "$.usage.total_tokens",
                "location": "payload"
              }
            }
          },
Steps to Reproduce

Deploy an LLM provider with a guardrail (or any policy) attached.

Severity Level of the Issue

Severity/Trivial (Cosmetic issues. Can be fixed in future releases)

Environment Details (with versions)

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.