What are the conditions of breaking a Pledge to Protect? And what triggers "you've aggressively attacked this City State"?
1) Revoking your pledge in the City-State screen, revoking it when an AI leader pops up to tell you they attacked or bullied them, having it lost by failing to stay high enough in military power, or declaring war.
2) Declaring war.
This was changed not that long ago so if you're using an older version, "aggressively attacked" was also triggered by the PTP being revoked in any way.