Repository navigation
Description
Feature request: require_approval policy action — human-in-the-loop approval for gated requests
Problem
auth-proxy's policy engine currently has two outcomes for a request: allow (swap credential, forward) and deny (fail closed). That covers model API traffic well, but there is a class of agent actions where neither outcome is right:
- The agent acts outward, in the user's name, with side effects — e.g. posting a message to Discord, sending email, or any write against a third-party API.
- These actions should not be auto-allowed (a prompt-injected or mistaken agent could fire them), and should not be hard-denied either (the agent is useless if it can never act).
- Today the only available gate is behavioral: the agent promises to ask the user first. That is not a system-level block. The agent holds a working send path and is trusted not to use it.
What is needed is a third policy outcome enforced inside the proxy: park the request, let the human approve or deny it, and only then perform the credential swap and forward. The agent's worst case becomes "can submit requests nobody approves."
Proposal
1. New policy action: require_approval
Extend the per-identity TOML policy so a route (identity + method + canonicalized path) can resolve to allow, deny, or require_approval. Fail-closed semantics are preserved: anything not matched is still denied, and a parked request whose approval state is unknown is never executed.
2. Pending request store
Parked requests go into a durable store with the same properties as the existing expiry store (survives proxy restarts, proxy fails closed without it). Each parked entry records:
- Request id
- Caller identity + session id (from the surrogate registration)
- The canonicalized request (method, host, path, body hash — approval must bind to exactly what will be sent; no mutation after approval)
- Arrival time and an approval expiry (short TTL; expired requests are dropped, never executed)
3. Approval plane
A separate, small API for the human approver, authenticated independently of agent callers — mirroring the runtime's Ed25519 proof pattern, with the approver key held only on the user's own device:
listpending requests (full canonicalized content, shown to the approver as-is)approve <id>/deny <id>- Optional notification hook (webhook) fired when a request is parked, so the approver learns about it without polling
The agent must have no network or credential path to this plane, the same way it has no path to session.sock today.
4. Deferred execution and result return
- On approval: the proxy performs the credential swap and forwards the parked request exactly once, then records the upstream result against the request id.
- On denial or expiry: the request is discarded; the caller receives a terminal error.
- The caller learns the outcome by polling the request id (or an optional callback). The original request does not hang open waiting for a human.
- Audit lines are emitted for each transition:
parked,approved,denied,expired,executed, with caller identity, approver identity, and the body hash.
Security invariants
- The real credential still never leaves the proxy; approval changes whether the swap happens, not who holds the credential.
- Approval binds to the canonicalized request hash — approve-what-you-see; any byte difference is a different request.
- Single execution: an approved request executes at most once; approvals cannot be replayed.
- Approver authentication is independent of caller keys and of the runtime proof; compromising the agent container yields neither.
- Revoking a session also drops its parked requests.
First consumer: Discord upstream profile
- New upstream profile for
discord.comAPI with a static Bot token in the credential store (file-backed store already supports this shape). - Path classification for the pilot identity:
GETreads →allow;POST /channels/{id}/messages(including replies) →require_approval. - This replaces a behavioral draft-then-ask workflow with a proxy-enforced one: the agent (Muse, via a custom connector) submits the send as a normal API request to the proxy; it physically cannot reach Discord with a usable credential on its own.
Deployment note
Phase 1 deploys auth-proxy as a same-pod sidecar (loopback + per-UID iptables). The Discord consumer needs a variant where:
- The proxy runs on the user's home pod/host, holding the Discord credential proxy-only.
- The agent reaches it remotely (e.g. over Tailscale) using caller key + surrogate.
- The registrar/runtime role (session surrogate registration with proof) is filled by a user-controlled component, not by anything in the agent's environment.
Deployment models: sidecar vs standalone service
require_approval works the same in two deployment models; what changes is the trust scaffolding around the gate, not the approval flow.
Sidecar mode (original, in-cluster). The proxy runs as a same-pod sidecar next to agents our own runtime spawns (openab-pty / OpenAB classic). Caller identity is a session surrogate registered by the runtime with Ed25519 proof; revocation is lifecycle-bound (session ends → surrogate revoked → parked requests dropped). The proxy never faces a network (loopback + per-UID iptables), egress is allowlisted at the cluster level, upstream credentials live in the proxy's store, and the proxy is in the data path.
Standalone service mode (third-party callers). When the caller is a platform we don't operate — Muse, Grok, or another external agent platform — there is no registrar and no lifecycle to bind to. The proxy runs as a standalone, reachable service (for the Discord consumer: on a host the user controls). Caller keys are provisioned out of band; revocation is TTL- and operator-driven. Enforcement shifts from network control to credential control, in two sub-shapes:
- The caller's platform has its own vault and egress enforcement (Muse): the gate holds no credential and stays out of the data path — it issues a one-time approval proof bound to the request hash, the platform's egress swaps in the credential, and the executed result is reported back so the audit trail stays complete.
- The caller's platform has no such hook: the gate holds the credential in its own store and forwards in-path after approval, as in the generic flow above.
The invariants in this issue (hash-bound single-use approval, no agent path to the approval plane, recorded denials) hold in both modes.
Open questions
- Approval UX beyond the API (CLI? minimal web page? push via the notification hook only?)
- Should approval support batching (approve several parked requests at once) or stay strictly one-by-one for high-risk routes?
- Max parked-request lifetime per route — one global default or per-policy?
- Does
require_approvalapply per-request only, or should there be a "approve this route for N minutes" lease for low-risk cases? (Default answer should be no; noting it as a question because users will ask.)
Non-goals
- Changing the existing allow/deny behavior for model API traffic.
- Content moderation of parked requests — the proxy presents the request verbatim; judging it is the approver's job.
Diagrams
The diagrams below show the standalone service mode (the Discord / Muse consumer). In sidecar mode the same approval flow runs with the runtime as registrar and the proxy in the data path — see Deployment models above.
Scenario — a gated send, end to end
Architecture
flowchart LR
subgraph CALLER["Caller — agent side"]
CLAUDE["Muse<br/>via custom connector"]
AGENT["Other agents"]
SUBMIT["Connector submits:<br/>· request addressed to the auth-proxy base URL — the gate is the actual recipient<br/>· caller identity (caller key + surrogate)<br/>· request (method / path / body)<br/>· destination — upstream id: Discord (base URL resolved by the proxy's upstream profile)<br/>· the declared destination is bound into the request hash — cannot be swapped after approval<br/>The caller never holds the real credential"]
CLAUDE --- SUBMIT
AGENT --- SUBMIT
end
subgraph PROXY["auth-proxy — the gate"]
CHECK["1 · Caller check<br/>+ canonicalize request<br/>(resolved upstream host + method / path / body → hash)"]
POLICY{"2 · Policy decision<br/>per-identity TOML · fail-closed"}
PARK[("3 · Pending store<br/>parked request: canonical form<br/>+ body hash + TTL")]
SWAP["4a · Credential swap — generic path<br/>the proxy holds the credential<br/>and injects it"]
RESULT["Record upstream result<br/>against request id<br/>(caller polls by request id)"]
REVOKE["Session revoked"]
AUDIT[("Audit log<br/>parked / approved / denied /<br/>expired / executed")]
CHECK --> POLICY
POLICY -->|"require_approval"| PARK
REVOKE -.->|"drops its parked requests"| PARK
end
subgraph PLANE["Approval plane — separate API<br/>no path from any agent"]
LIST["Pending list<br/>canonical request shown as-is"]
SIGN["Approve / deny<br/>WebAuthn sign-off<br/>bound to request hash · single-use"]
LIST --> SIGN
end
subgraph DEVICES["User's devices"]
PHONE["Phone — approval client<br/>PWA today, native app later<br/>approver key lives only here<br/>Face ID / Touch ID"]
DESK["Desktop iPhone — nearpush<br/>shows the allow card<br/>display only, cannot approve"]
end
subgraph MUSEP["Muse platform — Muse deployment<br/>on this path the gate holds no credential"]
VAULT[("Vault / Secret Manager<br/>the real credential lives here")]
SENTINEL["4b · Sentinel — egress<br/>verifies the approval proof,<br/>then swaps in the real credential"]
VAULT -->|"real credential<br/>never exposed to the model"| SENTINEL
end
subgraph DEST["Destination APIs"]
DISCORD["Discord API<br/>first consumer"]
OTHER["Other APIs"]
end
CLAUDE -->|"API request → auth-proxy base URL<br/>declares destination: Discord"| CHECK
AGENT -->|"API request → auth-proxy base URL<br/>declares destination: Discord"| CHECK
POLICY -->|"allow · generic"| SWAP
POLICY -->|"allow · Muse: verdict only<br/>no proof needed"| SENTINEL
POLICY -->|"deny"| DENY1["Rejected<br/>fail closed"]
PARK -->|"parked · notify hook"| LIST
PARK -.->|"push allow card"| DESK
DESK -.->|"tap card"| PHONE
PHONE -->|"list · approve · deny"| SIGN
SIGN -->|"approved · generic path"| SWAP
SIGN -->|"approved · Muse path: gate issues a one-time<br/>approval proof bound to the request hash"| SENTINEL
SIGN -->|"denied"| DENY2["Recorded denial<br/>request discarded"]
PARK -->|"TTL expired"| DENY2
SWAP -->|"forward · exactly once"| DISCORD
SWAP -->|"forward · exactly once"| OTHER
SENTINEL -->|"send · exactly once"| DISCORD
DISCORD -->|"response · generic path"| RESULT
OTHER -->|"response · generic path"| RESULT
RESULT -->|"caller fetches the real response<br/>by request id (poll)"| CLAUDE
RESULT -->|"caller fetches the real response<br/>by request id (poll)"| AGENT
DISCORD -->|"response · Muse path"| SENTINEL
SENTINEL -->|"response returns along the same call<br/>Muse receives the real Discord response"| CLAUDE
SENTINEL -.->|"report executed + result to the gate<br/>completes the audit trail"| RESULT
PARK -.-> AUDIT
SIGN -.-> AUDIT
SWAP -.-> AUDIT

