Tight control of transgene expression is key to ensure the efficacy of a wide range of gene therapy interventions, in which the magnitude and duration of gene expression have to be adjusted to therapeutic needs, thereby limiting secondary effects. The development of upgraded strategies to link transgene expression to pathological stress episodes is an unmet need in gene therapy. Here, we propose an expression strategy that associates transgene expression to an intracellular stress coping mechanism, the unfolded protein response. Specifically, we harnessed the cis elements required to sustain the noncanonical splicing of X-box binding protein 1 (XBP1) messenger RNA (mRNA) in response to the dysfunction of the endoplasmic reticulum (ER), a situation commonly known as ER stress, to drive the expression of heterologous genes. Since ER stress features a wide variety of pathological conditions, including viral infections, cancer, or metabolic disorders, this new expression module stimulates the synthesis of therapeutic genes as a response to cellular damage, and ensures their expression only when necessary. Validation of this inducible expression system was performed in vitro and in vivo, and its potential to limit/inhibit viral infections has been shown in proof-of principle experiments.