Error with guardrailViolation and underlyingErrors

Hi, I am a new IOS developer, trying to learn to integrate the Apple Foundation Model.

my set up is:

  • Mac M1 Pro
  • MacOS 26 Beta
  • Version 26.0 beta 3
  • Apple Intelligence & Siri --> On

here is the code,

    func generate() {
        Task {
            isGenerating = true
            output = "⏳ Thinking..."
            do {
              
                let session = LanguageModelSession( instructions: """
                    Extract time from a message. Example 
                    Q: Golfing at 6PM
                    A: 6PM
                """)
                let response = try await session.respond(to: "Go to gym at 7PM")
                output = response.content
                
            } catch {
                output = "❌ Error:, \(error)"
                print(output)
            }
            isGenerating = false
        }
    

and I get these errors

guardrailViolation(FoundationModels.LanguageModelSession.GenerationError.Context(debugDescription: "Prompt may contain sensitive or unsafe content", underlyingErrors: [Asset com.apple.gm.safety_embedding_deny.all not found in Model Catalog]))

Can you help me get through this?

That error indicates that your device is missing some of the assets it needs to run FoundationModels. This is a bug.

Please do two things. The first will help us understand how you got into a bad state in the first place, and the second may get it back into a good state.

First, please take a sysdiagnose and submit it via Feedback Assistant. When you do, please include a link to your forum post. If you could also post the feedback id here when you're done, that would be helpful. How to collect a sysdiagnose

Second, with WiFi turned on, navigate to Settings > Apple Intelligence & Siri. This should trigger your device to attempt to download missing assets. Wait a few minutes and then try running your code again.

I had the same problem. It works on the real device, but fails systematically on simulator. I run Beta8 on macOS Tahoe and the latest Xcode beta.

Error: guardrailViolation(FoundationModels.LanguageModelSession.GenerationError.Context(debugDescription: "May contain sensitive or unsafe content", underlyingErrors: [Error Domain=com.apple.SensitiveContentAnalysisML Code=15 "Failed model manager query for model com.apple.fm.language.instruct_300m.safety: Model Catalog error: Error Domain=com.apple.UnifiedAssetFramework Code=5000 "There are no underlying assets (neither atomic instance nor asset roots) for consistency token for asset set com.apple.modelcatalog" UserInfo={NSLocalizedFailureReason=There are no underlying assets (neither atomic instance nor asset roots) for consistency token for asset set com.apple.modelcatalog}" UserInfo={NSLocalizedDescription=Failed model manager query for model com.apple.fm.language.instruct_300m.safety: Model Catalog error: Error Domain=com.apple.UnifiedAssetFramework Code=5000 "There are no underlying assets (neither atomic instance nor asset roots) for consistency token for asset set com.apple.modelcatalog" UserInfo={NSLocalizedFailureReason=There are no underlying assets (neither atomic instance nor asset roots) for consistency token for asset set com.apple.modelcatalog}, NSUnderlyingError=0x600003300960 {Error Domain=ModelManagerServices.ModelManagerError Code=1026 "Model Catalog error: Error Domain=com.apple.UnifiedAssetFramework Code=5000 "There are no underlying assets (neither atomic instance nor asset roots) for consistency token for asset set com.apple.modelcatalog" UserInfo={NSLocalizedFailureReason=There are no underlying assets (neither atomic instance nor asset roots) for consistency token for asset set com.apple.modelcatalog}"}}]))

Error with guardrailViolation and underlyingErrors
 
 
Q