SophyAI: Risk prevention and management in complex environments