Interesting idea. For starters I’m not sure this would be achievable using only Prefect since it has a whole system and philosophy around state dependencies and management. Which means it may take some external process.
Assuming the flow is running in a single process then you could take a harsh process exiting approach to this. Using a state handler, when a task enters a failed state exit the entire process.
I welcome other ideas on this from a core perspective. Seems pretty similar to the Cancel feature of Cloud 😉