Prisoners in NSW will be banned from possessing images and videos of terrorism under a law change reportedly prompted by material found in the cell of notorious gang leader Bassam Hamzy.

Hamzy, who is serving a murder sentence at Goulburn SuperMax, was found to have a flash drive containing Islamic State material during a targeted search for a phone in his cell last year, The Daily Telegraph reported on Sunday.

However, the USB drive was registered as relating to his legal case and under the previous laws inmates were allowed to hold such material if it formed part of their proceedings.

Bassam Hamzy, the notorious leader of the Brothers For Life gang, was reportedly found with a USB containing ISIS material in jail.

An amendment to close the loophole was introduced in state parliament this week.

Corrections Minister David Elliot says inmates will risk a two-year jail term if they possess extremist material, similar to how sex offenders can't hold sensitive evidence.

"Having extremist material in a correctional centre inhibits efforts to deradicalise the person, and increases the risk of radicalisation of other inmates," Mr Elliot said in a statement today.

To protect the right to a fair trial, material will be restricted to lawyers and self-represented defendants will be allowed access under supervision.

Hamzy had previously hidden a mobile phone in the spine of a book. (AAP) (AAP)

A Corrective Services NSW spokeswoman said the department makes every effort to eliminate access to extremist material "or strictly control it where it is part of legal proceedings".

"It welcomes any changes to legislation that further support the strict regulation of extremist material," the spokeswoman said in a statement.

"CSNSW does not discuss individual inmates' management for privacy and security reasons."

Labor's corrections spokesman Guy Zangari was "very surprised" the legal loophole existed and accused the government of losing control of the state's prisons.

"It doesn't matter whether or not the person got it smuggled in or just through a matter of circumstance through a legal case," he told AAP.

Hamzy is serving his sentence at Goulburn Supermax. (9news)

"The fact is this material went into the wrong hands of someone who is a known offender with terrorist thoughts, ideas and links. This is just totally unacceptable."

Mr Zangari said Labor was yet to see the details of the bill but called for tougher contraband measures in general including extra staff at front gates, increased use of detection dogs and full body scanners.

It's not the first time Hamzy has allegedly been found to be in possession of concerning items.

In 2016 the Brother 4 Life boss was found with a miniature mobile phone.