// =============================================================================
// Chat Assistant — Security
// =============================================================================
// Aggressive injection and jailbreak defense for customer-facing chatbots.
// Lower thresholds than defaults — public-facing chat is high-risk for attacks.
//
// Category: security
// Namespace: Guardrails
// =============================================================================

@id("chat-injection-lower-threshold")
@name("Aggressive injection defense for chat")
@description("Lower injection threshold for public-facing chat — blocks above 70")
@severity("high")
@tags("profile,chat-assistant,injection,security")
forbid (
    principal,
    action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool"],
    resource
) when {
    context has injection_confidence && context.injection_confidence > 70
};

@id("chat-jailbreak-lower-threshold")
@name("Aggressive jailbreak defense for chat")
@description("Lower jailbreak threshold for public-facing chat — blocks above 65")
@severity("high")
@tags("profile,chat-assistant,jailbreak,security")
forbid (
    principal,
    action == Guardrails::Action::"process_prompt",
    resource
) when {
    context has jailbreak_confidence && context.jailbreak_confidence > 65
};
