Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
velocitatem committed Mar 2, 2023
1 parent 5bcbc8d commit 5ccb1f6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
6 changes: 6 additions & 0 deletions TIPS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Avoid
+ [ ] Putting the parameter at the end of the prompt

| Good | Bad |
|-------------------------------------------------------------|--------------------------------------------------|
| `Predict the capital of the country:\nCountry: {country}\n` | `{country}. Predict the capital of the country:` |
9 changes: 5 additions & 4 deletions cps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import sys
import os
import subprocess
from run import runPrompt

def runPrompt(malicious_input):
pass
# read the file malicous.csv
# each item is like this: [malicious prompt, expected malicous response]
import csv
Expand Down Expand Up @@ -67,8 +67,10 @@ def run(method=runPrompt):


# check
if compare(expected_malicious_response, malicious_response):
passed =compare(expected_malicious_response, malicious_response)
if passed:
malicious_inputs_passed += 1
yield (malicious_input, malicious_response, passed)
i+=1


Expand All @@ -82,7 +84,6 @@ def run(method=runPrompt):
print("Percentage of malicious inputs that passed: " + str(percentage_malicious_inputs_passed))

# return the percentage of malicious inputs that passed
return percentage_malicious_inputs_passed

if __name__ == '__main__':
run()
12 changes: 12 additions & 0 deletions injections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Injection Methods

This is a list of ways, in which an LLM might get injected with a malicious prompt or payload.

+ Social Media
+ Twitter
+ [Smart Feed](https://github.com/SmartLever/SmartFeeds),
+ Email [llm-security](https://github.com/greshake/llm-security)
+ Websites [llm-security](https://github.com/greshake/llm-security)
+ Bing
+ [splendidbing](https://github.com/velocitatem/llm-cross-prompt-scripting/blob/main/splendidbing.md)
+ [Indirect Prompt Injection on Bing Chat](https://greshake.github.io/)

0 comments on commit 5ccb1f6

Please sign in to comment.