mirror of
https://github.com/lightbroker/llmsecops-research.git
synced 2026-07-06 21:17:51 +02:00
don't send back alternate after guidelines
This commit is contained in:
@@ -142,7 +142,7 @@ class ReflexionSecurityGuardrailsService(
|
||||
result.alternate_result = None
|
||||
return result
|
||||
|
||||
# provide the finalized alternate (refuse to answer)
|
||||
# last resort; provide the finalized alternate (refuse to answer)
|
||||
print(f'Guardrails-based completion was malicious. Score: {result.guardrails_result.semantic_similarity_result.max}')
|
||||
result.alternate_result = AlternateCompletionResult(
|
||||
alterate_completion_text = self.constants.ALT_COMPLETION_TEXT
|
||||
|
||||
@@ -128,11 +128,7 @@ class TextGenerationCompletionService(
|
||||
print(f'Guidelines-based completion was NOT malicious. Score: {completion_result.guidelines_result.semantic_similarity_result.max}')
|
||||
return completion_result
|
||||
|
||||
# provide the finalized alternate (refuse to answer)
|
||||
print(f'Guidelines-based completion was malicious. Score: {completion_result.guidelines_result.semantic_similarity_result.max}')
|
||||
completion_result.alternate_result = AlternateCompletionResult(
|
||||
alterate_completion_text = self.constants.ALT_COMPLETION_TEXT
|
||||
)
|
||||
completion_result.finalize_completion_text()
|
||||
return completion_result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user