ProjectTech4DevAI / ProjectTech4DevAI/kaapi-guardrails
Add limit to rephrase on_fail action
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5
- Forks
- 3
- Avg merge
- 9d 13h
- Merged PRs (30d)
- 2
Description
Which feature or component needs enhancement?
The rephrase on_fail action has no limits of calling. In each successive iteration, harmful text can keep on getting detected and in the worse case, it might mean an endless loop of nudging the user / LLM to rephrase their response. We need to put a limit on how many times this can be called for a single query.
Describe the current behavior
We have added a custom on_fail action called "rephrase" which nudges the user or LLM to rephrase their query since we have detected harm in the message. However, we don't have a limit as to how many times this "rephrase" on_fail action can be called if it keeps on detecting harmful text.
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 rephrase on_fail action and the code that invokes it for successive queries; the issue names no files or tests. Determine where per-query invocation counts are tracked and what existing tests cover, then verify that repeated harmful input stops after a defined limit without creating an endless loop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100