The Scottish Public Services Ombudsman found that the girl, a daughter of a prisoner at the high security HMP Kilmarnock prison, was searched in the absence of an appropriate adult.
Although the girl was with her 16-year-old brother, the prison rules were that he was not considered an appropriate adult as he was not 18.
The Scottish Prison Service confirmed to the ombudsman that it did not have a national policy in place in relation to the age a person must be to accompany a child under the age of 16 who is visiting a prison.
An ombudsman report into the incident at the privately-run prison rapped the Scottish Prison Service for "irrelevant and inaccurate" responses surrounding the complaint and concluded the evidence available suggested prisons across Scotland have been operating inconsistently as there is no standard policy in place.
The ombudsman recommended that the SPS update the office by November 20 over steps taken to implement a "relevant policy" over the age a person must be to accompany a child under the age of 16 when they visit a prison.
It also said the SPS should take "immediate steps" to ensure staff within all prisons are fully aware of the policy in place.
A prisoner lodged the complaint after his daughter was searched after setting off a metal detector. After this, both children were denied the right to visit their father because the girl, identified only as "Miss A", was not accompanied by an appropriate adult.
The ombudsman reported that Mr C said the situation had "caused upset and distress to himself and his children and it was clear the prison had breached policy by searching his daughter without an adult being present".
A spokesman for the Scottish Prison Service said: "We have already taken steps to address the issues raised by the ombudsman in his report."