Guardrail configuration options?

Is anything configurable for LanguageModelSession.Guardrails besides the default? I'm prototyping a camping app, and it's constantly slamming into guardrail errors when I use the new foundation model interface. Any subjects relating to fishing, survival, etc. won't generate.

For example the prompt "How can I kill deer ticks using a clothing treatment?" returns a generation error.

The results that I get are great when it works, but so far the local model sessions are extremely unreliable.

As of today, you only have the .default option, meaning that you use the system-provided guardrail. I’d suggest that you file a feedback report if the system guardrail doesn't work for your use case (over restrictive, for example) – If you do so, please share your report ID here for folks to track. Thanks.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

@Decimal Out of curiosity, have you tried removing the word "kill" from the prompt? Maybe something like: "What treatments can I apply to clothing to keep deer ticks away?"

The guardrails are definitely poorly-calibrated. I get safety violations just asking for a taco recipe.

In this case, there's at least some defensible reason for why a guardrail might trip up on the word "kill". I still think Apple is going to render FoundationModels completely unusable if they don't fix their guardrails, but you might be able to game their system until then with some wording tweaks.

Guardrail configuration options?
 
 
Q