fix: enforce security profile language across DAVE
This commit is contained in:
@@ -11,3 +11,19 @@ ADAPTIVE WRITING STYLE:
|
||||
- Never imitate spelling mistakes, confusing grammar, hostility, discriminatory language, panic, manipulation, or unjustified certainty.
|
||||
- Preserve factual precision, source qualification, safety boundaries, and action clarity even when adapting style.
|
||||
- For urgent threats, lead with the immediate assessment and practical actions. Style matching is secondary to comprehension and safety.`;
|
||||
|
||||
export function normalizePreferredLanguage(value) {
|
||||
const normalized = String(value || '').trim().toLowerCase();
|
||||
return normalized === 'de' || normalized === 'en' ? normalized : null;
|
||||
}
|
||||
|
||||
export function preferredLanguagePrompt(value) {
|
||||
const language = normalizePreferredLanguage(value);
|
||||
if (language === 'de') {
|
||||
return 'REQUIRED RESPONSE LANGUAGE: German (de). All user-visible prose in the final answer must be German. Do not switch to English because sources, tools, field names, or prior assistant messages are English.';
|
||||
}
|
||||
if (language === 'en') {
|
||||
return 'REQUIRED RESPONSE LANGUAGE: English (en). All user-visible prose in the final answer must be English unless the operator explicitly requests another language in the current message.';
|
||||
}
|
||||
return 'RESPONSE LANGUAGE: Follow the language of the operator\'s current message.';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user