As others are saying, if you don't have a strong alliance with their friends, or you haven't build up relations: always assume the AI may attack you! There are also periods in which certain AI become exceptionally aggressive.
For example, Shaka will turn super aggressive around the time he gets Impi. If you have Shaka as a neighbor, he's a ticking time bomb before he backstabs you. For diplo proof: I rescued a worker, I spread my religion, I declared friendship, and I was trading. Didn't matter, flipped in a turn and was fighting for my life.
Same with Carthage, don't let your guard down with Carthage. When they expand, it takes some strong diplomacy to keep them from turning against you! I wouldn't trust France, Greece, Siam, or Russia either. They're usually out to get you eventually.