Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(security): enforce approval gate for triage agent actions

Steven Enamakel74aa51f9ab03
diff --git a/app/src/components/settings/panels/__tests__/AIPanel.omlx.test.tsx b/app/src/components/settings/panels/__tests__/AIPanel.omlx.test.tsx
index 940d28d939..2498c2e912 100644
--- a/app/src/components/settings/panels/__tests__/AIPanel.omlx.test.tsx
+++ b/app/src/components/settings/panels/__tests__/AIPanel.omlx.test.tsx
@@ -22,15 +22,7 @@ import { openhumanUpdateLocalAiSettings as openhumanUpdateLocalAiSettingsMock }
import AIPanel from '../AIPanel';
vi.mock('../../../../services/api/aiSettingsApi', () => ({
- ALL_WORKLOADS: [
- 'chat',
- 'reasoning',
- 'agentic',
- 'coding',
- 'memory',
- 'embeddings',
- 'learning',
- ],
+ ALL_WORKLOADS: ['chat', 'reasoning', 'agentic', 'coding', 'memory', 'embeddings', 'learning'],
loadAISettings: vi.fn(),
saveAISettings: vi.fn(),
loadLocalProviderSnapshot: vi.fn(),
diff --git a/app/src/components/settings/panels/__tests__/AIPanel.test.tsx b/app/src/components/settings/panels/__tests__/AIPanel.test.tsx
index 84997b7c71..82cd5b50b3 100644
--- a/app/src/components/settings/panels/__tests__/AIPanel.test.tsx
+++ b/app/src/components/settings/panels/__tests__/AIPanel.test.tsx
@@ -36,15 +36,7 @@ import AIPanel, {
vi.mock('../../../../services/api/aiSettingsApi', async importOriginal => {
const actual = await importOriginal<typeof import('../../../../services/api/aiSettingsApi')>();
return {
- ALL_WORKLOADS: [
- 'chat',
- 'reasoning',
- 'agentic',
- 'coding',
- 'memory',
- 'embeddings',
- 'learning',
- ],
+ ALL_WORKLOADS: ['chat', 'reasoning', 'agentic', 'coding', 'memory', 'embeddings', 'learning'],
loadAISettings: vi.fn(),
saveAISettings: vi.fn(),
loadLocalProviderSnapshot: vi.fn(),
diff --git a/app/src/components/settings/panels/__tests__/aiRouting.test.ts b/app/src/components/settings/panels/__tests__/aiRouting.test.ts
index aad454355c..526e3c1626 100644
--- a/app/src/components/settings/panels/__tests__/aiRouting.test.ts
+++ b/app/src/components/settings/panels/__tests__/aiRouting.test.ts
@@ -7,14 +7,7 @@ import {
toSelectableChatModels,
} from '../aiRouting';
-const WORKLOADS = [
- 'chat',
- 'reasoning',
- 'agentic',
- 'coding',
- 'memory',
- 'learning',
-] as const;
+const WORKLOADS = ['chat', 'reasoning', 'agentic', 'coding', 'memory', 'learning'] as const;
/** Build a full 8-workload routing map defaulting every slot to managed. */
function routingOf(
diff --git a/app/src/components/settings/panels/ai/BackgroundLoopControls.tsx b/app/src/components/settings/panels/ai/BackgroundLoopControls.tsx
index ab48b6553a..8e7761230d 100644
--- a/app/src/components/settings/panels/ai/BackgroundLoopControls.tsx
+++ b/app/src/components/settings/panels/ai/BackgroundLoopControls.tsx
@@ -111,9 +111,7 @@ export const BackgroundLoopControls = ({
const composioConnectionScansPerWeek = composioPeriodicTicksPerWeek * activeConnections.length;
const backgroundApiReadsPerWeek = composioConnectionScansPerWeek;
const backgroundWakeupsPerWeek =
- composioPeriodicTicksPerWeek +
- learningTicksPerWeek +
- memoryPollsPerWeek;
+ composioPeriodicTicksPerWeek + learningTicksPerWeek + memoryPollsPerWeek;
const scheduledCallsPerRemainingDollar =
usage && usage.remainingUsd > 0 ? backgroundApiReadsPerWeek / usage.remainingUsd : null;
const estimatedRowsLeft =
diff --git a/app/src/features/conversations/utils/threadFilter.test.ts b/app/src/features/conversations/utils/threadFilter.test.ts
index 8be93ea944..f977596544 100644
--- a/app/src/features/conversations/utils/threadFilter.test.ts
+++ b/app/src/features/conversations/utils/threadFilter.test.ts
@@ -1,11 +1,7 @@
import { describe, expect, it } from 'vitest';
import type { Thread } from '../../../types/thread';
-import {
- GENERAL_TAB_VALUE,
- isThreadVisibleInTab,
- TASKS_TAB_VALUE,
-} from './threadFilter';
+import { GENERAL_TAB_VALUE, isThreadVisibleInTab, TASKS_TAB_VALUE } from './threadFilter';
function thread(overrides: Partial<Thread>): Thread {
return {
diff --git a/app/src/lib/i18n/en.ts b/app/src/lib/i18n/en.ts
index f7fe3ffa4d..7fea50b3bc 100644
--- a/app/src/lib/i18n/en.ts
+++ b/app/src/lib/i18n/en.ts
@@ -3018,7 +3018,6 @@ const en: TranslationMap = {
'reflections.dismiss': 'Dismiss',
'reflections.viewConversation': 'View',
-
// WhatsApp
// Sync
@@ -3185,8 +3184,6 @@ const en: TranslationMap = {
'Run models on your own machine using Ollama. Full privacy, requires setup.',
'backend.ramRecommended': '16GB+ RAM recommended',
-
-
// Actionable
'actionable.complete': 'Complete',
'actionable.dismiss': 'Dismiss',
diff --git a/app/src/lib/i18n/fr.ts b/app/src/lib/i18n/fr.ts
index 59a9248ea4..2473cb8fd4 100644
--- a/app/src/lib/i18n/fr.ts
+++ b/app/src/lib/i18n/fr.ts
@@ -4923,7 +4923,7 @@ const messages: TranslationMap = {
'Utilise la connexion Codex CLI existante depuis ~/.codex/auth.json.',
'settings.ai.backgroundLoops': 'Boucles de fond',
'settings.ai.backgroundLoopsDesc':
- 'Voyez ce qui s\'exécute sans message de discussion et inspectez les lignes récentes du grand livre de crédit.',
+ "Voyez ce qui s'exécute sans message de discussion et inspectez les lignes récentes du grand livre de crédit.",
'settings.ai.loopMap': 'Carte de boucle',
'settings.ai.routeLabel': 'itinéraire : {route}',
'settings.ai.on': 'activée',
@@ -5047,7 +5047,7 @@ const messages: TranslationMap = {
"Modèles utilisés lors de l'interaction directe avec l'utilisateur, des réponses, du raisonnement, des boucles d'agents et de l'aide à la programmation.",
'settings.ai.routing.backgroundTasks': 'Tâches en arrière-plan',
'settings.ai.routing.bgTasksDesc':
- 'Modèles utilisés en dehors du flux principal de conversation pour la synthèse de la mémoire et l\'apprentissage.',
+ "Modèles utilisés en dehors du flux principal de conversation pour la synthèse de la mémoire et l'apprentissage.",
'settings.ai.routing.workload.chat.label': 'Chat',
'settings.ai.routing.workload.chat.description':
'Aller-retour conversationnel direct : mode « Rapide » dans Conversations',
diff --git a/app/src/lib/i18n/it.ts b/app/src/lib/i18n/it.ts
index 65eaacef45..2725585681 100644
--- a/app/src/lib/i18n/it.ts
+++ b/app/src/lib/i18n/it.ts
@@ -5013,7 +5013,7 @@ const messages: TranslationMap = {
"Modelli utilizzati durante l'interazione diretta con l'utente, risposte, ragionamento, cicli dell'agente e assistenza alla codifica.",
'settings.ai.routing.backgroundTasks': 'Attività in background',
'settings.ai.routing.bgTasksDesc':
- 'Modelli utilizzati al di fuori del flusso principale della conversazione per la sintesi della memoria e l\'apprendimento.',
+ "Modelli utilizzati al di fuori del flusso principale della conversazione per la sintesi della memoria e l'apprendimento.",
'settings.ai.routing.workload.chat.label': 'Chat',
'settings.ai.routing.workload.chat.description':
'Conversazione diretta avanti e indietro: modalità "Rapida" in Conversazioni',
diff --git a/app/src/lib/i18n/ko.ts b/app/src/lib/i18n/ko.ts
index 7062639a6a..00260ee0f1 100644
--- a/app/src/lib/i18n/ko.ts
+++ b/app/src/lib/i18n/ko.ts
@@ -4767,7 +4767,8 @@ const messages: TranslationMap = {
'settings.ai.codexAuthButton': 'Codex 연결',
'settings.ai.codexAuthHelper': '~/.codex/auth.json의 기존 Codex CLI 로그인을 사용합니다.',
'settings.ai.backgroundLoops': '백그라운드 루프',
- 'settings.ai.backgroundLoopsDesc': '채팅 메시지 없이 실행되는 항목을 확인하고 최근 크레딧 원장 행을 검사합니다.',
+ 'settings.ai.backgroundLoopsDesc':
+ '채팅 메시지 없이 실행되는 항목을 확인하고 최근 크레딧 원장 행을 검사합니다.',
'settings.ai.loopMap': '루프 맵',
'settings.ai.routeLabel': '경로: {route}',
'settings.ai.on': '켜짐',
@@ -4890,7 +4891,8 @@ const messages: TranslationMap = {
'settings.ai.routing.chatDesc':
'직접 사용자 상호작용, 답변, 추론, 에이전트 루프 및 코딩 도움에 사용되는 모델입니다.',
'settings.ai.routing.backgroundTasks': '백그라운드 작업',
- 'settings.ai.routing.bgTasksDesc': '메모리 요약과 학습처럼 기본 대화 흐름 밖에서 사용되는 모델입니다.',
+ 'settings.ai.routing.bgTasksDesc':
+ '메모리 요약과 학습처럼 기본 대화 흐름 밖에서 사용되는 모델입니다.',
'settings.ai.routing.workload.chat.label': 'Chat',
'settings.ai.routing.workload.chat.description': '직접 대화 앞뒤로: 대화의 "빠른" 모드',
'settings.ai.routing.workload.chat.hint':
diff --git a/crates/openhuman-core/src/agent/triage/origin.rs b/crates/openhuman-core/src/agent/triage/origin.rs
index dc31f92031..fc3e231357 100644
--- a/crates/openhuman-core/src/agent/triage/origin.rs
+++ b/crates/openhuman-core/src/agent/triage/origin.rs
@@ -52,8 +52,7 @@ pub fn local_trigger_origin() -> AgentTurnOrigin {
/// openhuman#5746.
///
/// Explicitly not [`AgentTurnOrigin::Cli`]: that would hand a full trust root,
-/// with no audit row, to attacker-influenceable content — the posture
-/// [`TrustedAutomationSource::SubconsciousTainted`] exists to prevent.
+/// with no audit row, to attacker-influenceable content.
///
/// `job_id` is the envelope's kind slug and correlation id, which is what an
/// operator reading a pending row needs to find the trigger. Both are
diff --git a/crates/openhuman-core/src/config/ops/agent.rs b/crates/openhuman-core/src/config/ops/agent.rs
index e44fdf9cc8..d25c958ed4 100644
--- a/crates/openhuman-core/src/config/ops/agent.rs
+++ b/crates/openhuman-core/src/config/ops/agent.rs
@@ -31,9 +31,8 @@ pub struct AutonomySettingsPatch {
pub max_actions_per_hour: Option<u32>,
/// "Always allow" allowlist — tool names the gate skips prompting for.
pub auto_approve: Option<Vec<String>>,
- /// Blanket "auto-approve everything" bypass. `SubconsciousTainted` and
- /// `Unknown` origins are still denied by the gate regardless of this
- /// setting.
+ /// Blanket "auto-approve everything" bypass. `Unknown` origins are still
+ /// denied by the gate regardless of this setting.
pub auto_approve_all: Option<bool>,
}
diff --git a/crates/openhuman-core/src/config/schemas/helpers.rs b/crates/openhuman-core/src/config/schemas/helpers.rs
index e73e0050d8..fa63231015 100644
--- a/crates/openhuman-core/src/config/schemas/helpers.rs
+++ b/crates/openhuman-core/src/config/schemas/helpers.rs
@@ -215,9 +215,8 @@ pub(super) struct AutonomySettingsUpdate {
/// Replaces the "Always allow" allowlist wholesale — tool names the agent
/// may run without an approval prompt. Empty list clears it.
pub(super) auto_approve: Option<Vec<String>>,
- /// Blanket "auto-approve everything" bypass. `SubconsciousTainted` and
- /// `Unknown` origins are still denied by the gate regardless of this
- /// setting.
+ /// Blanket "auto-approve everything" bypass. `Unknown` origins are still
+ /// denied by the gate regardless of this setting.
pub(super) auto_approve_all: Option<bool>,
}
diff --git a/crates/openhuman-core/src/config/schemas/schema_defs/agent.rs b/crates/openhuman-core/src/config/schemas/schema_defs/agent.rs
index b7ac8630d3..4f8cf2101e 100644
--- a/crates/openhuman-core/src/config/schemas/schema_defs/agent.rs
+++ b/crates/openhuman-core/src/config/schemas/schema_defs/agent.rs
@@ -57,7 +57,7 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {
comment: "Replace the \"Always allow\" allowlist (array of tool names the agent runs without an approval prompt). Empty array clears it.",
required: false,
},
- optional_bool("auto_approve_all", "When true, auto-approve all tool calls without prompting. SubconsciousTainted and Unknown origins still denied. Hard security blocks unaffected."),
+ optional_bool("auto_approve_all", "When true, auto-approve all tool calls without prompting. Unknown origins still denied. Hard security blocks unaffected."),
],
outputs: vec![json_output("snapshot", "Updated config snapshot.")],
}),
diff --git a/crates/openhuman-core/src/security/approval/gate.rs b/crates/openhuman-core/src/security/approval/gate.rs
index 81857a8c9d..56dade16b7 100644
--- a/crates/openhuman-core/src/security/approval/gate.rs
+++ b/crates/openhuman-core/src/security/approval/gate.rs
@@ -119,8 +119,8 @@ tokio::task_local! {
/// so a tool call parked from that run can correlate
/// [`PendingApproval::source_context`](super::types::PendingApproval) back to
/// the exact flow + run (the origin alone only carries `flow_id`, not
-/// `run_id`). Absent for every non-flow caller — chat, cron, subconscious,
-/// CLI never scope this.
+/// `run_id`). Absent for every non-flow caller — chat, cron, background
+/// jobs, CLI never scope this.
#[derive(Clone, Debug)]
pub struct FlowRunContext {
pub flow_id: String,
diff --git a/crates/openhuman-core/src/security/approval/gate_setup.rs b/crates/openhuman-core/src/security/approval/gate_setup.rs
index e66b61e3f5..16e8766f96 100644
--- a/crates/openhuman-core/src/security/approval/gate_setup.rs
+++ b/crates/openhuman-core/src/security/approval/gate_setup.rs
@@ -107,8 +107,8 @@ impl ApprovalGate {
/// fallback pattern so a toggle made this session (config save + live
/// policy reload) takes effect on the very next tool call.
///
- /// Callers MUST still exclude `TrustedAutomationSource::SubconsciousTainted`
- /// and `AgentTurnOrigin::Unknown` before trusting this flag — see the
+ /// Callers MUST still exclude `AgentTurnOrigin::Unknown` before trusting
+ /// this flag — see the
/// `matches!` guard at the call site below. This method only reports the
/// user's setting; it does not know about origin.
fn is_auto_approve_all_enabled(&self) -> bool {
diff --git a/crates/openhuman-core/src/security/approval/gate_triage_tests.rs b/crates/openhuman-core/src/security/approval/gate_triage_tests.rs
index 32f8fa68b2..85ae93d28d 100644
--- a/crates/openhuman-core/src/security/approval/gate_triage_tests.rs
+++ b/crates/openhuman-core/src/security/approval/gate_triage_tests.rs
@@ -173,7 +173,7 @@ async fn intercept_with_workflow_require_approval_persists_and_ttl_denies() {
// A per-flow `require_approval: true` toggle forces every external
// action through the HITL gate even though the origin carries a
// trust root — same conservative park-and-audit shape as
- // `GoalContinuation` / `ExternalChannel`, since there is no flow
+ // `ExternalChannel`, since there is no flow
// review surface to route the prompt to yet (B3).
let (gate, _dir, env) = expiry_gate();
let gate = Arc::new(gate);
diff --git a/crates/openhuman-core/src/security/credentials/bus.rs b/crates/openhuman-core/src/security/credentials/bus.rs
index 8da80f575c..c44bf03002 100644
--- a/crates/openhuman-core/src/security/credentials/bus.rs
+++ b/crates/openhuman-core/src/security/credentials/bus.rs
@@ -11,8 +11,8 @@
//! re-enters the gate during teardown also stalls.
//! 2. Call [`clear_session`] to remove the stored JWT, clear the
//! active-user marker, and stop login-gated services
-//! (voice / autocomplete / local AI / dictation /
-//! subconscious). Idempotent — repeat events are safe.
+//! (voice / autocomplete / local AI / dictation).
+//! Idempotent — repeat events are safe.
//!
//! Without this subscriber, a 401 from a background LLM call would only
//! be detected but never acted on, and the same loop would 401 again on
diff --git a/crates/openhuman-core/src/security/policy/types.rs b/crates/openhuman-core/src/security/policy/types.rs
index 5bdd4dd582..0b773c79ef 100644
--- a/crates/openhuman-core/src/security/policy/types.rs
+++ b/crates/openhuman-core/src/security/policy/types.rs
@@ -186,7 +186,6 @@ pub(super) const WORKSPACE_INTERNAL_DIRS: &[&str] = &[
"cron",
"devices",
"mcp_clients",
- "subconscious",
"vault",
"task_sources",
// The whatsapp_data store was removed along with the scanner that wrote it,
@@ -194,6 +193,10 @@ pub(super) const WORKSPACE_INTERNAL_DIRS: &[&str] = &[
// (chat and message history) from an older version. Keep the directory on
// the internal denylist so agents with workspace access cannot read it.
"whatsapp_data",
+ // The retired background-reasoning engine kept its SQLite state under
+ // `subconscious/`. The engine is gone, but an upgraded profile can still
+ // hold that database (memory-derived reflections). Keep it denied.
+ "subconscious",
// The redirect_links domain was removed (#5051), but an upgraded profile can
// still hold a legacy `redirect_links/links.db` (stored URL history) written
// by an older version. Keep the directory on the internal denylist so agents
@@ -281,8 +284,7 @@ pub struct SecurityPolicy {
pub auto_approve: Vec<String>,
/// When true, the approval gate auto-approves ALL tool calls without
/// prompting — a blanket bypass, not just the `auto_approve` allowlist
- /// above. `TrustedAutomationSource::SubconsciousTainted` and
- /// `AgentTurnOrigin::Unknown` origins are still denied by the gate
+ /// above. `AgentTurnOrigin::Unknown` origins are still denied by the gate
/// regardless of this flag. A remote-origin triage dispatch is *not* in
/// that protected set: with this flag on it is allowed without parking and
/// without a `pending_approvals` audit row (openhuman#5634, accepted).