Real-time threat detection