Skip to content

yaml_duplicate_key

A policy diagnostic from deedglass policy lint and the policy routes.

Severity: error

A key appears twice in the same mapping. Most YAML readers keep only one of the two values without telling you, so the file would mean something other than what it shows.

deedglass: policy/v1
name: refunds
defaults:
decision: deny
reason: No rule allows this action.
rules:
- id: small-refunds
match: { tool: stripe.create_refund }
when: args.amount <= 5000
when: args.amount <= 50000
decision: allow
✕ policy.yaml:10:5 · yaml_duplicate_key
Key "when" appears twice in this mapping (first on line 9).
hint: Keep one of them; YAML would silently use only one.

Fix: keep one of the two lines. To combine both conditions, join them with && in a single when.