The federal government is imposing stricter limits, but no all-out ban, on the detention of minors in immigration holding centres.

Public Safety Minister Ralph Goodale issued the new directive today designed to keep families together and kids out of detention "as much as humanly possible."

The ministerial direction strengthens language to say the best interests of the child must be given "primary consideration," rather than just being a factor in any decision. It also ensures the welfare of the child is considered before any decision is made on the parents' detention.

"We are committed to an immigration system that protects public safety while treating people with fairness, dignity and compassion," Goodale told the House of Commons.

Alternatives to detention will be "actively and continuously" sought when unconditional release is inappropriate, according to a news release from Goodale's office.

Alternatives include in-person reporting, cash or performance bonds, community supervision and voice reporting.

The new directive prohibits the segregation of minors.

A study released earlier this year, called "Invisible Citizens: Canadian Children in Immigration Detention," revealed that dozens of children who are Canadian citizens have been held in immigration detention centres in conditions that can cause physical and psychological harm.

Produced by the International Human Rights Program at the University of Toronto's faculty of law, it found the best interests of the children were not adequately accounted for at the time of the arrest and detention of the mothers, and that the fundamental rights of the children were violated.

Reputation at stake

The report calls on the government to find better alternatives, including community housing, and warns that Canada's international reputation is at stake.

Today, Gloria Nafziger of Amnesty International welcomed the directive's key objective, but said its success will depend on how well Canada Border Service Agency officers understand that family unity is an imperative and that community partners can be trusted to assist with decisions.

She said there's a "critical need" for transforming the immigration detention system, and called for more resources directed to community supervision and less reliance on detention facilities.

"Immigration detention should always only be a last resort after all other options have been considered," she told CBC News. 

Implemented consistently

The Canadian Council for Refugees (CCR) also praised the new directive, but said language is still open to interpretation. She said it must be implemented consistently.

Despite a provision to use detention as a last option that has been in place since 2002, children have been routinely detained, or housed in detention with their parents, sometimes for months and even years.

The CCR said the CBSA should be overseen through an independent accountability mechanism that could receive complaints about non-compliance with directives on the detention of minors.

This past July, a Federal Court ruled that Canada's rules for detaining some foreigners who can't be deported quickly are constitutional, though they may not always be applied perfectly.

$138M in detention initiatives

Judge Simon Fothergill said there are mechanisms built into the law to allow detainees to challenge their detention and the conditions in which they are held, which is enough to make the system constitutional. Fothergill said even if those standards are sometimes not met, "this is a problem of maladministration, not an indication that the statutory scheme is itself unconstitutional."

The constitutional challenge was filed by Alvin Brown, a Jamaican man who was detained for five years before being deported last year.

Monday's announcement is part of the new National Immigration Detention Framework announced in August 2016, which came with up to $138 million to improve infrastructure, provide better mental and medical health services at holding centres, expand alternatives to detention, and reduce the number of minors in detention.