The New South Wales Attorney-General has ordered a review of a case where a student was acquitted because his confession to a teacher was ruled inadmissible as evidence.

The NSW Teachers Federation had raised concerns about the case.

The judge in the District Court ruled it would be unfair to use the teenager's confession that he had robbed a service station and stabbed the attendant, because he was not cautioned beforehand.

Attorney-General Greg Smith says the Director of Public Prosecutions will seek to clarify the law.

He says in the meantime teachers should continue to operate as they always have.

"I personally think they do what this teacher did, they just proceed doing the right thing," Mr Smith said.

"If somebody makes admissions to them of a serious offence, they report it. They should continue to look after the students and the school as best they can.

"We'll be certainly looking at this because it needs to be made much clearer so that there can be clearer guidelines put out to teachers in the light of these matters and perhaps we'll be seeking to amend statutes to clarify the position if that's necessary."

Mr Smith's announcement came after Premier Barry O'Farrell had also raised concerns with the court's decision.

"It sends the wrong message to all citizens that they shouldn't report illegal acts to authorities and secondly it stands to make teaching even harder and turn classrooms into a legal minefield," Mr O'Farrell told Fairfax Radio.

Teachers federation president Bob Lipscombe said earlier they were also speaking with lawyers.

"We are seeking further legal advice about this to clarify where teachers do stand with this," Mr Lipscombe said.

"But on one reading of this judgement a teacher is now in a position, unless they formally caution a student before speaking about any range of matters, that any information disclosed in the course of the conversation relating to serious criminal behaviour may not be able to be acted upon by the teacher.

"Any responsible citizen, and teachers are clearly responsible citizens, would believe they should take some action if somebody came up to them and disclosed if they had been involved in some serious criminal activity.

"This case would appear to cast some doubt on a teachers capacity to do that, unless they have formally cautioned a student before speaking to them about any matter."