Introduce AgentOptions class with DataAnnotations validation bound from configuration (env vars with Agent__ prefix). Replace all Environment.GetEnvironmentVariable() calls with typed IOptions<T> injection. Config errors are caught at startup via ValidateOnStart().