The physics of instabilities in the precursor of relativistic collisionless shocks is of broad importance in high energy astrophysics, because these instabilities build up the shock, control the particle acceleration process and generate the magnetic fields in which the accelerated particles radiate. Two crucial parameters control the micro-physics of these shocks: the magnetization of the ambient medium and the Lorentz factor of the shock front; as of today, much of this parameter space remains to be explored. In the present paper, we report on a new instability upstream of electron-positron relativistic shocks and we argue that this instability shapes the micro-physics at moderate magnetization levels and/or large Lorentz factors. This instability is seeded by the electric current carried by the accelerated particles in the shock precursor as they gyrate around the background magnetic field. The compensation current induced in the background plasma leads to an unstable configuration, with the appearance of charge neutral filaments carrying a current of the same polarity, oriented along the perpendicular current. This ``current-driven filamentation instability grows faster than any other instability studied so far upstream of relativistic shocks, with a growth rate comparable to the plasma frequency. Furthermore, the compensation of the current is associated with a slow-down of the ambient plasma as it penetrates the shock precursor (as viewed in the shock rest frame). This slow-down of the plasma implies that the ``current driven filamentation instability can grow for any value of the shock Lorentz factor, provided the magnetization sigma <~ 10^{-2}. We argue that this instability explains the results of recent particle-in-cell simulations in the mildly magnetized regime.