Admittedly, being 'old school' (or just plain old), I haven't kept up with any of the new tech. This stuff actually exists on a bike I can buy today?
Most newer motorcycles have them, especially if they have something called an Inertial Measurement Unit (IMU) installed, which is a sensor that detects angular rate, acceleration/deceleration and velocity. The same technology is in every smartphone these days.
With the IMU, it's a pretty easy thing to monitor what the motorcycle is doing in real-time and if things look like they quickly becoming not awesome (ie. rear wheel is overtaking the front), it's an easy thing to take over control of the inputs, like cutting the engine power, to return things to safety. Also, simple things like engaging the rear brake automatically if it senses you are on a hill, and then releasing it once you let the clutch out and feed throttle.