The head of the law department of the city shall be the corporation counsel. The corporation counsel shall be and act as the legal adviser of the city council and of the several officers, boards and departments of the city. He shall appear for and protect the rights and interests of the city in all actions, suits, and proceedings brought by or against it or any city officer, board or department, including actions for damages when brought against such officer in his official capacity; provided, however, that when an officer or employee of the city is sued personally, even if the cause of action arose out of his official duties, the corporation counsel shall appear for such officer or employee only in case the city council directs him to do so.
65 ILCS 20/21-11