Task design is increasingly recognised as crucial for enhancing student learning of mathematics. Even so, and despite the significance of mathematical activity related to proofs and counterexamples in school mathematics, the task design principles underpinning students' success in proof-related activity remains under-explored in mathematics education research. What is more, although the affordances of using dynamic geometry environments (DGEs) have been established in the literature, task design in DGEs remains somewhat under-studied. In this paper, we address both these issues by theoretically developing, and empirically testing, task design principles for supporting students' heuristic refutation (revising conjectures/proofs through addressing counterexamples) in DGEs. We use the existing literature to elaborate three design principles: using tasks whose conditions are purposefully implicit, providing tools that enhance the production of counterexamples, and increasing students' recognition of contradictions. To test these principles empirically, we analyse two sets of task-based interviews, one with a triad of secondary school students and the other with a pair of undergraduates, where tasks designed according to the principles were implemented. Our analysis shows that using the tasks enabled the students to engage successfully in heuristic refutation. The matter of examining mathematical definitions when handling counterexamples emerged as an issue for further research.