Creation options
Use these keywords withSandbox.create, Sandbox.connect_or_create, or Sandbox.with. They are not separate Ruby builder methods.
network
Use:none to disable networking, or a hash containing both allowed_hosts and allowed_ports.
Fields
allowed_hostsArray<String>Allowed destination hosts.
allowed_portsArray<Integer>Allowed destination ports. Both host and port restrictions must match.
Example
Example
secrets
An array of hashes. Each entry requires all three string fields below. Ruby does not expose per-location substitution, violation-action, or passthrough-policy configuration.Fields
envStringGuest environment variable receiving the secret placeholder.
valueStringSecret value to substitute into permitted requests.
allowed_hostStringDestination host allowed to receive the secret.
Example
Example
proxy
Accepts anOutboundProxy. The same object can be passed to builder.proxy(proxy).
OutboundProxy
Microsandbox::OutboundProxy.socks4()
Parameters
addressStringProxy host and port, such as 127.0.0.1:1080.
Returns
OutboundProxy
Proxy configuration.
Microsandbox::OutboundProxy.socks5()
Parameters
addressStringProxy host and port, such as 127.0.0.1:1080.
Returns
OutboundProxy
Proxy configuration.
proxy.user_id()
Parameters
valueStringSOCKS4 user ID.
Returns
OutboundProxy
The proxy, for chaining.
proxy.credentials()
Example
Example
Parameters
usernameStringProxy username.
passwordSecretSourceProxy password source.
Returns
OutboundProxy
The proxy, for chaining.
user_id! and credentials! mutate the proxy and return nil.
SecretSource
Microsandbox::SecretSource.env()
Parameters
nameStringNon-empty environment variable name.
Returns
SecretSource
Environment-backed secret source.