Skip to content

fix: Karen prompt guardrail against hallucinated URLs#354

Draft
deepmasq wants to merge 1 commit intomainfrom
feat/karen-no-hallucinated-urls
Draft

fix: Karen prompt guardrail against hallucinated URLs#354
deepmasq wants to merge 1 commit intomainfrom
feat/karen-no-hallucinated-urls

Conversation

@deepmasq
Copy link
Copy Markdown
Contributor

Summary

  • Adds explicit restriction to Karen's prompt: only use URLs returned by tool responses, never guess or reconstruct them
  • Addresses Fibery #2501 — Karen sometimes writes URLs that don't exist, leading to 404 when users click

Changes

  • karen_prompts.py: +2 lines in Restrictions section. Applies to all experts that inherit KAREN_PERSONALITY (default, very_limited)

Test plan

  • Run a Karen conversation asking about products/promotions
  • Verify bot only cites URLs from vector search results, never fabricates them

🤖 Generated with Claude Code

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>
Copy link
Copy Markdown
Member

@alashchev17 alashchev17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though, isn't this prompt too restrictive on the tools? Maybe a small re-phrasing should be done

@deepmasq
Copy link
Copy Markdown
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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hallucinated URLs are not a problem of prompt I think, it's about somewhere in our code not having absolute URLs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants