There are some 'associate' systems developed for military aircraft. These systems look at the known threat in the area (detected), and based on the threat and the geography of the area, determine where the threat can and can't see. The system then plots a course to keep the aircraft out of the range/line of sight of the threat.

I saw a couple proposals for converting that technology for use in commercial liners. They would have the associate systems take control and prevent the pilot from controlled flight into terrain or buildings. Something like that would be a lot easier to swallow than cameras and microphones throughout the cabin, keeping an eye and ear on the passengers.