Smart tunnel and dynamic risk analysis