Merged
Conversation
Add a new "manual_approval" policy action alongside block and rate_limit.
When a request matches a manual approval rule, the gateway holds the
agent's HTTP connection while an external consumer polls for pending
approvals and submits approve/deny decisions via the gateway API.
Gateway:
- ApprovalStore trait with in-memory implementation (DashMap + tokio channels)
- ManualApproval variant in PolicyAction/PolicyDecision with priority ordering
- Two new endpoints: GET /api/approvals/pending (long-poll with exclude param),
POST /api/approvals/{id}/decision (typed enum deserialization)
- Body preview: peeks first 4KB via stream chaining, no full-body buffering
- ApprovalGuard RAII cleanup on agent disconnect
- ProxyContext with Arc sharing across MITM sessions
Web app:
- GET /api/gateway-url endpoint for SDK gateway discovery
- Manual Approval option in policy rule dialog, validation, and service
Database:
- Add responses JSON column to onboarding_surveys (migration)
a2ee39b to
d50c1f9
Compare
This was referenced Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new
manual_approvalpolicy action alongsideblockandrate_limit. When a request matches a manual approval rule, the gateway holds the agent's HTTP connection while an external consumer (via the SDK) polls for pending approvals and submits approve/deny decisions.Gateway (Rust)
ApprovalStoretrait with in-memory implementation (DashMap + tokio channels)ManualApprovalvariant inPolicyAction/PolicyDecisionwith priority ordering (Block > ManualApproval > RateLimit > Allow)GET /api/approvals/pending(long-poll withexcludeparam for in-flight dedup),POST /api/approvals/{id}/decision(typed enum deserialization, O(1) account ownership check)ApprovalGuardRAII cleanup on agent disconnect (spawns async remove on drop)ProxyContextwithArcsharing across MITM sessionsManualApproval(after approve) andAllowWeb app
GET /api/gateway-urlendpoint for SDK gateway discoverymanual_approvalaction