Section 3E. Upon the filing with the attorney general of a written request by an officer or employee of any agency within the executive office of health and human services or the department of education, that the attorney general defend him in any action alleging an intentional or unintentional tort or other wrongful act or omission, or violation of the civil rights of any person under any federal or state law, arising out of the operation of said agencies within the executive office of health and human services or of the department of education, the attorney general shall, if after investigation it appears to him that such officer or employee was at the time the cause of action arose acting within the scope of his official duties of employment, take over the management and defense of such action. The attorney general may adjust or settle any such action at any time before, during or after trial, if he finds after investigation that the plaintiff is entitled to damages from such officer or employee.