A couple with links to Islamic State went on trial in Indonesia Thursday for a failed assassination attempt last year on the country's former chief security minister, with the pair facing a possible death sentence if convicted.

The Jakarta hearing was held by video conference due to coronavirus concerns as lawyers and judges wearing facemasks heard the indictment against 51-year-old Syahril Alamsyah and his wife Fitri Adriana, 21.

The attempted assassination happened in October when Indonesia's then security minister Wiranto, who goes by one name, was visiting Pandeglang regency on Java island.

"The two decided that the husband would attack Wiranto while the wife would attack anyone else wearing police or military uniforms," the indictment said.

Alamsyah allegedly stabbed the now 73-year-old minister as he exited a vehicle before he and his wife were wrestled to the ground by security personnel.

Wiranto survived the attack, but he sustained knife wounds to his abdomen and several others were also injured.

The couple could face life sentences or even the death penalty if convicted under Indonesia's terrorism laws.

Days before the attack, the pair pledged allegiance to late IS leader Abu Bakr al-Baghdadi, according to the indictment.

It also said both were members of Jamaah Ansharut Daulah (JAD), an IS-linked extremist group responsible for a string of attacks, including suicide bombings at churches in Indonesia's second-biggest city Surabaya in 2018 that killed a dozen people.

JAD is among dozens of radical groups that have pledged loyalty to the Islamic State in Indonesia, which has long struggled with Islamist militancy.

"The defendants felt like they had a responsibility to carry out jihad to bring about Islamic law in Indonesia," the prosecutors' indictment said.

The couple were radicalised through hardline rhetoric on social media and watching videos of Muslims fighting in Syria.

They also listened to speeches by jailed firebrand cleric Abu Bakar Bashir, believed to be behind the 2002 Bali bombings, and Aman Abdurrahman, who was sentenced to death for masterminding gun and suicide attacks in Jakarta in 2016.

A third defendant was also indicted Thursday on terror charges related to a separate attack allegedly planned with Alamsyah last year.