Modern nanofabrication techniques have opened the possibility to create novel functional materials, whose properties transcend those of their constituent elements. In particular, tuning the magnetostatic interactions in geometrically frustrated arrangements of nanoelements called artificial spin ice can lead to specific collective behaviour, including emergent magnetic monopoles, charge screening and transport, as well as magnonic response. Here, we demonstrate a spin-ice-based active material in which energy is converted into unidirectional dynamics. Using X-ray photoemission electron microscopy we show that the collective rotation of the average magnetization proceeds in a unique sense during thermal relaxation. Our simulations demonstrate that this emergent chiral behaviour is driven by the topology of the magnetostatic field at the edges of the nanomagnet array, resulting in an asymmetric energy landscape. In addition, a bias field can be used to modify the sense of rotation of the average magnetization. This opens the possibility of implementing a magnetic Brownian ratchet, which may find applications in novel nanoscale devices, such as magnetic nanomotors, actuators, sensors or memory cells.