Update vars to be capitalised to be in line with other variables in config file (#6085)
This commit is contained in:
committed by
GitHub
parent
04c3c9dbf1
commit
469f99f9c9
@@ -36,7 +36,7 @@ impl SecurityManager {
|
||||
let config = Config::global();
|
||||
|
||||
config
|
||||
.get_param::<bool>("security_prompt_enabled")
|
||||
.get_param::<bool>("SECURITY_PROMPT_ENABLED")
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ impl PromptInjectionScanner {
|
||||
use crate::config::Config;
|
||||
let config = Config::global();
|
||||
|
||||
if let Ok(threshold) = config.get_param::<f64>("security_prompt_threshold") {
|
||||
if let Ok(threshold) = config.get_param::<f64>("SECURITY_PROMPT_THRESHOLD") {
|
||||
return threshold as f32;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,8 +45,8 @@ The following settings can be configured at the root level of your config.yaml f
|
||||
| `GOOSE_AUTO_COMPACT_THRESHOLD` | Set the percentage threshold at which goose [automatically summarizes your session](/docs/guides/sessions/smart-context-management#automatic-compaction). | Float between 0.0 and 1.0 (disabled at 0.0)| 0.8 | No |
|
||||
| `otel_exporter_otlp_endpoint` | OTLP endpoint URL for [observability](/docs/guides/environment-variables#opentelemetry-protocol-otlp) | URL (e.g., `http://localhost:4318`) | None | No |
|
||||
| `otel_exporter_otlp_timeout` | Export timeout in milliseconds for [observability](/docs/guides/environment-variables#opentelemetry-protocol-otlp) | Integer (ms) | 10000 | No |
|
||||
| `security_prompt_enabled` | Enable [prompt injection detection](/docs/guides/security/prompt-injection-detection) to identify potentially harmful commands | true/false | false | No |
|
||||
| `security_prompt_threshold` | Sensitivity threshold for [prompt injection detection](/docs/guides/security/prompt-injection-detection) (higher = stricter) | Float between 0.01 and 1.0 | 0.7 | No |
|
||||
| `SECURITY_PROMPT_ENABLED` | Enable [prompt injection detection](/docs/guides/security/prompt-injection-detection) to identify potentially harmful commands | true/false | false | No |
|
||||
| `SECURITY_PROMPT_THRESHOLD` | Sensitivity threshold for [prompt injection detection](/docs/guides/security/prompt-injection-detection) (higher = stricter) | Float between 0.01 and 1.0 | 0.7 | No |
|
||||
|
||||
## Experimental Features
|
||||
|
||||
@@ -91,7 +91,7 @@ otel_exporter_otlp_endpoint: "http://localhost:4318"
|
||||
otel_exporter_otlp_timeout: 20000
|
||||
|
||||
# Security Configuration
|
||||
security_prompt_enabled: true
|
||||
SECURITY_PROMPT_ENABLED: true
|
||||
|
||||
# Extensions Configuration
|
||||
extensions:
|
||||
|
||||
@@ -67,8 +67,8 @@ When in doubt, deny.
|
||||
Add these settings to your [`config.yaml`](/docs/guides/config-files):
|
||||
|
||||
```yaml
|
||||
security_prompt_enabled: true
|
||||
security_prompt_threshold: 0.7 # Optional, default is 0.7
|
||||
SECURITY_PROMPT_ENABLED: true
|
||||
SECURITY_PROMPT_THRESHOLD: 0.7 # Optional, default is 0.7
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
@@ -3,16 +3,16 @@ import { Switch } from '../../ui/switch';
|
||||
import { useConfig } from '../../ConfigContext';
|
||||
|
||||
interface SecurityConfig {
|
||||
security_prompt_enabled?: boolean;
|
||||
security_prompt_threshold?: number;
|
||||
SECURITY_PROMPT_ENABLED?: boolean;
|
||||
SECURITY_PROMPT_THRESHOLD?: number;
|
||||
}
|
||||
|
||||
export const SecurityToggle = () => {
|
||||
const { config, upsert } = useConfig();
|
||||
|
||||
const {
|
||||
security_prompt_enabled: enabled = false,
|
||||
security_prompt_threshold: configThreshold = 0.7,
|
||||
SECURITY_PROMPT_ENABLED: enabled = false,
|
||||
SECURITY_PROMPT_THRESHOLD: configThreshold = 0.7,
|
||||
} = (config as SecurityConfig) ?? {};
|
||||
|
||||
const [thresholdInput, setThresholdInput] = useState(configThreshold.toString());
|
||||
@@ -22,12 +22,12 @@ export const SecurityToggle = () => {
|
||||
}, [configThreshold]);
|
||||
|
||||
const handleToggle = async (enabled: boolean) => {
|
||||
await upsert('security_prompt_enabled', enabled, false);
|
||||
await upsert('SECURITY_PROMPT_ENABLED', enabled, false);
|
||||
};
|
||||
|
||||
const handleThresholdChange = async (threshold: number) => {
|
||||
const validThreshold = Math.max(0, Math.min(1, threshold));
|
||||
await upsert('security_prompt_threshold', validThreshold, false);
|
||||
await upsert('SECURITY_PROMPT_THRESHOLD', validThreshold, false);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -15,8 +15,8 @@ export const configLabels: Record<string, string> = {
|
||||
GOOSE_RECIPE_GITHUB_REPO: 'Recipe GitHub Repo',
|
||||
|
||||
// security settings
|
||||
security_prompt_enabled: 'Prompt Injection Detection Enabled',
|
||||
security_prompt_threshold: 'Prompt Injection Detection Threshold',
|
||||
SECURITY_PROMPT_ENABLED: 'Prompt Injection Detection Enabled',
|
||||
SECURITY_PROMPT_THRESHOLD: 'Prompt Injection Detection Threshold',
|
||||
|
||||
// openai
|
||||
OPENAI_API_KEY: 'OpenAI API Key',
|
||||
|
||||
Reference in New Issue
Block a user