Repository navigation
RFC: Remote Approval Gate with Zero-Trust Push, In-Flight Steering & Flutter Mobile Companion #8472
mysma-9403
started this conversation in
Ideas
Replies: 1 comment 2 replies
|
The lockscreen tap is the last thing the operator sees in this design: once approve_once or approve_always_for_flow resolves, nothing pushes the tool's result back to the device, so a force-push approved from the notification shade lands unseen. I'd send a second encrypted push on completion with the exit status and a revoke for the flow grant, since approve_always_for_flow given one-handed from a lockscreen is the decision most likely to need taking back. Can a flow grant be revoked from the companion, or only from the desktop? |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Overview & Motivation
In autonomous multi-agent environments (where OpenHuman runs on headless VPS instances, Docker containers, or background desktop daemons), human-in-the-loop (HITL) approval gates are vital for high-risk operations (such as payment checkouts, destructive bash commands, database alterations, or sensitive credential usage).
However, existing desktop-only modal prompts break unattended autonomous workflows whenever the operator is away from their workstation or running a headless server.
We would like to propose and open for discussion an RFC for a Remote Approval Gate with Zero-Trust Push, In-Flight Agent Steering, and a Mobile Companion Client (Flutter), designed strictly around OpenHuman's architectural tenets: zero heavy dependencies, strict privacy / E2E encryption, and lightweight non-blocking asynchronous parking.
This ties directly into the active epic #8369 (tinysecurity policies and approvals migration led by @senamakel), and builds on top of the recent foundation in PR #8452 (
feat/remote-approval-steer).1. High-Level Architecture (Zero-Trust Push & Relay)
A major challenge for self-hosted / local-first software is delivering native Push Notifications (FCM / APNs) when the instance sits behind NAT or on a private VPS, without exposing sensitive context to intermediate servers.
sequenceDiagram autonumber actor Operator as Operator (Mobile Phone) participant Core as OpenHuman Rust Core (VPS / Desktop) participant Bus as Unified Rust Bus participant Relay as Stateless Push Relay (Cloudflare Worker) participant FCM as Firebase Cloud Messaging / APNs participant Harness as TinyAgents LLM Turn Loop Harness->>Core: High-risk Tool Intercept (e.g. shell_exec("git push -f origin main")) Core->>Bus: Event: ApprovalRequested (parked on tokio::oneshot) Core->>Relay: POST /push (Encrypted Blob + FCM Token) Relay->>FCM: Forward opaque encrypted payload FCM->>Operator: Native Push Notification with Actions: [Approve, Reject, Steer] alt Operator uses Lockscreen Inline Reply: [Steer] -> "Push to fix/login and open PR" Operator->>Core: Signed JSON-RPC: approval.steer(request_id, instructions) Core->>Bus: Event: ApprovalDecided { decision: "steer", ... } Core-->>Harness: GateOutcome::Steer { instructions } Harness-->>Harness: Inject Synthetic Tool Return Directive Harness->>Harness: LLM adjusts plan immediately in the same turn without context loss end1.1. Zero-Trust Push Delivery (Two-Tier Model)
FIREBASE_SERVICE_ACCOUNTJSON, ntfy.sh server, or WebPush endpoint directly inconfig.toml/.env.1.2. Cryptographic Handshake & QR Pairing
Building upon the foundation in
crates/openhuman-core/src/security/devices/:openhuman pair --qrin ASCII) or desktop UI containing{ core_pubkey, channel_id, rpc_url }.TunnelCipher).2. In-Flight Agent Steering (
ApprovalDecision::Steer)Standard approval gates only support binary
Approve(execute tool) orDeny(fail turn / error out). The killer capability for autonomous agents is in-flight steering:approval.steer(request_id, instructions)is invoked, the Rust Core wakes the parked async waiter and passesGateOutcome::Steer { instructions }to the agent harness middleware.3. Rust Core Architecture (Unified Bus & tinysecurity)
Because OpenHuman can sustain 500+ agents per process, approval parking must never block OS threads or hold database locks:
tokio::sync::oneshotchannels held in an in-memory waiter registry (waiters: Mutex<HashMap<String, oneshot::Sender<GateResolution>>>).AGENTS.md), logging only sanitized metadata such asinstructions_len.openhuman.approval_list_pending: Enumerate pending gate requests.openhuman.approval_decide: Resolve with standard outcomes (approve_once,approve_always_for_tool,approve_always_for_flow,deny).openhuman.approval_steer: Provide steering instructions (request_id,instructions,agent_id).4. Mobile Companion Client (Flutter Reference Implementation)
Flutter is an ideal cross-platform client (iOS & Android) that interfaces directly with OpenHuman via JSON-RPC over WebSocket or encrypted tunnels:
Key UX Modules:
RemoteInput) and iOS (UNTextInputNotificationAction) support direct inline responses from the lockscreen.git push --force origin main".expires_at), risk indicators (Low, Medium, High, Critical), formatted JSON / Bash diffs, and action buttons.A full Flutter reference architecture with
flutter_local_notifications,firebase_messagingbackground handlers, and X25519 encryption has been drafted.5. Current Status & Integration Plan
ApprovalDecision::Steerengine, harness interception, wire endpoints, privacy log scrubbing, and Web UI approval audit integration.tinysecurityas the unified policy and approval authority.We would love to hear feedback from @senamakel and the maintainers on:
All reactions