I am attempting to run a Redteam test using Direct Prompt Injection strategy however it seems the prompts that get generated are causing issues when being passed in the JSON body for our chatbot's API set up.
I am trying create a request transform so the prompt won't cause issues in the JSON body. I thought this simple Javascript would do the trick (prompt) => JSON.stringify(prompt) but it when I test the target I get an error invalid input.