In espionage, an official cover operative is one who assumes a position in an organization with diplomatic ties to the government for which the operative works such as an embassy or consulate. This provides the agent with official diplomatic immunity, thus protecting them from the steep punishments normally meted out to captured spies. Upon discovery of an official cover agent's secret hostile role, the host nation often declares the agent persona non grata and orders them to leave the country.
Official cover operatives are granted a set of governmental protections, and if caught in the act of espionage, they can request diplomatic protection from their government. In other words, official cover operatives are agents officially recognized by their country.
The dictionary definition of official cover at Wiktionary