Nucleic acid tests (NATs) are essential for biomedical diagnostics. Traditional NATs, often complex and expensive, have prompted the exploration of toehold-mediated strand displacement (TMSD) circuits as an economical alternative. However, the wide application of TMSD-based reactions is limited by 'leakage'-the spurious activation of the reaction leading to high background signals and false positives. Here, we introduce the Y-Switch, a new TMSD cascade design that recognizes a custom nucleic acid input and generates an amplified output. The Y-Switch is based on a pair of thermodynamically spring-loaded DNA modules. The binding of a predefined nucleic acid target triggers an intermolecular reaction that activates a T7 promoter, leading to the perpetual transcription of a fluorescent aptamer that can be detected by a smartphone camera. The system is designed to permit the selective depletion of leakage byproducts to achieve high sensitivity and zero-background signal in the absence of the correct trigger. Using Zika virus (ZIKV)- and severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2)-derived nucleic acid sequences, we show that the assay generates a reliable target-specific readout. Y-Switches detect native RNA under isothermal conditions without reverse transcription or pre-amplification, with a detection threshold as low as ∼200 attomole. The modularity of the assay allows easy re-programming for the detection of other targets by exchanging a single sequence domain. This work provides a low-complexity and high-fidelity synthetic biology tool for point-of-care diagnostics and for the construction of more complex biomolecular computations.