An attenuator is a specific regulatory sequence in DNA which, when certain conditions are not met, forms a hairpin loop in mRNA and thereby immediately terminates transcription. This is important in prokaryotes because of the absence of a nucleus.

An example of attenuation is in the trp operon. When there is a high level of tryptophan in the region, the bacterium may not want to synthesise more because it wants to save energy. When the RNA polymerase binds and transcribes the trp gene, the ribosome will start translating. (This differs from eukaryotic cells, where RNA must exit the nucleus before translation starts.) The attenuator sequence, which is located between the mRNA leader sequence (5' UTR) and trp operon gene sequence, contains four domains, where domain 3 can pair with domain 2 or domain 4. The attenuator sequence at domain 1 contains instruction for peptide synthesis that requires tryptophans. A high level of tryptophan will permit ribosomes to translate the attenuator sequence domains 1 and 2, allowing domains 3 and 4 to form a G/C-rich hairpin structure (followed by a run of Us), which results in termination of transcription of the trp operon. Since the protein coding genes are not transcribed due to rho independent termination, no tryptophan is synthesised.