+ {/* Main Configuration */}
+
+ {/* Basic Information */}
+
+
+
+
+ Basic Information
+
+
+ Configure the basic settings for your guardrail
+
+
+
+
+ (
+
+ Name
+
+
+
+
+ Unique identifier for this guardrail
+
+
+
+ )}
+ />
+ (
+
+ Provider
+
+
+
+ )}
+ />
+
+
+ (
+
+ Description
+
+
+
+
+ Optional description of what this guardrail does
+
+
+
+ )}
+ />
+
+
+
(
+
+
+ Enable Guardrail
+
+ Whether this guardrail is active
+
+
+
+
+
+
+ )}
+ />
+ (
+
+
+ Default On
+
+ Apply to all requests by default
+
+
+
+
+
+
+ )}
+ />
+
+
+
+
+ {/* Execution Modes */}
+
+
+
+
+ Execution Modes
+
+
+ Choose when and how this guardrail should execute
+
+
+
+ (
+
+
+ {EXECUTION_MODES.map((mode) => (
+
(
+
+
+ {
+ return checked
+ ? field.onChange([...field.value, mode.value])
+ : field.onChange(field.value?.filter((value) => value !== mode.value));
+ }}
+ />
+
+
+
+ {mode.icon}
+ {mode.label}
+
+
+ {mode.description}
+
+
+
+ )}
+ />
+ ))}
+
+
+
+ )}
+ />
+
+
+
+ {/* Provider Configuration */}
+
+
+
+
+ Provider Configuration
+
+
+ Configure connection to Microsoft Presidio services
+
+
+
+
+ (
+
+ Analyzer URL
+
+
+
+
+ Presidio analyzer service endpoint
+
+
+
+ )}
+ />
+ (
+
+ Anonymizer URL (Optional)
+
+
+
+
+ Presidio anonymizer service endpoint
+
+
+
+ )}
+ />
+
+
+
+
(
+
+ Detection Threshold
+
+
+
field.onChange(value[0])}
+ className="w-full"
+ />
+
+ {field.value.toFixed(1)}
+
+
+
+
+ Confidence threshold (0.0-1.0)
+
+
+
+ )}
+ />
+ (
+
+ Language
+
+
+
+ )}
+ />
+ (
+
+ Anonymization Method
+
+
+
+ )}
+ />
+
+
+ (
+
+
+
+
+ Mask PII in Requests
+
+
+ Automatically mask detected PII before sending to LLM
+
+
+
+
+
+
+ )}
+ />
+
+
+
+ {/* PII Entity Configuration */}
+
+
+ PII Entity Detection
+
+ Select which types of personally identifiable information to detect
+
+
+
+ (
+
+
+
+ {Object.keys(groupedEntities).map((category) => (
+
+ {category}
+
+ ))}
+
+ {Object.entries(groupedEntities).map(([category, entities]) => (
+
+
+ {entities.map((entity) => (
+ (
+
+
+ {
+ return checked
+ ? field.onChange([...field.value, entity.value])
+ : field.onChange(field.value?.filter((value) => value !== entity.value));
+ }}
+ />
+
+
+ {entity.label}
+
+
+ )}
+ />
+ ))}
+
+
+ ))}
+
+
+
+ )}
+ />
+
+
+
+
+ {/* Sidebar - Advanced Settings & Testing */}
+
+ {/* Advanced Settings */}
+
+
+
+
+ Advanced Settings
+
+
+ Performance and reliability configuration
+
+
+
+ (
+
+ Timeout (ms)
+
+ field.onChange(parseInt(e.target.value))}
+ />
+
+
+ Request timeout in milliseconds
+
+
+
+ )}
+ />
+
+ (
+
+ Retry Attempts
+
+ field.onChange(parseInt(e.target.value))}
+ />
+
+
+ Number of retries on failure
+
+
+
+ )}
+ />
+
+ (
+
+ Log Level
+
+
+ Logging verbosity level
+
+
+
+ )}
+ />
+
+ (
+
+
+ Cache Results
+
+ Cache detection results for performance
+
+
+
+
+
+
+ )}
+ />
+
+
+
+ {/* Test Configuration */}
+
+
+
+
+ Test Configuration
+
+
+ Test your guardrail configuration
+
+
+
+
+
+ {testResult && (
+
+
+ {testResult.success ? (
+
+ ) : (
+
+ )}
+
+ {testResult.success ? "Test Successful" : "Test Failed"}
+
+
+
+ {testResult.success ? (
+
+
+ Latency: {testResult.latency}ms
+
+
+ Detected: {testResult.detected_entities?.length || 0} entities
+
+ {testResult.detected_entities?.map((entity: any, idx: number) => (
+
+ {entity.entity}: {(entity.score * 100).toFixed(0)}%
+
+ ))}
+
+ ) : (
+
+ {testResult.error || "Configuration test failed"}
+
+ )}
+
+
+ )}
+
+
+
+
+
+ {/* Footer Actions */}
+