[Bug]: Guardrail policy findings
Open
Nobody has claimed this yet.
Aspect/API
Severity/Minor
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
Gateway
Please select the aspect the issue is related to
Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)
Description
- No upstream status-code check before response-body validation
word-count-guardrail,sentence-count-guardrail,url-guardrail,pii-masking-regex,aws-bedrock-guardrail,azure-content-safety-content-moderation,content-length-guardrail,json-schema-guardrail,regex-guardrailall run their JSONPath extraction/validation on the response body regardless of the upstream LLM's HTTP status. An ordinary upstream failure (429/500/401, nochoicesfield) triggers each guardrail's own extraction-failure error, potentially masking the real upstream error.
- Raw internal Go error text returned to clients on JSONPath extraction failure
- unconditional in
pii-masking-regex,prompt-decorator,prompt-template,semantic-cache; gated behindshowAssessment(defaultfalse) inurl-guardrail,word-count-guardrail,sentence-count-guardrail,aws-bedrock-guardrail, and likely the rest of the guardrail family sharing the samebuildAssessmentObjecttemplate.
- unconditional in
- JSONPath is not supported for lists like $.messages
- when the JSONPath is configured as $.messages it does nothing
Steps to Reproduce
- Attach a policy (word count guardrail)
- Force the backend to return an error response (401 invalid key)
- observe the 1st scenario and the second scenario
- add the jsonpath as
$.messagesand observe that the guardrail not getting applied.
Severity Level of the Issue
Severity/Minor (Non-critical functionality. Can be fixed in future releases)
Environment Details (with versions)
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Gateway guardrail family named in the report and the shared buildAssessmentObject template. Reproduce the upstream 401/500 case, the JSONPath extraction failure, and the $.messages configuration to trace their response handling. Done means upstream errors remain identifiable, raw internal error text is not exposed, and list paths are applied.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100