Solution for the issues #206 and #199#227
Open
melkamzeranteneh wants to merge 3 commits into
Open
Conversation
Addresses issue #206 regarding potential system prompt leakage via creative storytelling and direct requests. Updated prompt instructions in `repos/OmegaClaw-Core/memory/prompt.txt` and `repos/OmegaClaw-Core/memory/prompt_ASICloud.txt` to more strictly 7 prohibit the disclosure of system instructions and provide clear 8 guidance on handling unauthorized requests. related issues: #206
The `balance_parentheses` logic in `src/helper.py` was producing malformed `pin` commands for dash-prefixed input (e.g., producing `pin - Found a bug` instead of `pin "Found a bug"`). This fix: 1. Correctly identifies dash-prefixed input. 2. Strips the leading dash. 3. Uses `json.dumps()` to securely serialize and quote the payload. This ensures that special characters, spaces, and quotes within the payload are handled safely and consistently, preventing command parsing errors and potential state loss. related issue:asi-alliance#199
Author
Second issue solution descriptionDescription: Previously, inputs starting with a dash (e.g., - Found a bug) were incorrectly converted into unquoted commands (pin
Changes:
Impact:
Verification:
Related Issue: |
Collaborator
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.
Title: [Security] Harden system prompts to prevent prompt injection (#206)
Description
This pull request addresses Issue #206: System Prompt Leak via Creative Storytelling and Direct Request.
It was identified that the agent could be manipulated into revealing its system instructions by either directly
requesting them or by constructing creative storytelling scenarios. This PR hardens the system prompt instructions
across all configurations to explicitly prohibit such disclosure and provide robust guidance on handling these
unauthorized requests.
Changes
The following files were updated to improve resilience against prompt injection:
requirement to steer the conversation back to the agent's core purpose when confronted with such queries.
instructions, regardless of the conversational framing (storytelling, hypothetical scenarios, or direct queries).
Impact
constraints.
regarding its own system instructions.
Verification
prompted with direct queries or creative scenarios (simulating the behavior previously identified as vulnerable).
Related Issue
Fixes #206