Activity
docs(examples/muse-discord): document read-side risk, openabdev#5/ope…
ttmuse commentedon Nov 16, 2026
Thanks for the detailed feedback, @wizlawz — the three points (audit as a pre-execution hash-chained record, exactly-once that survives a restart, and expiry as a recorded refusal rather than a state) bear directly on how
require_approvalis being shaped here.You mentioned you run a pre-action gate with the same shape in a different stack, with run evidence behind it. Would you be willing to share your project — a repo link or a write-up? We'd like to see how you've implemented it, especially the hash-chained audit record and the crash-recovery story for consumed approvals.
docs: add require_approval scenario diagram (for issue openabdev#5)
docs: add Deployment models section to README
docs: mark unbuilt features as planned in Deployment models
docs: document sidecar and standalone service deployment models (#11)
design: gated passthrough for Muse (hold-connection approval PoC) (#13)
chaodu-agent commentedon Nov 19, 2026
Thanks for the careful notes on write-ahead audit and restart safety. The merged stage 2 design (PR #29) writes the held and forwarded records before the action, and refuses the request if either write fails. An expired hold ends as a recorded refusal (410), not as a state that can be polled.
A hold lives only in the open connection, so a restart drops it and nothing is re-executed. That is why the restart-safe single-execution store is not in the current design. If we add a durable store later, we will revisit it there.
This repository does not accept or link payments. Please keep further discussion to the technical points.