The anti-piracy patrol off the Somali coast is being handled as a criminal matter, not a military one. Thus warships are staffed with sailors or civilians skilled in the collection of evidence and compiling material needed to prosecute captured pirates in a court. The U.S. uses special detachments of Coast Guard personnel, who have served in the Caribbean, where drug smugglers also use small boats to move their cocaine. The Coast Guard investigators are supported by members of NCIS (Naval Criminal Investigative Service), and all of these folks are based on a large U.S. amphibious ship (currently the USS Boxer), off the north coast of Somalia, where Task Force 151 coordinates ships and maritime patrol aircraft from twenty nations.
The ships patrol the Gulf of Aden, scaring off pirates, or rushing themselves, or a helicopter, to the site of pirate attacks. The pirates leave when a warship or armed helicopter shows up. Each of the twenty nations contributing forces to Task Force 151, have different ROE (rules of engagement). Some ships are not allowed to capture pirates, or, if they do, must put them ashore as soon as possible. Other nations have made arrangements to turn captured pirates over the Kenya, or the fragile government of Puntland (where most of the pirate bases are located.) Some nations, like France, take captured pirates back to their home country for trial.
Any pirates caught by TF 151 ships may be kept on the USS Boxer, where a temporary jail has been used for that purpose. Several nations have made arrangements with Kenya to prosecute captured pirates. Thus the Coast Guard crime scene investigators must be available to testify in Kenyan court. U.S. personnel can interrogate pirates they capture, but none of that testimony can be used in a Kenyan court. The law there requires that all legally admissible interrogations be held before a Kenyan magistrate.
Changes in the international laws on piracy in since World War II have assumed that the kind of piracy taking place off Somalia (where ships are taken and held for ransom) would no longer occur (because such operations require a safe base for the pirates to operate from). For thousands of years, pirates often had such a safe haven. But in the century, it was believed that this sort of thing would no longer happen. Never say never, and keep the NCIS handy.