Skip to main content

Administration: internet access and limits

The network allow-list, its presets and recent refusals, and the overridable limits. Administrators only.

OperationMethod and path
List egress rulesGET /api/v1/admin/egress
List recent egress refusalsGET /api/v1/admin/egress/refusals
Create or replace an egress rulePUT /api/v1/admin/egress/{host}
Delete an egress ruleDELETE /api/v1/admin/egress/{host}
List the overridable limitsGET /api/v1/admin/limits
Set a limitPUT /api/v1/admin/limits/{key}
Reset a limit to the configuration file's valueDELETE /api/v1/admin/limits/{key}
List the internet-access presetsGET /api/v1/admin/egress/presets
Apply an internet-access presetPOST /api/v1/admin/egress/presets/{id}
Remove an internet-access presetDELETE /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

StatusMeaningBody
200The rulesAdminEgressRules
401Authentication requiredError
403Not an administratorError
503Database unavailable or gateway restartingError

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

StatusMeaningBody
200The recent refusalsAdminEgressRefusals
401Authentication requiredError
403Not an administratorError
503Database unavailable or gateway restartingError

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

NameInRequiredTypeDescription
hostpathyesstringThe 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-KeyheaderstringA retried write with the same key replays the stored response before the version check.

Request body

application/json: AdminEgressRuleWrite

Responses

StatusMeaningBody
200ReplacedAdminEgressRule
201CreatedAdminEgressRule
400Invalid host, ports, version or body (see details)Error
401Authentication requiredError
403Not an administratorError
409conflict (stale, missing or unexpected version), egress_rule_limit (256 rules) or egress_disabled (egress is off by configuration)Error
422The Idempotency-Key was used with another requestError
503Database unavailable or gateway restartingError

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

NameInRequiredTypeDescription
hostpathyesstringThe 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.
versionqueryyesinteger 1 or more
Idempotency-KeyheaderstringA retried write with the same key replays the stored response before the version check.

Responses

StatusMeaningBody
204Deleted
400Invalid host, version or parameter (see details)Error
401Authentication requiredError
403Not an administratorError
404No rule for this hostError
409conflict (stale or missing version) or egress_disabled (egress is off by configuration)Error
422The Idempotency-Key was used with another requestError
503Database unavailable or gateway restartingError

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

StatusMeaningBody
200The limitsAdminLimits
401Authentication requiredError
403Not an administratorError
503Database unavailable or gateway restartingError

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

NameInRequiredTypeDescription
keypathyes"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-KeyheaderstringA retried write with the same key replays the stored response before the version check.

Request body

application/json: AdminLimitWrite

Responses

StatusMeaningBody
200SetAdminLimit
400Unknown 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
401Authentication requiredError
403Not an administrator, or teams_disabled for an agent_teams key while agent teams are offError
409conflict (stale version)Error
422The Idempotency-Key was used with another requestError
503Database unavailable or gateway restartingError

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

NameInRequiredTypeDescription
keypathyes"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.
versionqueryyesinteger 1 or more
Idempotency-KeyheaderstringA retried write with the same key replays the stored response before the version check.

Responses

StatusMeaningBody
200ResetAdminLimit
400Unknown limit, the reset breaks the order, or an invalid version or parameter (see details)Error
401Authentication requiredError
403Not an administrator, or teams_disabled for an agent_teams key while agent teams are offError
409conflict (stale or missing version)Error
422The Idempotency-Key was used with another requestError
503Database unavailable or gateway restartingError

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

StatusMeaningBody
200The presetsAdminEgressPresets
401Authentication requiredError
403Not an administratorError
503Database unavailable or gateway restartingError

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

NameInRequiredTypeDescription
idpathyes"package_registries", "open_web", "code_hosting"The preset's id.
Idempotency-KeyheaderstringA retried write with the same key replays the stored response before the version check.

Responses

StatusMeaningBody
200What was added and keptAdminEgressPresetApplied
401Authentication requiredError
403Not an administratorError
404No rule for this hostError
409egress_rule_limit (the list is full) or egress_disabled (egress is off by configuration)Error
422The Idempotency-Key was used with another requestError
503Database unavailable or gateway restartingError

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

NameInRequiredTypeDescription
idpathyes"package_registries", "open_web", "code_hosting"The preset's id.
Idempotency-KeyheaderstringA retried write with the same key replays the stored response before the version check.

Responses

StatusMeaningBody
200What was removed and keptAdminEgressPresetRemoved
401Authentication requiredError
403Not an administratorError
404No rule for this hostError
409egress_disabled (egress is off by configuration)Error
422The Idempotency-Key was used with another requestError
503Database unavailable or gateway restartingError