<!--
{
  "availability" : [
    "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" : "FoundationModels",
  "identifier" : "/documentation/FoundationModels/LanguageModelError/refusal(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Foundation Models"
    ],
    "preciseIdentifier" : "s:16FoundationModels18LanguageModelErrorO7refusalyA2C7RefusalVcACmF"
  },
  "title" : "LanguageModelError.refusal(_:)"
}
-->

# LanguageModelError.refusal(_:)

The model refused to answer.

```
case refusal(LanguageModelError.Refusal)
```

## Discussion

This failure can happen for prompts that do not violate any guardrail policy, but
the model isn’t able to provide the kind of response you requested. You can
choose to handle this by showing a predetermined message of your choice.

---

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)