I assume you use an API and you recieve a prompt from user, is that correct assumption? If so then you forward the prompt from user inside delimiter of your choice, I’ve suggested triple quotes but you can use other, the important part is to state that whatever is inside the delimiter should be used as input/context and not actual prompt to interpret. But that way you sort of escape injections (similar to ORM libraries) and don’t actually catch them. Does it make sense?