Replace the egress allowlist
Replaces a running direct-egress environment’s outbound IPv4
allowlist while it runs, and answers with its egress status. The
list is normalized the way egress.allow on create is: a bare
address is a /32, host bits are dropped, duplicates go, the order
stays, at most 256 cidrs. [] (or null) lifts the restriction;
the field itself is required. The host applies the list before the
orchestrator records it, so a refused call leaves the previous list
in force and reported. Connections the guest opened that the new
list no longer allows are cut. A fork or migrate started afterwards
carries the new list.
Preconditions are reported as 4xx, not 5xx:
- 400
invalid_argument:allowmissing, not a list, an entry that is not an IPv4 cidr, or more than 256 cidrs. - 404
not_found: unknown environment. - 409
conflict: the environment uses proxy egress, is not running, or is being migrated. - 501
unimplemented: the environment’s provider cannot replace an allowlist (e.g. the in-memory stub).
PUT
/v1/environments/{vmId}/egress/allowAuthorization
AuthorizationBearer token · headerrequired`Authorization: Bearer <token>` — either the static master token
(`ORCH_AUTH_TOKEN`) or a revocable API key issued via
/v1/api-keys (API keys require Postgres; without a database only
the master token is accepted). Master-only surfaces (exec,
attach, API key management) refuse API keys with 403. An expired
key is refused with 401 like an unknown one.
A key minted with `scopes` reaches only the hitl routes
(`/v1/interventions`, `/v1/hitl/*`, and POST /v1/api-keys to mint
a narrower key). Any other route is 403 code `forbidden`, reason
`env_scope`, except an `/v1/environments/{vmId}` route for an
environment the key does not cover, which is 404 so the key
cannot probe which environments exist.
**Authentication can be disabled entirely.** When neither
`ORCH_AUTH_TOKEN` nor an API key store (`DATABASE_URL`) is
configured — the default local-development posture — the bearer
middleware becomes a pass-through: every operation this document
marks as secured is reachable with no credentials, requests carry
no principal, and master-only surfaces therefore admit everyone.
Never run that configuration on a reachable network; set
`ORCH_REQUIRE_AUTH=true` to make the orchestrator refuse to start
without a master token.
or
fuse_sessionAPI key · cookierequiredHttpOnly session cookie set by POST /login for browser callers.
Consulted only when no Authorization header is present.
Path parameters
vmIdstringrequiredVM identifier assigned by the orchestrator.
Query parameters
waitstringHow long to wait for the operation before answering 202 with an
OperationAccepted. Absent or `true` waits up to the server's
attach bound (10s below its write timeout, 50s by default), so a
call that finishes in time answers exactly as it always has.
`false` (or `0`) answers 202 at once. A duration (`30s`) waits that
long, capped at the bound. On POST /v1/environments/{vmId} only
`drain`, `fork` and `migrate` honor it.
Header parameters
Idempotency-KeystringDedupes retries of this call. A retry with the same key and the
same request attaches to the first call's operation instead of
running again: it waits for the running one, or replays a finished
one's answer with `Idempotent-Replayed: true`. The same key with a
different request is 409 `conflict`, `details.reason`
`idempotency_key_reused`. Keys are scoped to the credential and
kept 24h after the operation finishes; a finished 5xx is not kept,
so its retry runs again. A failure restate recorded reruns as a new
restate invocation; one from before restate answered (a timeout, a
dropped connection) attaches to the first invocation. The key also
names the operation's restate invocation, so a retry after an
orchestrator restart attaches to the same invocation, except a
destroy that already finished: its vm is gone, so that retry answers
404. After a restart, a key whose earlier try failed with a 5xx may
replay that failure for up to restate's idempotency retention (24h);
retry with a fresh key. 1-255 visible ascii characters. Every answer carries the operation's id in
`Fuse-Operation-Id`. On POST /v1/environments/{vmId} only `drain`,
`fork` and `migrate` honor it. POST /v1/images (`image.convert`)
and PUT /v1/environments/{vmId}/egress/allow (`egress.allow`)
honor it too.
min length 1 · max length 255
Request body
requiredapplication/jsonallowstring[] | nullrequiredThe new allowlist, IPv4 cidrs or bare addresses. `[]` (or
`null`) lifts the restriction.
Responses
200The allowlist is in force; the environment's egress status.
modestringrequiredAllowed:
directproxyproviderstringThe backend serving this environment. Proxy only.
protocolstringProxy only.
Allowed:
socks5httpendpointstringThe proxy url the workload was handed, e.g.
`socks5h://10.200.3.1:1080`. A host-local address useless to
anyone not already inside the sandbox, and never a credential.
Proxy only.
allowstring[]The outbound allowlist the host enforces, normalized
(`10.0.0.0/8`, `1.2.3.4/32`). Absent when unrestricted. Direct
only.
healthobjectThe endpoint's last probe verdict. Proxy only, and `unknown`
until the reconcile tick (30s by default) has probed it once.
An unhealthy proxy reports and nothing acts on it: the
environment keeps running with no egress, never with direct
egress.
Show propertiesHide properties
statestringrequiredAllowed:
unknownhealthyunhealthyreasonstringThe backend-level failure, e.g. `dial tcp 10.200.3.1:1080:
connection refused`. Empty while healthy. Never a destination
hostname or anything drawn from the sandbox's traffic.
checked_atstring<date-time>202The operation outlasted `?wait=` (or `wait=false`). The body is
an OperationAccepted and `Location` points at
/v1/operations/{operationId}.
operation_idstringrequiredoperationOperationrequiredOne run of a mutating call. Once it finished, `status_code` and
`result` (2xx) or `error` (otherwise) are what the call itself would
have answered.
Show propertiesHide properties
idstringrequiredkindstringrequiredAllowed:
createdestroyforkmigratesnapshotrestoredrainimage.convertegress.allowstatestringrequiredsucceeded is a 2xx answer, failed any other.
Allowed:
runningsucceededfailedstepstringThe step the operation last reported starting. Empty today, since every operation runs on restate, whose steps show in the restate ui.
started_atstring<date-time>requiredfinished_atstring<date-time>status_codeintegerThe http status the call answered with.
resultobjectThe call's response body on success: an Environment for create,
migrate and drain, a ForkEnvironmentResponse for fork, a Snapshot for snapshot, an Image for
image.convert (status_code 202), an EgressStatus for egress.allow, absent for destroy and restore
(204), and a HeldResponse when a hitl gate held the action
(status_code 202).
errorobjectThe call's error body (the `error` member of an Error) on failure.
Show propertiesHide properties
codestringrequiredmessagestringrequireddetailsobjectretry_afterintegerSeconds the call's `Retry-After` asked for. Set on a failed
operation that answered a retry-later 503, so a caller that
polled waits as long as one answered directly.
400Malformed request.
errorobjectrequiredShow propertiesHide properties
codestringrequiredStable machine-readable code. `route_not_found` (404)
means the URL matches no route this server exposes —
usually a wrong host, port, or path prefix — as opposed
to `not_found`, where the route exists but the resource
does not. `forbidden` is emitted by CIDR-allowlist
rejections and by hitl access checks, which set
`details.reason` (see the Forbidden response);
master-only refusals (exec, attach, listing and revoking
API keys) return 403 with code `unauthorized`.
Allowed:
not_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequiredHuman-readable description.
detailsobjectOptional stable, non-sensitive metadata (e.g. ids,
counts). Omitted when empty. A 403 `forbidden` from a
hitl access check carries `reason` (`missing_scope`,
`env_scope`, `self_approval`, `actor_required`,
`actor_mismatch`, `actor_not_allowed`,
`mint_escalation`, `hitl_denied`), plus `scope` for
`missing_scope`, and `gate` and `intervention_id` for
`hitl_denied`. A 423 `locked` carries `intervention_id`
and `kind` (`takeover` or `stall`).
403The caller authenticated, but may not make this request.
Master-only surfaces (exec, attach, listing and revoking API keys)
refuse API keys; those 403 bodies carry code `unauthorized`. CIDR
allowlist rejections return 403 with code `forbidden` and no
reason. Access checks on the hitl routes and scoped keys return
403 with code `forbidden` and `details.reason` set to one of:
- `missing_scope`: the key lacks the scope the route needs
(`details.scope` names it). Full-access keys never hold
`hitl:decide`, `hitl:secret`, `hitl:takeover` or `hitl:act-as`.
- `env_scope`: a scoped key called a route outside the hitl
routes.
- `self_approval`: the key or actor that raised an intervention
tried to decide it.
- `actor_required`: the environment sets `require_actor` and the
decision names no pinned or asserted actor.
- `actor_mismatch`: `Fuse-Actor` differs from the key's pinned
actor.
- `actor_not_allowed`: `Fuse-Actor` sent by a key without
`hitl:act-as`.
- `hitl_denied`: a hitl gate in `deny` mode, or a gate's decider,
refused an exec, lifecycle or computer action, or an edit
matched a `deny` gate. `details.gate` names the gate and
`details.intervention_id` the terminal record; the message is
the gate's `reason`.
- `mint_escalation`: a scoped key tried to mint a key wider than
itself.
errorobjectrequiredShow propertiesHide properties
codestringrequiredStable machine-readable code. `route_not_found` (404)
means the URL matches no route this server exposes —
usually a wrong host, port, or path prefix — as opposed
to `not_found`, where the route exists but the resource
does not. `forbidden` is emitted by CIDR-allowlist
rejections and by hitl access checks, which set
`details.reason` (see the Forbidden response);
master-only refusals (exec, attach, listing and revoking
API keys) return 403 with code `unauthorized`.
Allowed:
not_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequiredHuman-readable description.
detailsobjectOptional stable, non-sensitive metadata (e.g. ids,
counts). Omitted when empty. A 403 `forbidden` from a
hitl access check carries `reason` (`missing_scope`,
`env_scope`, `self_approval`, `actor_required`,
`actor_mismatch`, `actor_not_allowed`,
`mint_escalation`, `hitl_denied`), plus `scope` for
`missing_scope`, and `gate` and `intervention_id` for
`hitl_denied`. A 423 `locked` carries `intervention_id`
and `kind` (`takeover` or `stall`).
404Resource does not exist. Note the distinct code
`route_not_found`, returned when the URL matches no registered
route at all (wrong host, port, or path prefix) rather than a
known route with a missing resource.
errorobjectrequiredShow propertiesHide properties
codestringrequiredStable machine-readable code. `route_not_found` (404)
means the URL matches no route this server exposes —
usually a wrong host, port, or path prefix — as opposed
to `not_found`, where the route exists but the resource
does not. `forbidden` is emitted by CIDR-allowlist
rejections and by hitl access checks, which set
`details.reason` (see the Forbidden response);
master-only refusals (exec, attach, listing and revoking
API keys) return 403 with code `unauthorized`.
Allowed:
not_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequiredHuman-readable description.
detailsobjectOptional stable, non-sensitive metadata (e.g. ids,
counts). Omitted when empty. A 403 `forbidden` from a
hitl access check carries `reason` (`missing_scope`,
`env_scope`, `self_approval`, `actor_required`,
`actor_mismatch`, `actor_not_allowed`,
`mint_escalation`, `hitl_denied`), plus `scope` for
`missing_scope`, and `gate` and `intervention_id` for
`hitl_denied`. A 423 `locked` carries `intervention_id`
and `kind` (`takeover` or `stall`).
409The environment uses proxy egress, is not running, or is being
migrated; or the `Idempotency-Key` was used for a different
request.
errorobjectrequiredShow propertiesHide properties
codestringrequiredStable machine-readable code. `route_not_found` (404)
means the URL matches no route this server exposes —
usually a wrong host, port, or path prefix — as opposed
to `not_found`, where the route exists but the resource
does not. `forbidden` is emitted by CIDR-allowlist
rejections and by hitl access checks, which set
`details.reason` (see the Forbidden response);
master-only refusals (exec, attach, listing and revoking
API keys) return 403 with code `unauthorized`.
Allowed:
not_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequiredHuman-readable description.
detailsobjectOptional stable, non-sensitive metadata (e.g. ids,
counts). Omitted when empty. A 403 `forbidden` from a
hitl access check carries `reason` (`missing_scope`,
`env_scope`, `self_approval`, `actor_required`,
`actor_mismatch`, `actor_not_allowed`,
`mint_escalation`, `hitl_denied`), plus `scope` for
`missing_scope`, and `gate` and `intervention_id` for
`hitl_denied`. A 423 `locked` carries `intervention_id`
and `kind` (`takeover` or `stall`).
500Unexpected server error.
errorobjectrequiredShow propertiesHide properties
codestringrequiredStable machine-readable code. `route_not_found` (404)
means the URL matches no route this server exposes —
usually a wrong host, port, or path prefix — as opposed
to `not_found`, where the route exists but the resource
does not. `forbidden` is emitted by CIDR-allowlist
rejections and by hitl access checks, which set
`details.reason` (see the Forbidden response);
master-only refusals (exec, attach, listing and revoking
API keys) return 403 with code `unauthorized`.
Allowed:
not_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequiredHuman-readable description.
detailsobjectOptional stable, non-sensitive metadata (e.g. ids,
counts). Omitted when empty. A 403 `forbidden` from a
hitl access check carries `reason` (`missing_scope`,
`env_scope`, `self_approval`, `actor_required`,
`actor_mismatch`, `actor_not_allowed`,
`mint_escalation`, `hitl_denied`), plus `scope` for
`missing_scope`, and `gate` and `intervention_id` for
`hitl_denied`. A 423 `locked` carries `intervention_id`
and `kind` (`takeover` or `stall`).
501The operation is not supported by the backing provider (e.g. an
exec or attach against an environment with no real guest).
errorobjectrequiredShow propertiesHide properties
codestringrequiredStable machine-readable code. `route_not_found` (404)
means the URL matches no route this server exposes —
usually a wrong host, port, or path prefix — as opposed
to `not_found`, where the route exists but the resource
does not. `forbidden` is emitted by CIDR-allowlist
rejections and by hitl access checks, which set
`details.reason` (see the Forbidden response);
master-only refusals (exec, attach, listing and revoking
API keys) return 403 with code `unauthorized`.
Allowed:
not_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequiredHuman-readable description.
detailsobjectOptional stable, non-sensitive metadata (e.g. ids,
counts). Omitted when empty. A 403 `forbidden` from a
hitl access check carries `reason` (`missing_scope`,
`env_scope`, `self_approval`, `actor_required`,
`actor_mismatch`, `actor_not_allowed`,
`mint_escalation`, `hitl_denied`), plus `scope` for
`missing_scope`, and `gate` and `intervention_id` for
`hitl_denied`. A 423 `locked` carries `intervention_id`
and `kind` (`takeover` or `stall`).
503No registered host has room for this spec — the scheduler found
no capacity, or no hosts are registered at all (code
`unavailable`). This includes the GPU case: a spec asking for
GPUs a host cannot satisfy lands here. It is also the answer when
the orchestrator could not reach restate, which runs every
mutating operation: nothing was started. Either way it is worth
retrying, once capacity frees up or restate is back: these 503s
carry `Retry-After` (seconds), and the SDKs retry create, fork and
the other operation calls with jittered backoff that waits at
least that long, under the same `Idempotency-Key`. A 503 from the
guest (a computer action with no display) carries no
`Retry-After` and is not retried.
errorobjectrequiredShow propertiesHide properties
codestringrequiredStable machine-readable code. `route_not_found` (404)
means the URL matches no route this server exposes —
usually a wrong host, port, or path prefix — as opposed
to `not_found`, where the route exists but the resource
does not. `forbidden` is emitted by CIDR-allowlist
rejections and by hitl access checks, which set
`details.reason` (see the Forbidden response);
master-only refusals (exec, attach, listing and revoking
API keys) return 403 with code `unauthorized`.
Allowed:
not_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequiredHuman-readable description.
detailsobjectOptional stable, non-sensitive metadata (e.g. ids,
counts). Omitted when empty. A 403 `forbidden` from a
hitl access check carries `reason` (`missing_scope`,
`env_scope`, `self_approval`, `actor_required`,
`actor_mismatch`, `actor_not_allowed`,
`mint_escalation`, `hitl_denied`), plus `scope` for
`missing_scope`, and `gate` and `intervention_id` for
`hitl_denied`. A 423 `locked` carries `intervention_id`
and `kind` (`takeover` or `stall`).
Request
curl -X PUT "http://localhost:8080/v1/environments/string/egress/allow" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"allow": [
"string"
]
}'const response = await fetch("http://localhost:8080/v1/environments/string/egress/allow", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"allow": [
"string"
]
})
});import requests
response = requests.put(
"http://localhost:8080/v1/environments/string/egress/allow",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"allow": [
"string"
]
},
)Response
{
"mode": "direct",
"provider": "string",
"protocol": "socks5",
"endpoint": "string",
"allow": [
"string"
],
"health": {
"state": "unknown",
"reason": "string",
"checked_at": "2024-01-01T00:00:00Z"
}
}{
"operation_id": "string",
"operation": {
"id": "string",
"kind": "create",
"state": "running",
"step": "string",
"started_at": "2024-01-01T00:00:00Z",
"finished_at": "2024-01-01T00:00:00Z",
"status_code": 0,
"result": {},
"error": {
"code": "string",
"message": "string",
"details": {}
},
"retry_after": 0
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}