diff --git a/crates/goose/src/security/mod.rs b/crates/goose/src/security/mod.rs index c81144c33da3..1ff0b7d6fdea 100644 --- a/crates/goose/src/security/mod.rs +++ b/crates/goose/src/security/mod.rs @@ -36,7 +36,7 @@ impl SecurityManager { let config = Config::global(); config - .get_param::("security_prompt_enabled") + .get_param::("SECURITY_PROMPT_ENABLED") .unwrap_or(false) } diff --git a/crates/goose/src/security/scanner.rs b/crates/goose/src/security/scanner.rs index fec76b449e3d..591b7b577b92 100644 --- a/crates/goose/src/security/scanner.rs +++ b/crates/goose/src/security/scanner.rs @@ -27,7 +27,7 @@ impl PromptInjectionScanner { use crate::config::Config; let config = Config::global(); - if let Ok(threshold) = config.get_param::("security_prompt_threshold") { + if let Ok(threshold) = config.get_param::("SECURITY_PROMPT_THRESHOLD") { return threshold as f32; } diff --git a/documentation/docs/guides/config-files.md b/documentation/docs/guides/config-files.md index 7d0246070f03..95902d538f3f 100644 --- a/documentation/docs/guides/config-files.md +++ b/documentation/docs/guides/config-files.md @@ -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: diff --git a/documentation/docs/guides/security/prompt-injection-detection.md b/documentation/docs/guides/security/prompt-injection-detection.md index 35d565cd530a..1c3eb3dd9970 100644 --- a/documentation/docs/guides/security/prompt-injection-detection.md +++ b/documentation/docs/guides/security/prompt-injection-detection.md @@ -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 ``` diff --git a/ui/desktop/src/components/settings/security/SecurityToggle.tsx b/ui/desktop/src/components/settings/security/SecurityToggle.tsx index e6ba583aced1..9bf80464bd60 100644 --- a/ui/desktop/src/components/settings/security/SecurityToggle.tsx +++ b/ui/desktop/src/components/settings/security/SecurityToggle.tsx @@ -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 ( diff --git a/ui/desktop/src/utils/configUtils.ts b/ui/desktop/src/utils/configUtils.ts index 5a32a56d6c66..4ee552da1e88 100644 --- a/ui/desktop/src/utils/configUtils.ts +++ b/ui/desktop/src/utils/configUtils.ts @@ -15,8 +15,8 @@ export const configLabels: Record = { 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',