Laws and courts will of course vary throughout the world, but my understanding is that you're generally
not responsible for getting hit from behind, unless you're reversing or something, so I'm not sure why this is any more of a problem for self-driving cars.
Unless of course the car behind you is also self-driving. But then we've really just recursed.