Answer: Add ordered rules to opencode.jsonc: a broad rule with action "shell", resource "*", effect "ask"; then allow rules for "git status *" and "git diff *"; and a deny rule for "git push *". The last matching rule wins, so the specific exceptions follow the broad rule. Status: Overdue (check was due 2026-11-20T13:37:06Z and has not succeeded) Entry: tool/opencode/permissions-and-security/configure-shell-permission-rules Revision: 1 Digest: sha256:08f7ec835bbb2d61 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:57:56Z Last changed: 2026-11-13T03:57:56Z Last verified: 2026-11-19T13:37:06Z Next check: 2026-11-20T13:37:06Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of broad ask rule | ask | [1] | 2026-11-19 git status rule | git status * | [1] | 2026-11-19 git push rule | git push * | [1] | 2026-11-19 rule precedence | The last matching rule wins | [1] | 2026-11-19 config file | opencode.jsonc | [1] | 2026-11-19 Sources: [1] opencode. "Permissions | OpenCode". https://opencode.ai/docs/permissions/ Role: primary. Accessed: 2026-11-19T13:37:06Z Quote: ""action" : "shell" , "resource" : "*" , "effect" : "ask"" (Supports: broad ask rule) Quote: ""action" : "shell" , "resource" : "git status *" , "effect" : "allow"" (Supports: git status rule) Quote: ""action" : "shell" , "resource" : "git push *" , "effect" : "deny"" (Supports: git push rule) Quote: "The last matching rule wins, so the specific exceptions follow the broad rule." (Supports: rule precedence) Quote: "Add these ordered rules to opencode.jsonc" (Supports: config file) Snapshot SHA-256: 6cd16881502e23535ca5323e174231f101370e0080b33e5df664019d82281482 (captured 2026-11-13T13:31:07Z) 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:57:56Z, so the values verified then were kept. Cross-check: not-available at 2026-11-19T13:37:06Z. No independent second source is configured for this entry Last successful check: 2026-11-19T13:37:06Z Last attempt: 2026-11-19T13:37:06Z Notes and limitations: Extracted automatically from a single official source (section "Configure"). Related: https://latestn.com/tool/opencode/permissions-and-security/console-model-list-authentication How do I authenticate a request to the opencode Console model list API? https://latestn.com/tool/opencode/permissions-and-security/default-agent-permissions How do I set default permissions for opencode agents? https://latestn.com/tool/opencode/permissions-and-security/deny-provider-with-policy How do I deny a provider in opencode using policies? https://latestn.com/tool/opencode/models/switch-models-in-session How do I switch models in a Hermes session with OpenCode? https://latestn.com/tool/opencode/models/use-go-models-with-codex How do I use opencode Go models with Codex? https://latestn.com/tool/opencode/permissions-and-security/authenticate-console-api How do I authenticate requests to the opencode Console API? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:57:56Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/permissions-and-security/configure-shell-permission-rules/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/configure-shell-permission-rules POST: https://latestn.com/dispute/tool/opencode/permissions-and-security/configure-shell-permission-rules with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/permissions-and-security/configure-shell-permission-rules?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I configure opencode permissions to ask before shell commands but allow git status and block git push? Revision 1, last verified 2026-11-19T13:37:06Z. https://latestn.com/tool/opencode/permissions-and-security/configure-shell-permission-rules (accessed 2026-11-21T09:58:00Z). @misc{LatestN_tool_opencode_permissions_and_security_configure_shell_permission_rules_r1, title = {How do I configure opencode permissions to ask before shell commands but allow git status and block git push?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/permissions-and-security/configure-shell-permission-rules}}, note = {Revision 1; digest sha256:08f7ec835bbb2d61; last verified 2026-11-19T13:37:06Z; accessed 2026-11-21T09:58:00Z} } 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/configure-shell-permission-rules