(a) The following records, reports, and information acquired or generated in juvenile courts concerning children shall be confidential and shall not be released to any person, department, agency, or entity, except as provided elsewhere in this section:
(1) Juvenile legal files (including formal documents as petitions, notices, motions, legal memoranda, orders, and decrees).
(2) Social records, including but not limited to:
a. Records of juvenile probation officers.
b. Records of the Department of Human Resources.
c. Records of the Department of Youth Services.
d. Medical records.
e. Psychiatric or psychological records.
f. Reports of preliminary inquiries and predisposition studies.
g. Supervision records.
h. Birth certificates.
i. Individualized service plans.
j. Education records, including, but not limited to, individualized education plans.
k. Detention records.
l. Demographic information that identifies a child or the family of a child.
(3) State Criminal Justice Information System records.
(4) Juvenile criminal sex offender notification records.
(b) The records, reports, and information described in subsection (a) shall be filed separately from other files and records of the court. The juvenile legal files described in subdivision (1) of subsection (a) shall be maintained in a separate file from all other juvenile records, reports, and information.
(c) Subject to applicable federal law, the records, reports, and information described in subsection (a) shall be open to inspection and copying only by the following, under the specified circumstances:
(1) The judge, juvenile probation officers, and professional staff assigned to serve or contracted for service to the juvenile court.
(2) Representatives of a public or private agency or department providing supervision or having legal custody of the child.
(3) The parent (except when parental rights have been terminated), the legal guardian of the child, and the legal custodian of the child.
(4) The subject of the proceedings and his or her counsel and guardian ad litem. As used in this section, the term counsel means a child's attorney and an attorney for a criminal defendant who was formerly a child subject to proceedings in juvenile court.
(5) The judge, probation, prosecutor, and other professional staff serving a court handling criminal cases for investigating or considering youthful offender applications for an individual, who, prior thereto, had been the subject of proceedings in juvenile court.
(6) The judge, probation, and other professional staff, including the prosecutor and the attorney for the defendant, serving a court handling criminal cases for completing sentencing standards worksheets and considering the sentence upon a person charged with a criminal offense who, prior thereto, had been the subject of proceedings in juvenile court.
(7) The principal of the school in which the child is enrolled, or the representative of the principal, upon written petition to the juvenile court setting forth the reasons why the safety or welfare, or both, of the school, its students, or personnel, necessitate production of the information and without which the safety and welfare of the school, its students, and personnel, would be threatened; provided, however, certain information concerning children adjudicated delinquent of certain offenses shall be provided as set forth in Section 12-15-217.
(8) The Alabama Sentencing Commission, as set forth in Section 12-25-11.
(9) In any criminal proceeding, including a criminal proceeding in which a person is adjudicated a youthful offender, as well as any juvenile proceeding pursuant to Section 12-15-105, the prosecutor representing the State of Alabama shall have access to all juvenile legal files specified in subdivision (a)(1) on that person regardless of the jurisdiction from which the files originate.
(d) Upon determining a legitimate need for access, and subject to applicable federal law, the juvenile court may also grant access to specific records, reports, and information to a prosecutor representing the State of Alabama, department, entity, or agency. The determination of legitimate need by the juvenile court shall be based upon a written request filed with the juvenile court stating the following:
(1) The reason the person, department, entity, or agency is requesting the information.
(2) The use to be made of the information.
(3) The names of those persons or entities that will have access to the information.
(e) Petitions, motions, juvenile court notices, or dispositions shall be open to inspection and copying by the victim.
(f) Subject to applicable confidentiality disclosure and case restrictions imposed by federal or state law, confidential juvenile legal files, as described in subdivision (1) of subsection (a), may be placed on an automated information sharing system to be shared with the child's counsel and guardian ad litem, prosecutors,departments, agencies, or entities who are entitled to access pursuant to this section.
(g) Except for the purposes permitted and in the manner provided by this section, whoever discloses or makes use of or knowingly permits the use of information identifying a child, or the family of a child, who is or was under the jurisdiction of the juvenile court, where this information is directly or indirectly derived from the records of the juvenile court or acquired in the course of official duties, upon conviction thereof, shall be guilty of a Class A misdemeanor under the jurisdiction of the juvenile court and also may be subject to civil sanctions. Provided, however, that nothing in this section shall be construed to prohibit or otherwise limit counsel from disclosing confidential information obtained from the juvenile court file of the child as needed to investigate the case of the client or prepare a defense for that client, provided that the disclosure is in furtherance of counsel's representation of the party.
(h) Anytime that a child commits a violent offense and is adjudicated delinquent, if that child as an adult commits the same or a similar offense, the court records pertaining to the juvenile offense may be used in the prosecution of the adult offense.