If I recall you're safe to attack them.. in your own lands. You just can't attack them outside your own lands. And it's also safe to attack enemy fleets providing they're blockading a port of yours.