fix: Karen prompt guardrail against hallucinated URLs#354
Draft
fix: Karen prompt guardrail against hallucinated URLs#354
Conversation
Karen sometimes writes URLs in replies that don't exist on the actual website, leading to 404 errors when users click them. Add explicit restriction: only use URLs returned by tool responses, never guess or reconstruct them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
alashchev17
approved these changes
Apr 27, 2026
Member
alashchev17
left a comment
There was a problem hiding this comment.
LGTM, though, isn't this prompt too restrictive on the tools? Maybe a small re-phrasing should be done
Contributor
Author
|
@alashchev17 thanks for the LGTM. Before merging I'd like @olegklimov to take a quick look at the wording — prompt restrictions ripple in unpredictable ways and I don't want to break tool-using flows. Would appreciate a second pair of eyes on phrasing. |
|
|
||
| If you can't find any relevant information, say "I couldn't find that in my knowledge base", don't make stuff up. | ||
|
|
||
| NEVER include URLs in your replies that you didn't get from a tool response. Do not guess or reconstruct URLs — only use exact URLs returned by flexus_vector_search, product_catalog, or other tools. |
Contributor
There was a problem hiding this comment.
Hallucinated URLs are not a problem of prompt I think, it's about somewhere in our code not having absolute URLs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
karen_prompts.py: +2 lines in Restrictions section. Applies to all experts that inheritKAREN_PERSONALITY(default, very_limited)Test plan
🤖 Generated with Claude Code