The ability of a regulatory protein to sense the integrity of the bacterial flagellar structure was investigated.In response to a defective hook--basal body complex, the anti-``sigma''28 FlgM protein inhibits flagellin transcription. In cells with a functional hook--basal body complex, the flagellin genes are transcribed normally and the FlgM protein is expelled into the growth medium. In strains with a defective hook--basal body structure, FlgM is absent from the media. The presence of flagellin protein in the media is substantially reduced in strains carrying a FlgM-LacZ protein fusion, suggesting that the fusion is blocking the flagellar export apparatus. These results suggest that the FlgM protein assesses the integrity of the flagellar hook--basal body complex by itself being a substrate for export by the flagellar-specific export apparatus.