Fail-Safe mode is activated by the Transmission Control Module (TCM) when a major electrical device has failed or when the vehicle has been driven under extreme conditions.
To confirm Fail-Safe mode, turn ignition key to ON (do not start), O/D amber light blinks for about 8 seconds.
Can you described previous operating conditions? If the speed sensor was starting to fail before going into fail-safe (erratic speed indication in speedomoter), then replace the speed sensor. If speed sensor was OK, Was the RPM indicator erratic before going into fail-safe? If yes, replace revolution sensor. If not, we need more information.
Did someone worked in the auto transmission before?
The troubleshooting procedures are extensive and hard to type all in here without having more details.