fix: enforce security profile language across DAVE
All checks were successful
Codex Template Compliance / template-compliance (pull_request) Successful in 10s
Build / test-and-image (pull_request) Successful in 56s

This commit is contained in:
2026-07-06 09:14:55 +02:00
parent dce8c278a5
commit 73af4abfa2
9 changed files with 98 additions and 17 deletions

View File

@@ -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.';
}