Overview
Environment variables provide a convenient way to configure FastSkill without modifying code. They are especially useful for containerized deployments, CI/CD pipelines, and when configuration needs to be changed without code modifications.Environment variables have lower priority than programmatic configuration. Use them for deployment-specific settings rather than core application behavior.
Configuration Variables
Core Configuration
Sets the minimum logging level for FastSkill operations. More verbose levels (DEBUG, TRACE) are useful for troubleshooting but may impact performance.
Path to a JSON configuration file that overrides default settings. Useful for complex configurations that are easier to manage in files.
Directory path where FastSkill looks for skill files and stores skill data. Can be absolute or relative to the working directory.
Execution Configuration
Default timeout in seconds for skill execution. Skills that take longer than this will be terminated.
Maximum memory in megabytes that a single skill execution can use. Helps prevent memory exhaustion.
Maximum CPU usage percentage allowed for skill execution. Useful for preventing resource starvation in shared environments.
Whether skills are allowed to make network requests. Set to
false for enhanced security in production environments.Level of sandboxing for skill execution.
strict provides maximum security but may limit functionality.Performance Configuration
Size of the metadata cache in number of entries. Larger values improve performance but use more memory.
Time-to-live for cache entries in seconds. Set to 0 to disable cache expiration.
Whether to persist cache to disk for faster startup times. Useful for production deployments.
Directory path for persistent cache storage. If not set, uses system temporary directory.
Service Configuration
Enable automatic reloading of skills when files change. Useful during development but should be disabled in production.
Comma-separated list of directories to watch for skill changes. Only used when hot reload is enabled.
Maximum number of skill executions that can run simultaneously. Helps prevent resource exhaustion.
Enable detailed logging of all skill operations for security auditing and debugging.
Monitoring Configuration
Enable collection of performance metrics for monitoring and optimization.
Number of hours to retain performance metrics before automatic cleanup.
Enable health check endpoints for load balancers and monitoring systems.
Interval in seconds between health checks when health checks are enabled.
Usage Examples
Development Setup
Production Setup
Docker Deployment
Kubernetes Deployment
Priority Order
Configuration values are resolved in this order (highest to lowest priority):- Programmatic Configuration: Values set in code using ServiceConfig
- Environment Variables: Values from environment variables
- Configuration Files: Values from JSON configuration files
- Default Values: Built-in default values
Validation
FastSkill validates environment variables at startup:Common Validation Errors
Invalid numeric values: Ensure numeric environment variables contain valid numbers
Invalid boolean values: Boolean environment variables must be “true” or “false” (case insensitive)
Invalid enum values: Enum values must match exactly (case sensitive)
Best Practices
1
Use for deployment-specific settings
Use environment variables for settings that change between environments (development, staging, production).
2
Don't commit secrets
Never put sensitive information like API keys or passwords in environment variables in version control.
3
Document your variables
Maintain documentation of which environment variables are used and their expected values.
4
Use consistent naming
Follow the FASTSKILL_ prefix convention for all FastSkill-related environment variables.
5
Validate in CI/CD
Add validation steps in your deployment pipeline to catch configuration errors early.
Migration from Configuration Files
If you’re migrating from configuration files to environment variables:1
Map configuration to variables
2
Update deployment scripts
Replace configuration file references with environment variable exports in your deployment scripts.
3
Test thoroughly
Test the migration in a staging environment to ensure all variables are properly set and validated.
Troubleshooting
Variables Not Taking Effect
Variables Not Taking Effect
Caching: Some configuration changes require service restart to take effect. Check if your service supports hot reloading.
Priority: Remember that programmatic configuration overrides environment variables. Check your code for explicit configuration.
Validation: Use the validation methods to check if your environment variables are being parsed correctly.
Security Concerns
Security Concerns
Environment Variable Security: In most systems, environment variables are visible to all processes running as the same user. Consider using configuration files for sensitive settings in multi-user environments.
Container Security: In Docker and Kubernetes, environment variables are included in container inspection output. Use secrets management for sensitive values.
Platform Differences
Platform Differences
Windows: Use
set instead of export for setting environment variables in Command Prompt.Case Sensitivity: Environment variable names are case-sensitive on most Unix systems but case-insensitive on Windows.
Environment variables provide flexibility for deployment but should be used thoughtfully. For complex applications, consider using configuration files for better visibility and version control integration.