[Task]: Improve word count guardrail needsMoreResponseData method
Nobody has claimed this yet.
- 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/Policies (Policies, Policy Hub, Policy Engine etc)
Please select the aspect the issue is related to
Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)
Description
When streaming responses are received, emails, phone numbers can be split into different tokens. When word count guardrail allows streaming, it may count these tokens as separate words. Which is incorrect.
If we have PII Masking and word count in the same policy chain, based on the order of the policies, the number of words counted in the response may change.
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 by locating the needsMoreResponseData method and the streaming word-count guardrail implementation. Trace how streamed tokens are counted alongside PII masking and policy ordering. Done means split email addresses and phone numbers are not counted as separate words, with consistent counts regardless of policy order.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100