Lady Scotland oversees criminal prosecutions in England and Wales
Immigration officials are investigating reports that an illegal worker was employed by the attorney general.
Baroness Scotland says she employed Loloahi Tapui in good faith and thought she was working in the UK legally.
The UK Border Agency said it would investigate in the same way it would "any allegation of illegal working".
Gordon Brown said people should wait for the outcome of the probe, but Baroness Scotland wished to apologise for "any inadvertent mistake".
Under laws passed when Baroness Scotland was a Home Office minister, even employers who unknowingly take on illegal workers face a £10,000 fine.
Asked about the case, the prime minister said Baroness Scotland had contacted the authorities herself to ask them to conduct a "thorough" investigation.
She did this to assure herself and the country that she had taken "the necessary steps" when hiring Ms Tapui, Mr Brown said.
People should wait until the investigation was concluded to "pass judgement" on the case, he added.
Employers are required to carry out appropriate checks to verify their staff's right to work in the UK - such as looking at passports and work permits and taking copies of relevant pages.
Those who knowingly give a job to someone who is in the UK illegally face a two-year prison sentence and an unlimited fine.
The Daily Mail reported on Wednesday that Baroness Scotland employed Loloahi Tapui, from Tonga, for six months. It is understood Ms Tapui arrived in the UK in 2003 on a temporary visa which has since expired.
Baroness Scotland sacked her when told of her ineligibility.
Gordon Brown's spokesman said: "The prime minister is aware of the statement and has full confidence in Baroness Scotland. He thinks she's doing a very good job as attorney general."
A spokesman for Baroness Scotland said she had "never knowingly employed an illegal immigrant", adding that she had hired the help in "good faith".
"She saw documents which led her to believe that Ms Tapui was entitled to work in this country," he said.
"At no stage prior to the matter being raised did Baroness Scotland believe there was any question over Ms Tapui's entitlement to work."
Loloahi Tapui worked in Baroness Scotland's London house. Picture credit: James Emmett - Daily Mail
He also said she had been paying tax and national insurance.
But BBC political correspondent Gillian Hargreaves said Baroness Scotland would remain under pressure until she clarified what documents she had viewed before hiring Ms Tapui.
Keith Best, of the Immigration Advisory Service, said employers had to comply with Border Agency guidelines - including checking visa status on passports.
"The perusal of a National Insurance certificate in itself is insufficient to escape a civil penalty," he told the BBC.
If the documents checked were not those required, it was "inevitable" she would face a civil penalty, he said.
Labour MP Keith Vaz, chairman of the home affairs select committee, said he believed Baroness Scotland would have "satisfied herself" that all the necessary checks were done.
"I am sure she would have done everything that was proper and right," he told BBC Radio 4's World At One.
However, he said there were "grey areas" in how the law was interpreted and a single database was needed to give employers access to information about an individual's immigrant status, right to work and ability to claim benefits.
For the Conservatives, Chris Grayling said it was a "big embarrassment for Gordon Brown" as a senior government law officer had got things "badly wrong".
He added: "It is absolutely right that there is a proper investigation and it needs to be done very quickly.
"Inevitably now there is a big question over her position and whatever happens she should be treated in exactly the same way as any other small employer. "