Rule-based detection