Keep triggers read-only until users approve writes
Summary
Build a user-consent flow so proactive or background agent actions run read-only by default and execute write-side effects only after explicit user approval. The user-visible outcome is an approval surface for actions such as external notifications, meeting-note sharing, Slack posts, email sends/replies, and other mutations.
Problem
OpenHuman is giving write-capable access to proactive agent paths, but the safer default should be read-only. All triggers should collect context, analyze, draft, and recommend in read-only mode; they should not send, post, notify externally, publish meeting notes, or mutate user data until the user approves the exact action.
Current repo shape:
src/openhuman/approval/contains a CLI-oriented supervised approval manager for tool calls.docs/subconscious.mddescribes an "Approval Needed" escalation flow, butsrc/openhuman/subconscious/executor.rscurrently runs write-intent tasks with full permissions when the task text matches action verbs like send/post/create/schedule.src/openhuman/channels/proactive.rscan deliver proactive messages to web and an active external channel.src/openhuman/composio/tools.rstreatscomposio_executeas write-level and enforces sandbox/scope rules, but does not provide a user-facing one-time approval gate for proactive Slack/email actions.- Notification storage/UI exists under
src/openhuman/notifications/andapp/src/components/notifications/, but approval state is not the same thing as notification read/dismiss/acted state.
This hurts trust and privacy: an agent may be able to notify, post, send, or write notes from a background/proactive path without a clear last-mile confirmation. The product needs a single consent contract across desktop and core so proactive actions cannot bypass user approval through a lower-level tool or channel path.
Constraints:
- Desktop app first; core must own the enforcement so UI omissions cannot bypass consent.
- All triggers and proactive/background runs should be read-only unless they hold a scoped approval for the exact write action.
- Avoid logging secrets or full sensitive payloads in approval records.
- Preserve read-only proactive analysis and draft generation where no external side effect occurs.
- Previously configured automations should count as consent only when the stored configuration clearly captures the approved action class, destination, payload pattern, and recurrence.
Solution (optional)
Scope is both core and app.
Core should introduce a durable approval/request model for proactive write-side effects, then require a positive approval token before executing external notifications, Slack/email/Composio write actions, meeting-note publication, or other proactive mutations. App should surface pending approvals with enough context for the user to approve or deny, and core should record the decision/audit trail.
Use the existing approval module as the starting point, but extend it beyond CLI prompts: persistent pending approvals, RPC/controller methods, event emission to the UI, one-time approval tokens, denial handling, and enforcement hooks in proactive/subconscious/integration execution paths.
Acceptance criteria
- [ ] Triggers are read-only by default — Triggered, scheduled, and proactive/background agent runs cannot receive write-capable tool access unless a scoped approval exists for the exact action.
- [ ] Approval required for proactive writes — Any proactive/background action that sends, posts, notifies outside the current chat, writes to an external service, or mutates user data creates a pending approval instead of executing immediately.
- [ ] Read-only work preserved — Proactive analysis, summarization, draft generation, and local preview can run without approval as long as no external side effect occurs.
- [ ] Approval UI — Desktop app shows pending approval cards with source, action type, destination, concise payload preview, and Approve / Deny controls.
- [ ] One-time execution token — Approval produces a scoped, one-time token or equivalent server-side decision that the execution path must consume before performing the action.
- [ ] No bypass through tools — Core enforcement covers lower-level paths such as
composio_execute, proactive channel delivery, subconscious write execution, and notification delivery; a model cannot bypass approval by calling the underlying tool directly. - [ ] Meeting notes covered — Meeting-note workflows may draft locally, but sharing, posting, emailing, or writing notes externally requires approval with destination and preview visible.
- [ ] Slack/email actions covered — Slack posts/DMs and email sends/replies/forwards require explicit approval unless they are part of a previously approved automation whose consent scope matches the exact action.
- [ ] Notification consent covered — Proactive OS/external notifications require consent either per action or through an explicit saved rule/category preference; disabled/denied categories do not deliver.
- [ ] Audit trail — Approval, denial, expiry, and execution outcome are persisted with safe summaries and grep-friendly logs, without raw secrets or full sensitive payloads.
- [ ] Regression safety — Rust tests cover read-only trigger defaults plus approval gating/bypass prevention for representative proactive, Composio write, and subconscious write paths; app tests cover pending approval rendering and approve/deny behavior.
- [ ] Diff coverage ≥ 80% — the implementing PR meets the changed-lines coverage gate (Vitest + cargo-llvm-cov, enforced by
.github/workflows/coverage.yml).
Related
- Existing CLI approval manager:
src/openhuman/approval/ - Subconscious approval design:
docs/subconscious.md - Subconscious write execution:
src/openhuman/subconscious/executor.rs - Proactive channel delivery:
src/openhuman/channels/proactive.rs - Composio action execution:
src/openhuman/composio/tools.rs - Notification domain:
src/openhuman/notifications/ - Notification UI:
app/src/components/notifications/