Functions
WithSecrets()
Example
Example
CreateSandbox alongside the other options.
Parameters
secrets…SecretEntrySecret entries to attach, usually built with Secret.Env.
Returns
SandboxOption
Functional option for CreateSandbox.
Secret
TheSecret factory is a package-level value. Call its methods to build SecretEntry values without populating struct literals by hand.
Secret.Env()
Example
Example
SecretEntry that maps an environment variable to a real value. The guest sees a placeholder; the real value is substituted by the TLS proxy only when traffic goes to an allowed host. Pass an empty SecretEnvOptions{} when no extra tuning is needed.
Parameters
envVarstringEnvironment variable name holding the placeholder inside the sandbox. Must be non-empty and cannot contain
= or NUL; shell-identifier syntax is not required.valuestringThe real secret value. Never crosses the FFI into the guest.
optsSecretEnvOptionsAllowed hosts, placeholder override, TLS requirement, and violation action.
Returns
Pass to WithSecrets.
Types
SecretEntrystruct
accepted by WithSecrets() · returned by Secret.Env()
A single credential the network proxy substitutes at the transport layer. The value never reaches the guest VM. Usually produced bySecret.Env; exported for callers that prefer struct literals.
SecretEnvOptionsstruct
accepted by Secret.Env()
TunesSecret.Env beyond the required envVar and value.
ViolationActionstring enum
field of SecretEntry · NetworkConfig
NetworkConfig.OnSecretViolation; override per-secret with SecretEntry.OnViolation.