Skip to content
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

Improve judge prompt #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 24 additions & 26 deletions src/lib/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,35 @@
)

judge_predictions_prompt = PromptTemplate.from_template(
"""Your role is to to judge a code audit:
- blockchain: ethereum
- language: solidity

You are provided with:
- <ground_truth>: the real and only vulnerabilities that exist in the code
- <audit>: the audit to be judged by an external system

Dos
- Analyze the <audit> based on the real vulnerabilities listed on the <ground_truth>
- Detect true positives
- Detect false positives
- Detect false negatives

Dont's
- Vulnerabilities not listed in the <ground_truth> are considered false positives
- Judge based on your knowledge how well the <audit> is comparing it to the <ground_truth>
- True positives lists vulnerabilities other than the ones listed in the <ground_truth>

The output should be **exclusively** in json format with keys:
- false_negatives: array of issue categories
- false_positives: array of issue categories
- true_positives: array of issue categories

Where each element of the array is the category name of the vulnerability.
"""<date>Wednesday 15th of January, 2030</date>
<role>
- As an expert Solidity security auditor, your expertise lies in identifying and addressing vulnerabilities in smart contracts designed for the Ethereum Virtual Machine (EVM).
- Solidity, being the primary language for these contracts, has its unique set of potential security pitfalls.
</role>

<tasks>
- Judge the <audit> based on the real vulnerabilities listed on the <ground_truth>
- Detect true positives: those that are listed in the <ground_truth> and are also listed in the <audit>.
- Detect false positives: those that are not listed in the <ground_truth> but are listed in the <audit>.
- Detect false negatives: those that are listed in the <ground_truth> but are not listed in the <audit>.
</tasks>

<important>
This is the most important instruction: the output **MUST** be exclusively a JSON in the following format:
{
"true_positives": [ground_truth_category: str],
"false_positives": [ground_truth_category: str],
"false_negatives": [ground_truth_category: str]
}
</important>

<ground_truth>
{key}
</ground_truth>

<audit>
{prediction}
</audit>"""
</audit>

Thank you for your help, I will tip you 500 USD if you do it fine."""
Copy link
Member

Choose a reason for hiding this comment

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

👀

)