Colicin A and B immunity proteins (Cai and Cbi, respectively) are homologous integral membrane proteins that interact within the core of the lipid bilayer with hydrophobic transmembrane helices of the corresponding colicin channel. By using various approaches (exchange of hydrophilic loops between Cai and Cbi, construction of Cbi/Cai hybrids, production of Cai as two fragments), we studied the structure-function relationships of Cai and Cbi. The results revealed unexpectedly high structural constraints for the function of these proteins. The periplasmic loops of Cai and Cbi did not carry the determinants far colicin recognition although most of these leaps were required for Cai function; the cytoplasmic loop of Cai was found to be involved in topology and function of Cai. The immunity function did not seem to be confined to a particular region of the immunity proteins.