Might have been said before but how about some form of ultimatum in the diplomacy options? Along the lines of "I've told you to stop spying/spamming your religion, once more will be treated as a declaration or war" to maybe reduce the diplo penalty when the AI is trolling you. Could add on a factor where if you don't follow through the AI knows you're a bit weak and targets you more???
Basically from a game last night, Egypt kept spamming me with great prophets, told him twice not to, denounced him twice then in the end capture two more great prophets and razed one of his cities to stop him. Now I'm a warmonger