version: 1
consts:
max_recipients: 5
prod_env: "production"
roles:
base: # shared mixin
is_mixin: true
consts: { max_recipients: 5 }
default:
inherits: [base]
default_policy: { mode: deny } # deny by default
tools:
send_email:
mode: allow
constraints:
- count(args.to) <= consts.max_recipients # count() + const
- every(args.to, endswith(., "@acme.com")) # quantifier
refund:
mode: allow
constraints:
- args.amount <= args.limit # cross-field
- matches(args.ticket, "^INC-[0-9]+$") # regex
read_file:
mode: allow
constraints:
- startswith(args.path, "/srv/") and not contains(args.path, "..")
deploy:
mode: approval_required
constraints:
- args.env != consts.prod_env or role == "admin" # or + role
admin:
inherits: [base]
tools:
deploy: { mode: allow }count() · any() · every()cross-fieldmatches · startswith · endswith · containsand / or / notconstsroles + inheritance
Two engines, one verdict: pydantic in dev, signed WASM in prod, checked at parity.