from aisecurity import Scanner, AiProfile
scanner = Scanner()
profile = AiProfile(profile_name="fraud-agent-prod")
# Intercept user input before LLM call
result = scanner.sync_scan(
ai_profile=profile,
content=user_input,
scan_type="prompt_injection",
options={
"detect_role_manipulation": True,
"detect_instruction_override": True,
"detect_few_shot_manipulation": True,
}
)
if result.is_blocked:
return error_response(result.reason)