Many animals show an aversion to bright, open spaces, with significant variability seen across species, populations and individuals within populations. Although there is much interest in the underlying causes of this behaviour, few studies have been able to systematically isolate the role of heritable and environmental effects. Here, we addressed this gap using a common garden experiment with cavefish. Specifically, we bred and cross-bred cave loaches (
Barbatula barbatula
), Europe's only known cavefish, in the laboratory, raised the offspring in complete darkness or normal light conditions, and studied their light avoidance behaviour. Cavefish spent much more time in a light area and ventured further out, while surface fish spent considerable time in risk-assessment behaviour between the light and dark areas. Hybrids behaved most similarly to cavefish. Light treatment and eye quality and lens size only had a modest effect. Our results suggest light avoidance behaviour of cavefish has a heritable basis and is fundamentally linked to increased boldness rather than reduced vision, which is likely adaptive given the complete lack of macropredators in the cave environment. Our study provides novel experimental insights into the behavioural divergence of cavefish and contributes to our broader understanding of the evolution of boldness and behavioural adaptation.