Skip to content

Policy Reference

balakrishnagatla edited this page Nov 29, 2026 · 1 revision

Policy Reference

Teams tune infralens in infralens.yaml without code changes. Every key is optional. Point to the file with --policy or INFRALENS_POLICY. Full example.

Top level

Key Default
providers [mock] Also INFRALENS_PROVIDERS
regions [us-east-1] Also INFRALENS_REGIONS
ignore_tags env: [sandbox] Findings on resources with these tag values are skipped
owner_tag_keys [owner, Owner, created-by] First match wins
team_tag_keys [team, Team]
env_tag_keys [env, Environment]

savings

Key Default
idle_cpu_percent 5 Average CPU below this...
idle_lookback_days 7 ...over this many days counts as idle
stopped_instance_days 14
snapshot_max_age_days 90
min_monthly_cost_usd 1 Skip opportunities smaller than this

incidents

Key Default
log_window_minutes 60 Recent window for error counting
log_baseline_hours 24 Baseline to compare against
error_spike_ratio 3 Recent rate at least 3× baseline...
min_errors 10 ...and at least 10 errors
change_lookback_hours 24 For what_changed
correlation_minutes 120 Changes this long before an alert are suspects

ownership

Key Default
required_tags [owner, team, env]

provider_options

Per-provider settings, see Providers.

provider_options:
  aws:
    profile: prod-readonly
    log_groups: [/ecs/payment-api, /ecs/checkout]
  kubernetes:
    context: my-cluster
    namespaces: [shop, payments]
    pending_minutes: 5
    prices: { pv_gb_month: 0.08, load_balancer_month: 18 }

Silencing one resource

Tag it infralens=ignore, or ask your AI to suppress the finding with a reason. Suppression is recorded in infralens' store and survives future scans.

Clone this wiki locally