mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[GH-ISSUE #157] Domain-based allowOut enforcement: offering our TCP egress proxy implementation — design check first #52
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sunkencity999 on GitHub (Aug 11, 2026).
Original GitHub issue: https://github.com/kvcache-ai/AgentENV/issues/157
Context
src/sandbox/network/policy.rsalready accepts and validates domain entries inallowOut, then refuses them at runtime:So the API surface, the validation, and the error path exist — the enforcement does not. This issue is to ask whether you would welcome that implementation upstream, and to describe the approach before writing a PR against it.
We needed domain-level egress for a deployment where sandboxes must reach a small set of package registries and nothing else, so we built it against v0.1.1 and have been running it in production. Rather than carry the fork indefinitely, we would rather it live here — but only if the design matches where you want the networking layer to go.
Approach
A TCP egress proxy on the node, off by default behind config:
Hostheader (:80) or the TLS SNI (:443) against that sandbox'sallowOutdomains, supporting exact and*.wildcardentries.Domain rules only arm under a
Denybase policy, which is consistent with howallowOutalready behaves for CIDRs.Honest limitations
Worth stating up front, because they bound what this feature claims:
host_interaction_cidrandveth_cidrdefaults). We would document this next to the config rather than leave people to discover it.Size
Roughly 880 lines against v0.1.1: a new
src/sandbox/network/egress_proxy.rs(~540) plus wiring inpolicy.rs,slot.rs,cfg/network.rs,bin/server.rs, the sandbox impl, and docs. Unit tests cover SNI and Host parsing, wildcard matching, and the per-slot registry. There is a companion CLI change (aenv start --allow-out, plus anaenv networksubcommand for live updates) which could land separately or not at all if you would rather shape the CLI yourself.It is written against v0.1.1 and would need rebasing onto current
main— the networking layer has moved since (#108, #110, #145), so some of the slot handling will want reworking rather than replaying.Questions before we write anything
Happy to split it into reviewable pieces (config plumbing, proxy core, slot wiring, docs) rather than one large PR. Also happy to drop it entirely if it cuts across something you have planned — no attachment to our implementation, only to not maintaining a fork of it.
@yingdi-shan commented on GitHub (Aug 24, 2026):
Thanks, closes as PR #207 adds support for domain-based egress control.