TGViewer
Алексей Гладких: Разработка Через Тупость Алексей Гладких: Разработка Через Тупость @gaxeliy_tdd · 1.03K subscribers
Post #1126 178
Раньше я давал более минималистичный конфиг для OpenCode, чтобы он спрашивал всё по поводу и без.
Но, если что, сейчас у меня конфиг вот такой:
"permissions": [  
{ "action": "read", "resource": "*", "effect": "allow" },
{ "action": "read", "resource": "*.env", "effect": "deny" },
{ "action": "glob", "resource": "*", "effect": "allow" },
{ "action": "grep", "resource": "*", "effect": "allow" },
{ "action": "webfetch", "resource": "*", "effect": "allow" },
{ "action": "websearch", "resource": "*", "effect": "allow" },
{ "action": "question", "resource": "*", "effect": "allow" },
{ "action": "skill", "resource": "*", "effect": "allow" },
{ "action": "subagent", "resource": "*", "effect": "allow" },

{ "action": "shell", "resource": "*", "effect": "ask" },

{ "action": "shell", "resource": "git status *", "effect": "allow" },
{ "action": "shell", "resource": "git diff *", "effect": "allow" },
{ "action": "shell", "resource": "git log *", "effect": "allow" },
{ "action": "shell", "resource": "git show *", "effect": "allow" },
{ "action": "shell", "resource": "git blame *", "effect": "allow" },
{ "action": "shell", "resource": "git branch *", "effect": "allow" },
{ "action": "shell", "resource": "git ls-files *", "effect": "allow" },

{ "action": "shell", "resource": "git branch -d *", "effect": "ask" },
{ "action": "shell", "resource": "git branch -D *", "effect": "ask" },
{ "action": "shell", "resource": "git branch -m *", "effect": "ask" },
{ "action": "shell", "resource": "git branch -M *", "effect": "ask" },
{ "action": "shell", "resource": "git branch -f *", "effect": "ask" },
{ "action": "shell", "resource": "git branch --delete *", "effect": "ask" },
{ "action": "shell", "resource": "git branch --move *", "effect": "ask" },
{ "action": "shell", "resource": "git diff --output*", "effect": "ask" },
{ "action": "shell", "resource": "git diff -o *", "effect": "ask" },

{ "action": "shell", "resource": "ls *", "effect": "allow" },
{ "action": "shell", "resource": "pwd", "effect": "allow" },
{ "action": "shell", "resource": "which *", "effect": "allow" },
{ "action": "shell", "resource": "df *", "effect": "allow" },
{ "action": "shell", "resource": "du *", "effect": "allow" },
{ "action": "shell", "resource": "file *", "effect": "allow" },

{ "action": "shell", "resource": "rg *", "effect": "allow" },
{ "action": "shell", "resource": "grep *", "effect": "allow" },

{ "action": "shell", "resource": "* --version", "effect": "allow" },

{ "action": "shell", "resource": "git reset --hard *", "effect": "deny" },
{ "action": "shell", "resource": "git clean *", "effect": "deny" },
{ "action": "shell", "resource": "rm -rf /*", "effect": "deny" },
{ "action": "shell", "resource": "rm -rf ~*", "effect": "deny" },
{ "action": "shell", "resource": "sudo *", "effect": "deny" },
{ "action": "shell", "resource": "git push -f*", "effect": "deny" },
{ "action": "shell", "resource": "git push --force*", "effect": "deny" },
{ "action": "shell", "resource": "mkfs*", "effect": "deny" },
{ "action": "shell", "resource": "fdisk *", "effect": "deny" },
{ "action": "shell", "resource": "parted *", "effect": "deny" },
{ "action": "shell", "resource": "shred *", "effect": "deny" },
{ "action": "shell", "resource": "wipefs *", "effect": "deny" },
{ "action": "shell", "resource": "reboot *", "effect": "deny" },
{ "action": "shell", "resource": "shutdown *", "effect": "deny" },
{ "action": "shell", "resource": "poweroff *", "effect": "deny" },

{ "action": "edit", "resource": "*", "effect": "ask" }
]

Точнее та его часть, которая - permissions (там у меня еще провайдеры подключены).
И еще, это конфиг для opencode2. Я не знаю, прочитает ли его первый. Но может кому-то пригодится.
Всё, что я бы и в пьяном бреду LLM-ке не доверил - deny, всё что безопасно и не влечет последствий - allow (пускай гоняет git diff, мне пофиг). Остальное - ask. Логично же?
  • 🔥 6
More from @gaxeliy_tdd
  1. Sep 20, 2026Вечерочка, коллеги. Я думаю, что мы живём в эпоху, когда теории заговора звучат правдоподо…
  2. Sep 18, 2026Ребят, если надо что-то разрулить с западными IT-шниками - вы пишите, если что. Что там на…
  3. Sep 18, 202613 часов назад я попросил Dax-а добавить в OpenCode Go более высокий тариф. Час назад он с…
  4. Sep 18, 2026Сварганил плагин для neovim, делающий то-же, что делал мой недавний плагин для Sublime. Мо…
  5. Sep 18, 2026Утречка! У меня к вам просьба. Сходите на этих выходных на выборы и проголосуйте. Стой-сто…
  6. Sep 17, 2026Так, ну если плотно кодить GLM-5.3 Flash в OpenCode Go, то такими темпами лимитов на месяц…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →