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:
Resource constraints
Rules can constrain which resources an operation may touch, not just which operations are allowed. The runtime extracts resource identifiers from each outbound request — the repository from a GitHub API path, the channel from a Slack payload, the hostname from an HTTP request — and matches them against the rule before the request leaves Guild.methods to separate read access from mutating access. A rule that allows only GET grants read-only access regardless of which operations it matches.
Scoping rules to agents and workspaces
Each rule can be scoped to specific agents, specific workspaces, or both. A rule without scoping applies to every agent and workspace that uses the credential. Scoped rules let you give one agent read-only access to one repository while another agent gets write access to a different one, all on the same connected credential. Configure scoping when creating or editing a policy in the UI, or pass--agents and --workspaces to the CLI:
Enforcement
Policies are enforced inside Guild’s credential proxy, before any request reaches the external service. Agents never evaluate policy themselves and cannot bypass it: the credential is injected server-side only after the policy check passes. If no rule allows a request, it is denied by default, and a matchingDENY rule always wins over any ALLOW.
See Credentials for how server-side credential injection works.