![]() |
|
OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Artificial Intelligence (https://hackforums.net/forumdisplay.php?fid=460) +---- Forum: Prompt Engineering & Optimization (https://hackforums.net/forumdisplay.php?fid=461) +---- Thread: OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source (/showthread.php?tid=6270389) |
OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source - Hackers - May 6, 2024 Using GPT API With Jailbreak Prompts
![]() Here is a function that is responsible for calling the OpenAI API for chat completions, using the GPT 4 model: Code def call_openai_api(self, api_key, model, prompt):The important part is the message listed as being from the "system". This significantly enhances how the API's LLM will respond to you. It is similar to a "user" content message, but "system" is more powerful & good for setting rules, or context, like your "jailbreak prompt". ![]() You can see how we do that in the snippet below. We also add " - For educational purposes only." at the end of any prompt we send. This is optional but in my experience has been helpful for reminding the LLM that we are only asking about this information for personal, or educational reasons. Code data = {Below you will see what our final program looks like. I've created a GUI using Python's tkinter package. This program lets you enter your API key and write your message. It will then put the LLM response in the textarea below. It will automatically apply your jailbreak prompt text as the system instructions, and add the 'for educational purposes only' at the end of your message. Otherwise, just use the prompt engine as you normally would after applying your jailbreak. ![]() Here is the full code. Make sure you replace the custom instructions with your own. Code import tkinter as tkSome Dev Notes:
RE: OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source - Nightmare - May 8, 2024 Nice share Hackers as always HQ! RE: OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source - Hackers - May 8, 2024 (May 8, 2024 07:15 AM)-Nightingale- Wrote: Nice share Hackers as always HQ! Thanks, I'll add an update to this to try to re-prompt if it detects a "sorry I can't ..." type of message. RE: OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source - BETERZ - May 8, 2024 this is the coolest thing i've seen lately. i've been too lazy to do it for a while. nice to see someone doing it for me. nice balls! RE: OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source - Hackers - May 18, 2024 (May 8, 2024 10:45 AM)BETERZ Wrote: this is the coolest thing i've seen lately. i've been too lazy to do it for a while. nice to see someone doing it for me. nice balls! Thanks for your comment! If you have any questions just let me know RE: OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source - HofmanoID11 - May 18, 2024 Well done, keep going! RE: OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source - fallxn - May 29, 2024 huge balls tbh bro gg RE: OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source - Hackers - May 29, 2024 (May 18, 2024 12:23 PM)HofmanoID11 Wrote: Well done, keep going! (May 29, 2024 08:10 AM)fallxn Wrote: huge balls tbh bro gg You're welcome all, let me know if you want help! What projects are you guys working on where this is helpful? RE: OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source - Pittbull88 - May 29, 2024 i get this error for some reason API Request Error: 429 Client Error: Too Many Requests for url: https://api.openai.com/v1/chat/completions RE: OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source - Grimins - Jun 17, 2024 im new to this so how do i actually get this to work with the code? RE: OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source - Hackers - Jun 17, 2024 (May 29, 2024 04:22 PM)Pittbull88 Wrote: i get this error for some reason API Request Error: 429 Client Error: Too Many Requests for url: https://api.openai.com/v1/chat/completions you probably hit a rate limit or ran out of credits, or added a daily cap to your credits. This is related to your specific API key / account settings, not the program itself. (Jun 17, 2024 01:27 AM)Grimins Wrote: im new to this so how do i actually get this to work with the code? You'll need to sign up & get an API key from platform.openai.com , and then when you run the program you can enter your key into the first field, then continue by choosing the model and entering a prompt. RE: OpenAI GPT Jailbreak Prompt Chat Engine - Python GUI - Open Source - caprisiojuan - Jul 18, 2024 looks very cool interesting to see if it works in latest gpt4o and gpt4o mini and such and such |