Administration: internet access and limits
The network allow-list, its presets and recent refusals, and the overridable limits. Administrators only.
| Operation | Method and path |
|---|---|
| List egress rules | GET /api/v1/admin/egress |
| List recent egress refusals | GET /api/v1/admin/egress/refusals |
| Create or replace an egress rule | PUT /api/v1/admin/egress/{host} |
| Delete an egress rule | DELETE /api/v1/admin/egress/{host} |
| List the overridable limits | GET /api/v1/admin/limits |
| Set a limit | PUT /api/v1/admin/limits/{key} |
| Reset a limit to the configuration file's value | DELETE /api/v1/admin/limits/{key} |
| List the internet-access presets | GET /api/v1/admin/egress/presets |
| Apply an internet-access preset | POST /api/v1/admin/egress/presets/{id} |
| Remove an internet-access preset | DELETE /api/v1/admin/egress/presets/{id} |
List egress rules
GET /api/v1/admin/egress
The egress allow-list, sorted by host; an empty list denies every destination. disabled is true when [egress] disabled = true turns egress off: sandboxes are then internal-only and the rules do not apply. Administrators only; a session or a personal token.
Sign-in: A signed-in session or an API token.
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The rules | AdminEgressRules |
| 401 | Authentication required | Error |
| 403 | Not an administrator | Error |
| 503 | Database unavailable or gateway restarting | Error |
List recent egress refusals
GET /api/v1/admin/egress/refusals
The destinations the policy proxy refused lately (ADR-0035 point 3), the most recent first: host, port, the refusal's code, how often and when last, and the list that refused it. A bounded record kept in memory (at most limit destinations; the least recently refused goes first); a restarted gateway starts empty and the log keeps the rest. allowable is true when a rule for that host and port would open it (the allow-list's own refusals); allowed is true when the allow-list as it is now lets it through. Allow this site is PUT /api/v1/admin/egress/{host}. Administrators only; a session or a personal token.
Sign-in: A signed-in session or an API token.
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The recent refusals | AdminEgressRefusals |
| 401 | Authentication required | Error |
| 403 | Not an administrator | Error |
| 503 | Database unavailable or gateway restarting | Error |
Create or replace an egress rule
PUT /api/v1/admin/egress/{host}
Creates without a version (201) or replaces the version read (200). Validated as the gateway file validates [[egress.allow]]. Applies to every sandbox's next new connection; open tunnels keep their own bounds. Administrators only; a session or a personal token. Audited.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
host | path | yes | string | The rule's host pattern: an exact name or IP address, or *.domain for any subdomain (never the domain itself). Case and a trailing dot are ignored; the rule is stored lower-case without the dot. |
Idempotency-Key | header | string | A retried write with the same key replays the stored response before the version check. |
Request body
application/json: AdminEgressRuleWrite
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Replaced | AdminEgressRule |
| 201 | Created | AdminEgressRule |
| 400 | Invalid host, ports, version or body (see details) | Error |
| 401 | Authentication required | Error |
| 403 | Not an administrator | Error |
| 409 | conflict (stale, missing or unexpected version), egress_rule_limit (256 rules) or egress_disabled (egress is off by configuration) | Error |
| 422 | The Idempotency-Key was used with another request | Error |
| 503 | Database unavailable or gateway restarting | Error |
Delete an egress rule
DELETE /api/v1/admin/egress/{host}
Deletes the version read; every sandbox's next new connection to that destination is denied, and open tunnels keep their own bounds. A seeded rule returns at a later start only if its [[egress.allow]] entry changes. Administrators only; a session or a personal token. Audited.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
host | path | yes | string | The rule's host pattern: an exact name or IP address, or *.domain for any subdomain (never the domain itself). Case and a trailing dot are ignored; the rule is stored lower-case without the dot. |
version | query | yes | integer 1 or more | |
Idempotency-Key | header | string | A retried write with the same key replays the stored response before the version check. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 204 | Deleted | |
| 400 | Invalid host, version or parameter (see details) | Error |
| 401 | Authentication required | Error |
| 403 | Not an administrator | Error |
| 404 | No rule for this host | Error |
| 409 | conflict (stale or missing version) or egress_disabled (egress is off by configuration) | Error |
| 422 | The Idempotency-Key was used with another request | Error |
| 503 | Database unavailable or gateway restarting | Error |
List the overridable limits
GET /api/v1/admin/limits
Every overridable admission and sandbox limit, in a fixed order, with its value, the configuration file's value, the bounds an administrator's write must meet and when a change applies. Administrators only; a session or a personal token.
Sign-in: A signed-in session or an API token.
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The limits | AdminLimits |
| 401 | Authentication required | Error |
| 403 | Not an administrator | Error |
| 503 | Database unavailable or gateway restarting | Error |
Set a limit
PUT /api/v1/admin/limits/{key}
Sets a limit to the version read. The whole resulting set must meet the bounds and the order (per_user within slots). Applies from the next admission pass or the next sandbox created; a running sandbox keeps its limits. Administrators only; a session or a personal token. Audited.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
key | path | yes | "admission.slots", "admission.per_user", "sandbox.idle_seconds", "sandbox.max_lifetime_seconds", "mcp.calls_per_minute", "agent_teams.max_members", "agent_teams.token_budget", "agent_teams.deadline_minutes", "agent_teams.member_idle_minutes", "agent_teams.member_stuck_minutes", "agent_teams.idle_stop_minutes", "desktop.max_sessions", "desktop.screenshot_retention_days", "computer.max_screenshots_per_run", "computer.max_actions_per_run" | The limit's name, as in gateway.toml. |
Idempotency-Key | header | string | A retried write with the same key replays the stored response before the version check. |
Request body
application/json: AdminLimitWrite
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Set | AdminLimit |
| 400 | Unknown limit (limit_unknown), a value out of bounds or below its floor (limit_out_of_range), per_user above slots (limit_order), or an invalid version or body (see details); agent_teams.max_members above the slots or the per-user cap less one (limit_order) | Error |
| 401 | Authentication required | Error |
| 403 | Not an administrator, or teams_disabled for an agent_teams key while agent teams are off | Error |
| 409 | conflict (stale version) | Error |
| 422 | The Idempotency-Key was used with another request | Error |
| 503 | Database unavailable or gateway restarting | Error |
Reset a limit to the configuration file's value
DELETE /api/v1/admin/limits/{key}
Resets the version read to the configuration file's value (or its built-in default) and returns the limit; a limit always has a value, so nothing is deleted. Administrators only; a session or a personal token. Audited.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
key | path | yes | "admission.slots", "admission.per_user", "sandbox.idle_seconds", "sandbox.max_lifetime_seconds", "mcp.calls_per_minute", "agent_teams.max_members", "agent_teams.token_budget", "agent_teams.deadline_minutes", "agent_teams.member_idle_minutes", "agent_teams.member_stuck_minutes", "agent_teams.idle_stop_minutes", "desktop.max_sessions", "desktop.screenshot_retention_days", "computer.max_screenshots_per_run", "computer.max_actions_per_run" | The limit's name, as in gateway.toml. |
version | query | yes | integer 1 or more | |
Idempotency-Key | header | string | A retried write with the same key replays the stored response before the version check. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Reset | AdminLimit |
| 400 | Unknown limit, the reset breaks the order, or an invalid version or parameter (see details) | Error |
| 401 | Authentication required | Error |
| 403 | Not an administrator, or teams_disabled for an agent_teams key while agent teams are off | Error |
| 409 | conflict (stale or missing version) | Error |
| 422 | The Idempotency-Key was used with another request | Error |
| 503 | Database unavailable or gateway restarting | Error |
List the internet-access presets
GET /api/v1/admin/egress/presets
The built-in presets (package_registries, open_web, code_hosting), each with its rules and how much of it is applied. open_web is any website on ports 80 and 443; it is never read-only, since the agent can send data to any site. Administrators only; a session or a personal token.
Sign-in: A signed-in session or an API token.
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The presets | AdminEgressPresets |
| 401 | Authentication required | Error |
| 403 | Not an administrator | Error |
| 503 | Database unavailable or gateway restarting | Error |
Apply an internet-access preset
POST /api/v1/admin/egress/presets/{id}
Adds the preset's rules the allow-list lacks, tagged with the preset; a host that already has a rule keeps it, listed in kept. Every sandbox's next new connection sees it. Administrators only; a session or a personal token. Audited per rule.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | "package_registries", "open_web", "code_hosting" | The preset's id. |
Idempotency-Key | header | string | A retried write with the same key replays the stored response before the version check. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | What was added and kept | AdminEgressPresetApplied |
| 401 | Authentication required | Error |
| 403 | Not an administrator | Error |
| 404 | No rule for this host | Error |
| 409 | egress_rule_limit (the list is full) or egress_disabled (egress is off by configuration) | Error |
| 422 | The Idempotency-Key was used with another request | Error |
| 503 | Database unavailable or gateway restarting | Error |
Remove an internet-access preset
DELETE /api/v1/admin/egress/presets/{id}
Removes the rules still tagged with the preset; a rule an administrator edited since is theirs and stays, listed in kept. Administrators only; a session or a personal token. Audited per rule.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | "package_registries", "open_web", "code_hosting" | The preset's id. |
Idempotency-Key | header | string | A retried write with the same key replays the stored response before the version check. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | What was removed and kept | AdminEgressPresetRemoved |
| 401 | Authentication required | Error |
| 403 | Not an administrator | Error |
| 404 | No rule for this host | Error |
| 409 | egress_disabled (egress is off by configuration) | Error |
| 422 | The Idempotency-Key was used with another request | Error |
| 503 | Database unavailable or gateway restarting | Error |