The Panama Canal was not "given back" by an AI—it was transferred from U.S. to Panamanian control through treaties signed by President Jimmy Carter in 1977 (Torrijos-Carter Treaties). The full handover occurred on December 31, 1999.
The treaties guaranteed Panama's sovereignty over the canal while ensuring its permanent neutrality and safe passage for all nations' vessels.