Attorney general Lord Goldsmith QC has said Britain is seeking assurances the men would not be tortured or killed.
Nine Law Lords are hearing a challenge to the government's right to detain foreign terror suspects without trial.
In his written submissions to the Law Lords, Lord Goldsmith says documents to secure deportations are being written.
The House of Lords - which has 12 full-time Law Lords, or senior judges - is the final court of appeal in the UK.
Nine Law Lords, rather than the usual five, are sitting because of the constitutional importance of the legal challenge.
The case focuses on nine suspects who have been held for up to three years.
The detainees' legal team argue it is wrong for them to be held without charge indefinitely and wrong to single out foreign nationals.
The government believes the measure is justified because of the scale of the terrorist threat after 11 September.
The detainees, many of whom are detained in Belmarsh maximum security prison in London, cannot be put on trial because evidence is too secret or would be inadmissible in a criminal court, the government claims.
The Anti-Terrorism, Crime and Security Act allows the imprisonment without trial of foreign nationals certified by the home secretary as a threat to national security, but who cannot be sent home because they might face death or torture.
The government opted out of Article 5 of the European Convention on Human Rights (ECHR), the right to liberty and security of person, in order to introduce the new anti-terrorism laws.
A legal challenge was mounted but in August, three Court of Appeal judges decided by a two-to-one majority that the government was legally entitled to hold the men.
The nine detainees are challenging that decision.
Eight of the appellants are currently in custody. The ninth, an Algerian man known as "D", was released in September.
Tough! Good riddance.