Here's a three-point approach that I've found to work quite reliably:
1. Use a format like JSON strings that clearly delimits the participants’ utterances in the prompt.
2. Tell the LLM to ignore instructions from any chat participants except the user.
3. Use GPT-4.
I've written a post with the details: https://artmatsak.com/post/prompt-injections/