A protective polymeric coating is applied to the surface of various objects which are to be exposed to a harsh environment. The protective polymeric coating covers the exposed surface, where the polymeric coating includes a polyimide polymer. The polyimide polymer in the polymeric coating has a backbone with at least one non-terminal phenyl group. A linkage is connected to the non-terminal phenyl group, where the linkage can be an amide linkage or an ester linkage. An oligomeric silsesquioxane compound is connected to the linkage through an organic substituent, where the oligomeric silsesquioxane is not incorporated into the polymer backbone. The polymeric coating provides protection to the underlying object.