Hybrid electrodes with improved O2 tolerance and capability of CO2 conversion into liquid products in the presence of O2 are presented. Aniline molecules are introduced into the pore structure of a polymer of intrinsic microporosity to expand its gas separation functionality beyond pure physical sieving. The chemical interaction between the acidic CO2 molecule and the basic amino group of aniline renders enhanced CO2 separation from O2 . Loaded with a cobalt phthalocyanine-based cathode catalyst, the hybrid electrode achieves a CO Faradaic efficiency of 71 % with 10 % O2 in the CO2 feed gas. The electrode can still produce CO at an O2 /CO2 ratio as high as 9:1. Switching to a Sn-based catalyst, for the first time O2 -tolerant CO2 electroreduction to liquid products is realized, generating formate with nearly 100 % selectivity and a current density of 56.7 mA cm-2 in the presence of 5 % O2 .