Alagi was built in the CRDA shipyard, in Monfalcone. She was laid down on 19 March 1936, launched 15 November of the same year, and commissioned on 6 March 1937.
On 8 June 1942, Alagi torpedoed and sank the Italian destroyer Antoniotto Usodimare in a friendly fire incident.
On July 12, 1942 torpedoed and damaged Turkish tanker Antares causing her to be beached on Ruad Island off Tripoli, Syria. The tanker was later refloated, towed to Turkey and scrapped.
In August 1942 Alagi operated along the Italian Fleet to intercept and block an Allied convoy to Malta (Operation Pedestal). She succeeded in damaging the Royal Navy cruiser HMS Kenya, and sinking the M/V Clan Ferguson on 12 August.
Alagi, a member of the 7th Group - 71st Squadron of the submarine fleet, was still operating on 8 September 1943, when the Allies and Italy signed the armistice. Alagi arrived in Malta with the Regia Marina fleet. She was sold for scrap on 1 February 1948.