-
Notifications
You must be signed in to change notification settings - Fork 7
feat(opencode): add secure permissions config to block dangerous commands #334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
c2112c4
02b7042
8c33d5d
590c8a2
7af057a
70102e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,139 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "$schema": "https://opencode.ai/config.json", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "disabled_providers": ["opencode"] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "disabled_providers": ["opencode"], | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "permissions": { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "deny": { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "bash": [ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "rm -rf /", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "rm -rf /*", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "rm -rf ~", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "rm -rf ~/*", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "rm -rf .", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "rm -rf *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "rmdir *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "sudo rm *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "sudo rmdir *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "sudo *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "su *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "chmod -R 777 *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "chmod 777 *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "chown *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "chgrp *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "kill *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "killall *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pkill *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "shutdown *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "reboot *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "halt *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "poweroff *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "dd *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "mkfs *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fdisk *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "parted *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "diskutil eraseDisk *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "diskutil partitionDisk *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "curl * | sh", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "curl * | bash", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "wget * | sh", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "wget * | bash", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "eval *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "git push --force *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "git push -f *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "git push origin --force *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "git push origin -f *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "git reset --hard *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "git clean -fd *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "git clean -f *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "git checkout -- .", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "git branch -D *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker rm -f *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker rmi -f *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker system prune *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker volume rm *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker volume prune *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker network rm *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker network prune *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker container prune *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker image prune *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker compose down -v *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker compose rm *", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker stop $(docker ps *)", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker rm $(docker ps *)", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "docker stop $(docker ps *)", | |
| "docker rm $(docker ps *)", | |
| "docker stop $(docker ps -q*)", | |
| "docker rm $(docker ps -aq*)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude are you sure that this is a working syntax ?
Reading the doc here: https://opencode.ai/docs/permissions/ i see a different structure, i think that it's quite smart the usage of regexp too, that we are totally missing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude finished @paolomainardi's task in 9m 46s —— View job
OpenCode Permissions Syntax: You're Right, It Needs Regex
- Read current
config/macos/opencode.jsonin the PR - Research OpenCode permissions documentation
- Compare syntax and determine if current config is valid
- Rewrite patterns using proper regex syntax and push fix
Findings
Good catch, @paolomainardi! You're absolutely right — the previous patterns were using glob-style syntax (sudo *, curl * | sh) but OpenCode's permissions system interprets these as regular expressions. This meant many patterns were either broken or dangerously wrong:
| Problem | Example | What Happened |
|---|---|---|
* is a regex quantifier, not a wildcard |
sudo * |
Matched sudo + zero or more spaces, NOT sudo rm -rf / |
| is alternation in regex |
curl * | sh |
Matched anything containing "sh" anywhere (way too broad!) |
$() are regex metacharacters |
docker stop $(docker ps *) |
Completely broken as regex |
What I Fixed (commit 02b7042)
Rewrote all 129 glob patterns into 97 proper regex patterns with the same coverage:
// Before (broken glob):
"sudo *"
"curl * | sh"
"docker stop $(docker ps *)"
// After (working regex):
"^sudo\\b"
"curl\\s+.*\\|\\s*(sh|bash)"
"docker\\s+stop\\s+\\$\\("Key regex improvements:
\bword boundaries for precise matching\s+for flexible whitespace matching- Escaped metacharacters (
$,(,),|,.,*) ^anchors where commands must start at beginning- Alternation groups to consolidate related patterns (e.g.,
helm\s+(install|upgrade|uninstall|delete|rollback)\b)
Also fixed the misleading "Zen provider" wording in Ansible task names (Copilot review comment).
⚠️ Important Caveat
I was unable to directly fetch the live documentation at https://opencode.ai/docs/permissions/ from this CI environment. The regex rewrite is based on my knowledge of OpenCode's codebase. Please verify against the live docs to confirm the exact schema and pattern matching behavior before merging.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude try again, now you should have access to the doc and you can do websearches too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude finished @paolomainardi's task in 3m 22s —— View job
OpenCode Permissions: Complete Rewrite Using Official Docs
- Fetch OpenCode permissions documentation
- Read current
config/macos/opencode.jsonin the PR - Compare syntax against official docs and identify issues
- Rewrite config with correct syntax and push changes
Findings from Official OpenCode Docs
The previous config (both the initial glob version AND my regex rewrite) had three critical issues:
| Issue | What We Had | What OpenCode Expects |
|---|---|---|
| Wrong key name | "permissions" (plural) |
"permission" (singular) |
| Wrong structure | { "deny": { "bash": ["pattern", ...] } } |
{ "bash": { "pattern": "action" } } |
| Wrong pattern syntax | Regex (\\s+, \\b, ^) |
Glob wildcards (* = any chars) |
How OpenCode Permissions Actually Work
Per the docs:
{
"permission": {
"bash": {
"*": "ask", // catch-all: prompt for unknown commands
"git *": "allow", // allow all git commands
"rm *": "deny" // deny all rm commands
}
}
}Key rules:
- Patterns use simple glob wildcards (
*= zero or more chars), NOT regex - Last matching rule wins (order matters!)
- Three actions:
"allow","ask"(prompt user),"deny"(block entirely)
What Changed (commit 590c8a2)
Completely rewrote the config to match the official schema:
{
"$schema": "https://opencode.ai/config.json",
"disabled_providers": ["opencode"],
"permission": {
"bash": {
"*": "allow",
"rm -rf /*": "deny",
"sudo *": "ask",
"terraform destroy*": "deny",
"kubectl delete*": "ask",
...
}
}
}Design decisions on deny vs ask:
"deny"(hard block) for truly destructive/irreversible commands:rm -rf /,terraform destroy,shutdown,dd, cloud resource deletion, etc."ask"(prompt user) for commands that are potentially dangerous but often legitimate:kubectl apply,docker prune,sudo,ssh, etc."allow"as the base default ("*": "allow") since most commands are safe
Sources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude can you add some other heuristics on gcloud commands or just get in deep in this topic to understand what can be too risky ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude encountered an error —— View job
Deep Dive: Dangerous gcloud Commands & Cloud CLI Heuristics
- Read current
config/macos/opencode.jsonfrom the PR branch - Research dangerous gcloud CLI commands (destructive, irreversible, costly)
- Research other cloud CLI tools (aws, az) for additional dangerous patterns
- Update config with comprehensive gcloud and cloud CLI deny/ask rules
- Commit and push changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude try again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude finished @paolomainardi's task in 9m 38s —— View job
Deep Dive: Dangerous gcloud Commands & Cloud CLI Heuristics
- Read current
config/macos/opencode.jsonfrom the PR branch - Research dangerous gcloud CLI commands (destructive, irreversible, costly)
- Research other cloud CLI tools (aws, az) for additional dangerous patterns
- Update config with comprehensive gcloud and cloud CLI deny/ask rules
- Commit and push changes
What changed (commit 7af057a)
Expanded OpenCode permissions from ~100 → 293 patterns with comprehensive cloud CLI coverage across all three major providers.
gcloud (58 new patterns)
| Category | deny (hard block) | ask (prompt) |
|---|---|---|
| Project/Org destruction | gcloud projects delete*, gcloud organizations set-iam-policy*, gcloud projects set-iam-policy* |
— |
| KMS key destruction | gcloud kms keys versions destroy* |
gcloud kms keys versions disable* |
| Data stores | gcloud spanner instances delete*, gcloud spanner databases delete*, gcloud firestore databases delete*, gcloud sql instances delete* |
gcloud sql databases delete*, gcloud sql backups delete* |
| Storage | gcloud storage rm --recursive*, gcloud storage buckets delete* |
gcloud storage rm* |
| Compute Engine | — | instances, disks, images, snapshots, instance-groups, instance-templates, addresses (7 patterns) |
| Networking/VPC | — | firewalls, networks, subnets, peerings, routers, routes, VPN tunnels/gateways, interconnects, forwarding rules, target pools, backend services, URL maps, health checks, SSL certs (14 patterns) |
| GKE | — | gcloud container clusters delete*, gcloud container node-pools delete* |
| IAM/Security | — | service accounts, keys, roles, policy bindings (6 patterns) |
| Serverless | — | Cloud Functions, Cloud Run services/jobs (3 patterns) |
| Messaging | — | Pub/Sub topics, subscriptions, Lite topics/subscriptions (4 patterns) |
| DNS | — | managed zones, record sets (2 patterns) |
| Secrets/AppEngine/etc | — | secrets, secret versions, app services/versions, composer environments, artifact repos, docker images, redis, logging, monitoring (12 patterns) |
| BigQuery | — | bq rm* |
AWS (47 new patterns)
| Category | deny | ask |
|---|---|---|
| Storage | aws s3 rb * --force*, aws s3 rm * --recursive* |
aws s3 sync * --delete* |
| Databases | aws rds delete-db-cluster* |
snapshots, DynamoDB tables/backups (4 patterns) |
| KMS/Search | aws kms schedule-key-deletion*, aws kms disable-key*, aws es delete-elasticsearch-domain*, aws opensearch delete-domain* |
— |
| Compute/EC2 | — | volumes, snapshots, AMIs, security groups, VPC resources, stop-instances (10 patterns) |
| EKS | — | clusters, node groups (2 patterns) |
| IAM | — | users, roles, policies, groups, access keys, inline policies (8 patterns) |
| Lambda | — | functions, layer versions (2 patterns) |
| Messaging | — | SNS topics, SQS queues/purge (3 patterns) |
| Containers | — | ECS clusters/services, ECR repos/images (4 patterns) |
| Other | — | Route53, CloudFront, ElastiCache, Redshift, EFS, Cognito, Kinesis, Secrets Manager (10 patterns) |
Azure (52 new patterns)
| Category | deny | ask |
|---|---|---|
| Critical | az keyvault purge*, az role assignment delete (no args = deletes ALL assignments) |
— |
| Databases | — | SQL, MySQL, PostgreSQL (flexible + classic), Cosmos DB + MongoDB/SQL sub-databases (8 patterns) |
| VMs/AKS | — | VMs, VMSS, AKS clusters/node pools (4 patterns) |
| Storage | — | accounts, containers, blobs, batch-delete, file shares (5 patterns) |
| Key Vault | — | vaults, keys, secrets, certificates (4 patterns) |
| Networking | — | VNets, subnets, NSGs, NSG rules, public IPs, LBs, app gateways, VPN gateways/connections (9 patterns) |
| DNS | — | zones, record sets, private DNS zones (3 patterns) |
| App Services | — | webapps, function apps, app service plans, APIM (4 patterns) |
| Messaging | — | Service Bus namespaces/queues/topics, Event Hubs (4 patterns) |
| Monitoring | — | action groups, Log Analytics workspaces, metric alerts (3 patterns) |
| Other | — | Redis, ACR repos, RBAC roles/assignments, AD apps/service principals, Cognitive Services (8 patterns) |
Design Philosophy
| Action | When used | Examples |
|---|---|---|
deny |
Irreversible, catastrophic operations where there's almost never a valid reason to run from an AI assistant | Project/org deletion, KMS key destruction, rm -rf /, terraform destroy, force-delete with data loss |
ask |
Potentially dangerous but often legitimate operations that need human confirmation | Instance/resource deletion, IAM changes, service account ops, DNS changes |
allow |
Safe, read-only, or standard development operations (the default "*": "allow") |
ls, git status, docker ps, gcloud compute instances list |

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This debug message states “Zen provider disabled”, but the OpenCode config being copied disables the provider named
opencode. To avoid confusing users (and future maintainers), update the message to match the actual provider identifier being disabled in the JSON, or adjust the JSON to disable the intended provider.