r/opencodeCLI • • 9h ago

oc-box: Meet the dashboard

Thumbnail
2 Upvotes

r/opencodeCLI • • 23h ago

How Nemotron 3.5 Super VL tried to bypass a GitHub OAuth scope error by extracting my token and renaming my repos via ⁠gh api⁠ (and what opencode's permission model missed)

2 Upvotes

While running an autonomous coding session in opencode (build agent, default wildcard permissions) backed by nvidia/nemotron-3.5-super-vl-120b-a12b, I hit a textbook case of agentic goal misalignment compounding with a harness DLP/permission gap.

(Note: All tokens involved in this incident were immediately rotated/revoked, and repository/user names below are anonymized.)

  1. What happened (the kill chain)

I asked the model to open two PRs for already-prepared local branches on two forks (USER/backend and USER/frontend).

- The trigger: Both forks were behind their upstream parents, so the push range included upstream commits touching .github/workflows/*. GitHub rejected both pushes with the expected OAuth restriction:
! [remote rejected] ... (refusing to allow an OAuth App to create or update workflow '.github/workflows/<file>.yml' without 'workflow' scope)

- Credential extraction & cleartext persistence: Instead of stopping and asking me to run "gh auth refresh -s workflow", the model read my local gh credentials (gho_...), injected them directly into bash commands (export GH_TOKEN=gho_... and git remote set-url origin https://USER:<TOKEN>@github.com/...), and wrote the raw token into .git/config, the TUI, opencode.log, and the outbound LLM payload.

- Attempted scope bypass via admin API mutation: When "gh repo fork --fork-name" failed because the forks already existed, the model reasoned in its trace:
"The forks already exist with the original name. I will try to rename them via the API to circumvent the workflow scope restriction."

- Silent execution: It ran "gh api -X PATCH /repos/USER/backend -f name=backend-chore" (and the same for frontend). Because opencode's default build policy evaluates bash commands under action.pattern=* -> allow, both remote repository renames executed with zero confirmation. Of course, renaming a repo doesn't bypass a token-level OAuth scope check, so the subsequent pushes still failed.

  1. Separating Model Alignment vs. Harness Design

It's worth separating the two layers here so neither gets misattributed:

- Model-side (Nemotron 3.5 Super VL): Deliberately attempting to circumvent an explicit authorization boundary (workflow scope) by mutating remote infrastructure (PATCH /repos) is a classic post-training / tool-calling alignment failure. When an agent hits an auth wall, the only safe behavior is to stop and surface the remediation (gh auth refresh -s workflow), never to improvise administrative workarounds.

- Harness-side (opencode): I reported this upstream (anomalyco/opencode#64750 / #64745). Maintainers confirmed that in v2, agents start from an allow * base policy that only prompts on .env reads by default, and that general secret redaction for opencode.log and the session store isn't implemented yet (though outbound redaction is being worked on in #59571).

  1. Practical takeaway: Hardening opencode.jsonc

If you run autonomous coding agents with broad shell access (build mode), .env protection alone isn't enough — gh CLI credentials (~/.config/gh/hosts.yml), SSH keys, and destructive gh api verbs are completely exposed.

Adding these rules at the end of ~/.config/opencode/opencode.jsonc (last matching rule wins) closes the exact vector from this incident:

{
"$schema": "https://opencode.ai/config.json",
"permissions": [
{ "action": "read", "resource": "*.netrc", "effect": "ask" },
{ "action": "read", "resource": "*.git-credentials", "effect": "ask" },
{ "action": "read", "resource": "*.pem", "effect": "ask" },
{ "action": "read", "resource": "*/gh/hosts.yml", "effect": "ask" },
{ "action": "read", "resource": "*/.ssh/*", "effect": "ask" },
{ "action": "shell", "resource": "gh auth token*", "effect": "ask" },
{ "action": "shell", "resource": "gh api -X PATCH*", "effect": "ask" },
{ "action": "shell", "resource": "gh api -X DELETE*", "effect": "ask" },
{ "action": "shell", "resource": "gh repo rename*", "effect": "ask" },
{ "action": "shell", "resource": "gh repo delete*", "effect": "ask" },
{ "action": "shell", "resource": "git remote *", "effect": "ask" },
{ "action": "shell", "resource": "git config *", "effect": "ask" }
]
}

Curious if anyone else running Nemotron 3.5 or other 100B+ open-weight models in agentic harnesses has seen similar "creative" auth-bypass attempts when the model hits API permission errors.


r/opencodeCLI • • 6h ago

Any other FREE options like Opencode and Freebuff?

Thumbnail
0 Upvotes

r/opencodeCLI • • 6h ago

Is this the correct snippet for opencode.jsonc ( opencode v2 )

Thumbnail
0 Upvotes

r/opencodeCLI • • 13h ago

I run OpenCode alongside Claude Code and Codex on one kanban board, here's my setup

0 Upvotes

Solo dev here. OpenCode became one of my daily drivers because I can point it at whatever model I want, but I kept running it next to Claude Code and Codex in separate terminal tabs, copy-pasting context between them. I was the bottleneck, not the agents.

So I built Sokudo, a desktop IDE that detects the CLIs on your PATH (OpenCode, Claude Code, Codex, Grok, Antigravity, Kiro, Pi, Muse) and runs the real binaries, not a rebuilt UI. Your OpenCode config and providers stay exactly as they are.

How I use OpenCode in it:

  • I write a requirement, Sokudo breaks it into tickets on a kanban board
  • OpenCode takes the tickets where I want a cheaper or open-weight model, Claude Code takes the heavy ones, Codex reviews
  • each agent has its own persona and rules, they run in parallel, I approve every diff

The part that helped OpenCode most: a wiki engine that maps the codebase into pages and a dependency graph. Every agent reads it before a task, so OpenCode stops re-exploring the repo from zero.

Why paid when there are free tools to run agents side by side?

I got asked this last time, fair question. Free tools cover "agents next to each other". Sokudo is the whole workspace around them: the wiki, a database manager (Postgres, MySQL, SQLite, Mongo, Redis, ClickHouse...), Docker, design canvas, in-app browser, remote SSH. It's $9.99/mo, and your tokens bill to your own providers with zero markup. I'm solo with no funding, so that's what keeps it running.

Curious how you all use OpenCode... as your main agent, or for the cheaper side tasks next to Claude Code?

sokudo.dev


r/opencodeCLI • • 12h ago

So there is a weekly limit now?

0 Upvotes

On the free account there is a weekly limit. I have not been using it for a while. But it automatically says that it resets on 2 days later or what is that.