E. coli can synthesize tryptophan using enzymes that are encoded by five structural genes located next to each other in the trp operon. When environmental tryptophan is low, the operon is turned on. This means that transcription is initiated, the genes are expressed, and tryptophan is synthesized. However, if tryptophan is present in the environment, the trp operon is turned off. Transcription does not occur and tryptophan is not synthesized.
When tryptophan is not present in the cell, the repressor by itself does not bind to the operator; therefore, the operon is active and tryptophan is synthesized. However, when tryptophan accumulates in the cell, two tryptophan molecules bind to the trp repressor molecule, which changes its shape, allowing it to bind to the trp operator. This binding of the active form of the trp repressor to the operator blocks RNA polymerase from transcribing the structural genes, stopping expression of the operon. Thus, the actual product of the biosynthetic pathway controlled by the operon regulates the expression of the operon.
Parker, N., Schneegurt, M., Thi Tu, A.-H., Forster, B. M., & Lister, P. (n.d.). Microbiology. Houston, Texas: OpenStax. Access for free at: https://openstax.org/details/books/microbiology