The Internet of Things (IoT) is already part of our daily lives, and will become even more so in the near future. The many characteristics that make the IoT different from the traditional networked computing, such as the close interaction with the physical world, also require us to pay particular attention to how to make such systems safe and secure. This document is part of a series that has previously addressed how to build more secure medical devices, connected vehicles, and electric power systems. In this document, we focus on the challenges associated with composing systems, rather than building individual programs or devices. We use the concept of smart cities to illustrate how design for safety, security, and privacy must consider emergent properties, and how a system or technology designed for this domain must account for how it might be integrated, reused, or composed with other technologies and systems.