As the number of connected devices (and sensors) in the world grows with high momentum, the scenarios on using these devices and data have also expanded. Many of these scenarios (e.g., home automation) require tools beyond data visualizations, to express user intents and to ensure interactions do not cause undesired effects in the physical world. To this end, we present SIFT, a safety-centric programming platform for connected devices in IoT environments. First, to simplify programming, users express high-level intents in declarative IoT apps. The system then decides which sensor data and operations can be combined to satisfy user intents. Second, to ensure consistency and safety, the system verifies whether conflicts or policy violations can happen between applications. Through an office deployment, trace analysis using a large-scale dataset from a commercial IoT app authoring platform, and user studies, we demonstrate the power of SIFT and highlight how it performs scalable IoT app conflict detection and leads to more robust and reliable IoT apps.