Answer: Policies match resources using the same whole-value wildcards as permissions: * matches zero or more characters and ? matches one. A pattern ending in * also matches the value without arguments, so shell:git push * covers git push on its own. Status: Overdue (check was due 2026-11-20T13:37:13Z and has not succeeded) Entry: tool/opencode/permissions-and-security/policy-matching-and-order Revision: 1 Digest: sha256:8ad61d1cc08c0ea9 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:58:01Z Last changed: 2026-11-13T03:58:01Z Last verified: 2026-11-19T13:37:13Z Next check: 2026-11-20T13:37:13Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of wildcard for zero or more characters | * | [1] | 2026-11-19 wildcard for one character | ? | [1] | 2026-11-19 example pattern | company-* | [1] | 2026-11-19 example matched values | company-us and company-eu | [1] | 2026-11-19 trailing wildcard behavior | shell:git push * | [1] | 2026-11-19 Sources: [1] opencode. "Policies | OpenCode". https://opencode.ai/docs/policies/ Role: primary. Accessed: 2026-11-19T13:37:13Z Quote: "Matching Resources use the same whole-value wildcards as permissions: * matches zero or more characters and ? matches one." (Supports: wildcard for zero or more characters) Quote: "* matches zero or more characters and ? matches one." (Supports: wildcard for one character) Quote: ""resource" : "company-*"" (Supports: example pattern) Quote: "This denies company-us and company-eu ." (Supports: example matched values) Quote: "A pattern ending in * also matches the value without arguments, so shell:git push * covers git push on its own." (Supports: trailing wildcard behavior) Snapshot SHA-256: 10daccd13493aca93e51252a533c9575eaa3d44fd7f9411e720da3fda8f96e00 (captured 2026-11-13T03:58:00Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:58:01Z, so the values verified then were kept. Cross-check: not-available at 2026-11-19T13:37:13Z. No independent second source is configured for this entry Last successful check: 2026-11-19T13:37:13Z Last attempt: 2026-11-19T13:37:13Z Notes and limitations: Extracted automatically from a single official source (section "Matching"). Related: https://latestn.com/tool/opencode/permissions-and-security/providers-api-authentication How do I authenticate requests to the opencode Console Providers API? https://latestn.com/tool/opencode/permissions-and-security/restricted-key-limitations What are the limitations of restricted API keys in opencode? https://latestn.com/tool/opencode/permissions-and-security/revoke-api-key How do I revoke an opencode API key? https://latestn.com/tool/opencode/permissions-and-security/permission-actions-and-effects What permission actions and effects does opencode support, such as allow, ask, and deny? https://latestn.com/tool/opencode/permissions-and-security/permission-rule-matching-order How does opencode decide which permission rule applies when multiple rules match? https://latestn.com/tool/opencode/permissions-and-security/policies-vs-permissions How do opencode policies differ from permissions? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:58:01Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/permissions-and-security/policy-matching-and-order/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/opencode/permissions-and-security/policy-matching-and-order POST: https://latestn.com/dispute/tool/opencode/permissions-and-security/policy-matching-and-order with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/permissions-and-security/policy-matching-and-order?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do opencode policies match resources and in what order are they evaluated? Revision 1, last verified 2026-11-19T13:37:13Z. https://latestn.com/tool/opencode/permissions-and-security/policy-matching-and-order (accessed 2026-11-21T10:02:57Z). @misc{LatestN_tool_opencode_permissions_and_security_policy_matching_and_order_r1, title = {How do opencode policies match resources and in what order are they evaluated?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/permissions-and-security/policy-matching-and-order}}, note = {Revision 1; digest sha256:8ad61d1cc08c0ea9; last verified 2026-11-19T13:37:13Z; accessed 2026-11-21T10:02:57Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/opencode/permissions-and-security/policy-matching-and-order