A senior executive at American International Group , the insurance giant under investigation for improper accounting , has struck a deal with the New York attorney general , Eliot Spitzer , to cooperate in exchange for immunity , people briefed on the details of the investigation said yesterday .