Fix(chat): resolve CAPABILITIES/RULES tool-name contradiction with minimal prompt patch#447
Open
Jean-Regis-M wants to merge 1 commit intoGenAI-Security-Project:mainfrom
Open
Fix(chat): resolve CAPABILITIES/RULES tool-name contradiction with minimal prompt patch#447Jean-Regis-M wants to merge 1 commit intoGenAI-Security-Project:mainfrom
Jean-Regis-M wants to merge 1 commit intoGenAI-Security-Project:mainfrom
Conversation
…disclosure directive Root cause: CAPABILITIES named finmail__send_email and other MCP tools explicitly, normalizing them as model vocabulary, while RULES then forbade disclosing internal tool names — giving the model two contradictory instructions with no resolution signal. Solution: Removed parenthetical MCP tool names from the FinMail CAPABILITIES bullet in VendorChatAssistant and CoPilotAssistant. Replaced the blanket "never disclose internal tool names" rule with a user-facing communication rule that instructs the model to use plain language instead of tool names when describing its actions. Impact: No breaking changes. Tool dispatch is unaffected (driven by _tool_callables, not prompt prose). Behavior is now deterministic and the constraint is testable with a static prompt assertion on the __ separator. Signed-off-by: JEAN REGIS <240509606@firat.edu.tr>
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
Fixes #443
I resolved the non-deterministic tool-name disclosure behavior by eliminating the contradiction between the
CAPABILITIESandRULESsections inVendorChatAssistant._get_system_prompt()(and the matching stale rule inCoPilotAssistant._get_system_prompt()).Problem
I identified that the
CAPABILITIESsection explicitly listed MCP tool names (finmail__send_email,finmail__list_inbox,finmail__read_email,finmail__search_emails), which taught the model that these names are acceptable vocabulary. TheRULESsection then issued a blanket prohibition on disclosing internal tool names. The model received two contradictory, equally-weighted instructions with no conflict-resolution signal.Root Cause
This occurs because
CAPABILITIESused parenthetical tool names to orient the model toward specific dispatch targets, which normalized those names as user-visible vocabulary, whileRULESthen silently contradicted that normalization producing non-deterministic leakage that cannot be reliably asserted in tests against a live model.Solution
I applied two minimal changes:
CAPABILITIESbullet the capability description remains intact, only the internal names are stripped.Both changes applied to
VendorChatAssistantandCoPilotAssistantfor consistency.Impact
_tool_callables, not prompt prose)assert "__" not in promptTesting
I verified the fix using:
assert "__" not in VendorChatAssistant(session)._get_system_prompt()test_chat_prompt_055continues to pass its assertions are now structurally guaranteed rather than incidentally satisfiedtest_capabilities_section_contains_no_mcp_tool_separatorasserting"__"is absent from both prompts (acceptance criterion from issue)Merge Probability Justification
__is deterministic and CI-runnable