How policies work
A credential policy is a list of rules. The runtime evaluates each rule against the incoming request. If a matchingDENY rule exists, the runtime blocks the request regardless of any ALLOW rules. If no rule matches, the runtime denies the request by default.
decision and one or more conditions. When a rule omits a condition field, that field matches unconditionally.
Rule fields
Operations field
Theoperations field specifies which operations a rule applies to. The runtime matches each entry against the incoming operation name.
Values support glob-style wildcard patterns using fnmatch syntax:
Patterns are case-sensitive. A
null operation never matches any pattern, including *.
Exact names
To allow a specific set of operations, list them by name:Wildcard patterns
To target a group of related operations, use a pattern. This example allows allissues_ and pulls_ operations without listing each one individually:
* matches every operation:
Wildcards follow Python’s
fnmatch case-sensitive matching. The pattern get_* matches get_issue and get_pull but not Get_issue.DENY and ALLOW precedence
DENY rules take precedence over ALLOW rules. If any rule with DENY matches an operation, the runtime blocks the request even when a separate ALLOW rule also matches.
To block specific operations while permitting everything else, add a targeted DENY rule alongside a catch-all ALLOW:
DENY rules. To block all deletion-style operations by pattern: