In today's fast-paced digital landscape, security operations must adapt to meet the ever-evolving threat landscape. Detection-as-Code is a new approach that automates the creation, testing, and deployment of security detections, providing a more reliable and efficient method for security teams to stay ahead of cyber threats. This talk will provide an overview of the benefits and best practices of detection-as-code and how incorporating automated security validation as part of the detection process can efficiently reduce threat exposure.