Dian Yulia Novi was arrested at her boarding house with a three-kilogram bomb encased in a pressure cooker the night before the planned attack on the palace in December.
Novi, a 28-year-old former migrant worker who is nine months pregnant, was found guilty of committing an act of terrorism by the East Jakarta District Court on Friday, her lawyer confirmed to AFP.
"The judges said what she had committed was counterproductive with the government's efforts to eradicate terrorism and that it has caused public unrest," lawyer Kamsi, who like many Indonesians goes by only one name, said.
Novi and her husband were among five militants detained over the planned attack last year.
More From This Section
Another woman alleged to have recruited Novi, named Tutin Sugiarti, was sentenced to three-and-half years in prison on Friday, Kamsi said.
Police believe the group was strongly linked to Bahrun Naim, a leading Indonesian militant currently fighting with the Islamic State group in Syria.
Many from Indonesia -- which has long struggled with Islamic militancy -- have flocked to join IS in the Middle East, while radicals in the country have pledged allegiance to the group and attacks and plots have been linked to the jihadists.
Kamsi said judges delivered the verdict earlier than expected because Novi was pregnant. She would not file an appeal.