Security¶
Per-run egress policy (EgressConfig) and how a run references a secret without ever seeing its value
(SecretKeyRef).
resoluto.sandbox.egress.EgressConfig
dataclass
¶
Backend-neutral egress allowlist. SECURE BY DEFAULT: EgressConfig() DENIES all egress
except DNS and the object store — a fresh sandbox cannot phone home. You opt IN to what the
workload needs. Same knobs on every backend:
- public_https=False (DEFAULT) → deny all outbound except DNS + store. Set True to allow ALL HTTPS (:443) — the "let it reach the internet" escape hatch for trusted workloads.
- allow=[...] opens SPECIFIC destinations — hostnames (e.g. "api.anthropic.com", "registry.npmjs.org")
OR CIDRs — on allow_port (443 default; e.g. 22 for git-over-SSH). Hostnames resolve to CIDRs when
rendered. This is the RECOMMENDED way to run untrusted code on k8s: least privilege. (On the local
backend, prefer per-run
Sandbox.run(egress=[domains])— enforced by domain via the SNI proxy, so it never goes stale for CDN-backed hosts.) - store_cidr/store_port: the k8s object-store endpoint (REQUIRED for the k8s backend; the local backend reaches its store over a file mount, so it ignores these). Always allowed — the sandbox must return results.
IMDS (169.254.169.254) is ALWAYS denied; the local renderer also denies RFC1918 (no lateral
movement) unless you explicitly allow a private CIDR.
NOTE: NetworkPolicy/iptables are CIDR-based — pinning a CDN-backed host (e.g. api.anthropic.com
behind Cloudflare) to its resolved IPs is fragile (they rotate). When you need reliable access to
such a host from otherwise-restricted code, public_https=True is the pragmatic choice.
from_store_env
classmethod
¶
Build the allowlist from RESOLUTO_STORE_ENDPOINT, honoring RESOLUTO_STORE_EGRESS_CIDR/PORT and the simple RESOLUTO_EGRESS_ALLOW / RESOLUTO_EGRESS_PUBLIC_HTTPS knobs; None if no store.
Source code in src/resoluto/sandbox/egress.py
resoluto.sandbox.secrets.SecretKeyRef
dataclass
¶
Reference to an existing Kubernetes Secret's key. k8s-only: rendered as valueFrom.secretKeyRef by K8sSandboxRuntime; ignored by the local backend (KataNerdctlSandboxRuntime never reads SandboxLaunchSpec.k8s_secret_refs). The Secret itself must already exist — created by kubectl, External Secrets Operator, or any other means; resoluto-sandbox never creates or syncs one.