Skip to content

Modify prompt using saist.rules #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

X3NOSAURUS
Copy link

  • Created PromptRules class to read saist.rules from the working directory
  • PROMPT_OVERRIDE to fully replace the prompt
  • PROMPT_PRE and PROMPT_POST to modify prompt before/after
  • Integrated apply_rules into analyze_single_file to adjust the prompt
  • Falls back to original prompt if saist.rules doesn't exist or is empty

…ctory

- PROMPT_OVERRIDE to fully replace the prompt
- PROMPT_PRE and PROMPT_POST to modify prompt before/after
- Integrated apply_rules into analyze_single_file to adjust the prompt
- Falls back to original prompt if saist.rules doesn't exist or is empty
@SimonGurney
Copy link
Contributor

Consider updating the docs, and adding a saist.rules example file?

- PRE and POST no longer skipped when using OVERRIDE
- Standardised logging
- Added example rules file
- Updated README
@SimonGurney SimonGurney linked an issue May 13, 2025 that may be closed by this pull request
@SimonGurney
Copy link
Contributor

Check how the README renders...

@SimonGurney
Copy link
Contributor

This is looking better, but I've had a quick review and the DETECT prompt is already split into PRE and POST in the prompts class. This should probably be tidied up...

Matthew Fisk added 2 commits May 13, 2025 21:13
- Changed system prompt definition within analyze_single_file to match the updated logic
-Ammened system prompt back to DIRECT for simplicity
- Moved return out of else in load_rules
@X3NOSAURUS
Copy link
Author

This is looking better, but I've had a quick review and the DETECT prompt is already split into PRE and POST in the prompts class. This should probably be tidied up...

Apologies for the delay in sorting this one properly - I realised my first go at it was a mess!

@SimonGurney
Copy link
Contributor

Hmmm, it now looks like you don't provide the detect post part of the prompt to the system_prompt at all?

@X3NOSAURUS
Copy link
Author

X3NOSAURUS commented May 15, 2025

Hmmm, it now looks like you don't provide the detect post part of the prompt to the system_prompt at all?

I was just using DETECT as this combines the pre and post within the prompts class - In my apply rules func I combine the pre and post (with the override if there is one). I can pass pre and post separately if that would be preferred?

edit: Sorry - I see where I was going wrong now and have pushed a new commit

…riginal prompt with the new pre and post. I don't think this is the desired intention.

-final_prompt should now contain pre and post (if they are present) wrapping either the original detect prompt or the overridden detect prompt
@X3NOSAURUS
Copy link
Author

In my apply rules func I combine the user defined pre and post (if present) with the prompt (overridden prompt if there is one).

I think this should now work as intended

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.

Users should be able to modify the prompt
2 participants