From 9193f37963930710633a05ee2f49a01154bed2db Mon Sep 17 00:00:00 2001 From: atlas Date: Fri, 30 Oct 2026 12:28:51 +0100 Subject: [PATCH] derive per-agent egress entries from operator-linked accounts --- docs/networking/network.md | 19 +- .../src/agent/detail/AllowedDomains.tsx | 7 +- hive-c0re/src/workers/squid_allow.rs | 1 + swarm-controller-api/src/egress.rs | 5 +- swarm-controller/src/backend_egress.rs | 108 ++- swarm-controller/src/egress_allow.rs | 7 +- swarm-controller/src/forge_account.rs | 9 + swarm-controller/src/github_account.rs | 1 + swarm-controller/src/link_egress.rs | 622 ++++++++++++++++++ swarm-controller/src/linked_accounts.rs | 12 +- swarm-controller/src/main.rs | 1 + swarm-controller/src/matrix_account.rs | 9 + swarm-controller/src/startup.rs | 15 +- swarm-wire/src/egress_allow.rs | 74 ++- 14 files changed, 852 insertions(+), 38 deletions(-) create mode 100644 swarm-controller/src/link_egress.rs diff --git a/docs/networking/network.md b/docs/networking/network.md index 94bbd912..0bd49466 100644 --- a/docs/networking/network.md +++ b/docs/networking/network.md @@ -349,9 +349,9 @@ host. It never decrypts TLS, so it holds no signing key. It caches nothing. you add the entry, and `hive-c0re` checks each name again and skips one that fails, or that the base list or the canary covers, or that another entry of the same list covers. A name that resolves to a private address stays a 403. - The controller also adds entries itself, and only from the operator's save - of an agent's API-key environment in the swarm UI: it takes the host from - `ANTHROPIC_BASE_URL` and from every variable named `*_BASE_URL` (the + The controller also adds entries itself, and only from the operator's own + actions in the swarm UI. Saving an agent's API-key environment makes it take + the host from `ANTHROPIC_BASE_URL` and from every variable named `*_BASE_URL` (the address an ACP agent that loads the same file reads), and keeps one `derived` entry for that agent per host. Each host passes the same check as an operator's entry, so an IP address, `localhost` and a base-list name get @@ -366,6 +366,19 @@ host. It never decrypts TLS, so it holds no signing key. It caches nothing. `acp.opencode.provider.baseUrl`, get no derived entry, so add one in the swarm UI. A `hive-c0re` that predates the field renders a derived entry like any other. + Linking a GitHub token, an external matrix account or an external forge + account adds a derived entry for that agent per host it reaches, and + deleting the account removes it: `github.com` and `api.github.com` for + GitHub, and the host of the matrix account's `homeserver` or the forge + account's `url`. Each entry's `source` (`link:github`, + `link:matrix:`, `link:forge: