platform command loads its configuration the same way: read a YAML file, overlay environment variables, then validate the result against the settings model and production policy (base/src/platform_network/config/loader.py:37-47).
Load order and precedence
load_settings(path) builds the configuration in three steps (base/src/platform_network/config/loader.py:37-47):
1
Read the YAML file
The file at
--config is parsed as YAML and must contain a mapping; a missing file raises FileNotFoundError and a non-mapping raises ValueError (base/src/platform_network/config/loader.py:39-46).2
Overlay environment variables
Any
PLATFORM_-prefixed environment variable is applied on top of the file values (base/src/platform_network/config/loader.py:28-34).3
Validate
The merged data is validated into the
Settings model, which also runs the production policy (base/src/platform_network/config/loader.py:47, base/src/platform_network/config/settings.py:128-131).base/src/platform_network/config/loader.py:46-47).
Environment variable overrides
Environment overrides use thePLATFORM_ prefix and map nested settings with a double underscore (__) separator. The remainder of the key is lowercased and split into a nested path (base/src/platform_network/config/loader.py:28-33).
Values that begin with
[ or { are parsed as YAML, so lists and mappings can be supplied inline (base/src/platform_network/config/loader.py:12-18):
Settings sections
The top-levelSettings model groups configuration into sections (base/src/platform_network/config/settings.py:118-126):
See the Settings reference for every key, type, and default.
Production policy
Whenenvironment is prod, production, or staging, a stricter policy is enforced at load time (base/src/platform_network/config/policy.py:6, :30-35). The policy runs automatically through the settings validator on every load (base/src/platform_network/config/settings.py:128-131), raising ProductionPolicyError on any violation (base/src/platform_network/config/policy.py:26-27).
In non-production environments these checks are skipped — each validator returns early when
production is false (base/src/platform_network/config/policy.py:43-44, :54-55, :71-72).
Related
Security model
How the admin token and production policy protect the master.
Settings reference
Every key, type, and default these files accept.
Configuration examples
Copy-ready master and validator configuration files.