Configuration Files
Vectra Guard uses YAML configuration files to control its behavior. You can configure protection levels, sandbox settings, policies, and more.File Locations
Vectra Guard looks for configuration files in the following order (last one wins):Global Config
~/.config/vectra-guard/config.yamlCreated by vg init - applies to all projects for the userRepo-Local Config
./.vectra-guard/config.yamlCreated by vg init --local - project-specific overridesConfiguration Discovery
When you run a Vectra Guard command, it automatically discovers configuration files:- Starts with built-in defaults
- Loads global config (
~/.config/vectra-guard/config.yaml) - Looks for project config (
./vectra-guard.yaml) - Applies repo-local overrides (
./.vectra-guard/config.yaml) - Applies environment variable overrides
Basic Configuration Structure
A minimal configuration file contains these key sections:vectra-guard.yaml
Everything is optional - Vectra Guard uses smart defaults if you don’t specify a value.
Using the Init Command
Thevg init command helps you create configuration files quickly.
Create Global Config
~/.config/vectra-guard/config.yaml with recommended defaults.
Create Project Config
./.vectra-guard/config.yaml in your project directory.
Interactive Setup
- What’s your use case? (development/CI/production)
- Do you want aggressive sandboxing?
- Should CVE scanning be enabled?
- What logging format do you prefer?
View Current Config
Configuration Layers
Vectra Guard uses a layered approach, where each layer can override the previous one:Layer 1: Built-in Defaults
Layer 1: Built-in Defaults
Vectra Guard ships with sensible defaults:
guard_level: autosandbox.mode: alwayssandbox.security_level: balancedsandbox.enable_cache: true- CVE scanning enabled
Layer 2: Global User Config
Layer 2: Global User Config
~/.config/vectra-guard/config.yamlYour personal preferences that apply to all projects.Layer 3: Project Config
Layer 3: Project Config
./vectra-guard.yamlTeam-wide policies committed to version control.Layer 4: Repo-Local Config
Layer 4: Repo-Local Config
./.vectra-guard/config.yamlProject-specific overrides (not usually committed to git).Layer 5: Environment Variables
Layer 5: Environment Variables
Environment Variable Overrides
Override any configuration at runtime:- Guard Level
- Bypass Protection
- Sandbox Mode
Best Practices
Use Auto-Detection
Set
guard_level: auto and let Vectra Guard intelligently adjust protection based on context.Commit Project Config
Share security policies with your team by committing
vectra-guard.yaml to version control.Layer Your Protection
Use global config for personal preferences, project config for team policies, and env vars for situational overrides.
Test Your Config
Use
vg validate script.sh to test how your configuration handles commands.Validating Configuration
Test your configuration before deploying:Next Steps
Presets
Use pre-configured settings for common scenarios
Sandbox Config
Configure sandboxing modes and security levels
Guard Levels
Understand auto-detection and protection levels
API Reference
Complete configuration schema reference