MILAN — Doctors Without Borders and others refused Monday to sign onto a new code of conduct drafted by Italy’s Interior Ministry for non-governmental organizations rescuing migrants at sea, as Italy seeks to increase security amid the unrelenting flow of migrant arrivals.

Italy’s government drafted the code after allegations emerged that some nonprofits were cooperating with migrant traffickers. Authorities have said that organizations that didn’t sign the code would risk being denied access to Italian ports.

Humanitarian groups sought changes in the government’s draft, objecting especially to rules requiring that they allow armed police to board their vessels and that they don’t transfer migrants to other ships, but bring them back to port themselves.

Doctors Without Borders director Gabriele Eminente said in Rome that the humanitarian group refused to accept allowing armed police aboard, saying the presence of weapons “conflicts with the principals we have throughout the world.”

According to the European Union’s border patrol agency Frontex, NGOs account for some 40 percent of sea rescues. Hundreds of thousands of migrants are brought to Italy each year after being rescued in the central Mediterranean after embarking from Libya in unseaworthy smugglers’ boats.

The aid groups say allegations that they are cooperating with migrant smugglings make their risky job even more dangerous by undermining trust in their work.

Just two of about 10 organizations, Save the Children and MOAS, agreed to the rules. Save the Children said its ship, Vos Hestia, already operates “in great part” in accordance with the new code.

Also refusing to sign were the German groups Jugend Rettet and Sea Watch, which both argued that the rules violate the law of the sea, according to the news agency ANSA. It quoted Titus Molkenbur of Jugend Rettet as saying that the code “doesn’t help us do our work, which is to save human lives.”