Responsible for the coupling of flagellin expression to flagellar assembly by preventing expression of the flagellin genes when a component of the middle class of proteins is defective. It negatively regulates flagellar genes by inhibiting the activity of FliA by directly binding to FliA. After completion of the hook-basal body structure, it is exported out of the cell through the completely assembled hook-basal body structures. The N-terminal domain is essential for export and the C-terminal domain possess the FliA binding site. Belongs to the FlgM family.