A juvenile court referee may impose sanctions pursuant to Code of Civil Procedure section 128.7 for frivolous motions. Appointed trial counsel in a dependency case appealed a juvenile court order by a referee imposing sanctions pursuant to Code of Civil Procedure section 128.7 for motions she filed attacking Sacramento County’s juvenile court’s contract system for appointing dependency conflict counsel. The appellate court held that the juvenile court may impose sanctions under section 128.7. The statute applies to all civil proceedings, and the policy underlying section 128.7 favors its use in dependency proceedings. A juvenile court referee is authorized to order sanctions under the statute because a juvenile court referee in dependency proceedings has essentially the same powers as a judge and any differences are not material to this issue.