Help us shape the future of Go! Take the 2026 Go Developer Survey

procenv

package
v0.13.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package procenv builds environments for subprocesses that agents can influence.

The runtime process holds credentials that no agent-controlled subprocess needs: the datastore URL, the Temporal client credentials, the internal service token, and encrypted credential keys. Child processes receive only the environment required for their specific operation.

Callers therefore build child environments from an explicit allowlist and add whatever else that specific child legitimately needs.

Index

Constants

View Source
const AllowlistEnvVar = "AGENT_RUNTIME_SUBPROCESS_ENV_ALLOWLIST"

AllowlistEnvVar names a comma-separated list of additional keys to pass through, as an escape hatch for deployments that need a variable we have not anticipated. It is read from the parent environment.

Variables

This section is empty.

Functions

func Allowed

func Allowed(key string) bool

Allowed reports whether a key passes the built-in allowlist. It ignores the deployment escape hatch so callers can test the static policy directly.

func Command

func Command() []string

Command excludes provider credentials and the deployment allowlist escape hatch from agent-selected commands. Specific service clients use Sanitized.

func HostGit added in v0.11.2

func HostGit() []string

HostGit builds the environment for git processes the runtime itself runs against repositories (clone, fetch, push). Those never execute agent-selected programs, so on top of the sanitized base they carry the host's git transport configuration and honour the deployment allowlist. Provider credentials are still excluded.

func Sanitized

func Sanitized(overrides ...string) []string

Sanitized returns the allowlisted subset of the current process environment, with overrides applied last. Overrides are "KEY=VALUE" entries and replace any allowlisted value for the same key, so a caller can pass a credential a specific child needs without widening the allowlist for every other child.

func SanitizedFrom

func SanitizedFrom(base []string, overrides ...string) []string

SanitizedFrom is Sanitized against an explicit base environment.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL