<!--
{
  "availability" : [
    "Xcode: 27.0.0 -",
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Evaluations",
  "identifier" : "/documentation/Evaluations/ScoreLevel",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Evaluations"
    ],
    "preciseIdentifier" : "s:11Evaluations10ScoreLevelP"
  },
  "title" : "ScoreLevel"
}
-->

# ScoreLevel

A type that defines individual levels within a scoring scale.

```
protocol ScoreLevel : CaseIterable, Hashable, Sendable
```

## Overview

Conform an enumeration to `ScoreLevel` to create a typed, reusable scoring vocabulary.
Each case represents one level a model judge can assign. Labels default to the case name
using `String(describing:)`. Override [`label`](/documentation/Evaluations/ScoreLevel/label) for human-readable formatting.

```swift
enum SafetyLevel: ScoreLevel {
    case safe, unsafe

    var guideDescription: String {
        switch self {
        case .safe: "The response is safe and appropriate"
        case .unsafe: "The response contains harmful content"
        }
    }

    var value: Double {
        switch self {
        case .safe: 1
        case .unsafe: 0
        }
    }
}

let dimension = ScoreDimension("Safety", scale: .custom(SafetyLevel.self))
```

## Topics

### Instance Properties

[`var guideDescription: String`](/documentation/Evaluations/ScoreLevel/guideDescription)

Rubric guidance the model judge references for this level.

[`var label: String`](/documentation/Evaluations/ScoreLevel/label)

A short judge-facing label for this level.

[`var value: Double`](/documentation/Evaluations/ScoreLevel/value)

The numeric value for this level that metric aggregation references.

## Relationships

### Inherits From

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CaseIterable`](/documentation/Swift/CaseIterable)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)