Skip to content

Add AI Disclosure Documenty#17

Closed
Stuart B. Wilkins (stuwilkins) wants to merge 4 commits into
mainfrom
add_ai_disclosure
Closed

Add AI Disclosure Documenty#17
Stuart B. Wilkins (stuwilkins) wants to merge 4 commits into
mainfrom
add_ai_disclosure

Conversation

@stuwilkins

Copy link
Copy Markdown
Contributor

Add AI Disclosure Banner to the repository and link in README.md

  • FIX: resolve real tool binary to prevent sandbox PATH shadowing
  • ENH: opt-in GH_TOKEN_ passthrough for bwopencode*
  • ENH: add branch-creation restriction to gh-protect-branch
  • docs: add AI_DISCLOSURE.md and link from README

Add resolve_real_tool_binary() to lib/bwrap_sandbox_lib.sh. On managed
hosts the dotfiles wrapper (~/.local/bin/opencode) shadows the real npm
binary on PATH. command -v opencode then resolves to the wrapper; its
directory gets added to SANDBOX_PATH and bind-mounted into the --clearenv
sandbox, where AZURE_*/N2SNSCRIPTS_LIB are stripped and the wrapper fails
with 'cannot locate gpg-passwd.sh' (the double-invocation bug).

Fix: detect dotfiles wrappers by checking whether readlink -f resolves to
a path containing /config/scripts/. If so, substitute the npm-prefix
binary directly. Hard-error if the npm binary is also absent (returning
the wrapper would silently recreate the bug). Non-npm tools (system
packages) are unaffected — the candidate is returned unchanged.

Wire resolve_real_tool_binary into all four wrappers: bwopencode,
bwclaude, bwcodex, bwcopilot.

Assisted-by: opencode:claude-opus-4-8
Assisted-by: opencode:claude-sonnet-4-6
Assisted-by: opencode:gpt-5.6-sol
Add --github-tokens to forward GH_TOKEN_* env vars into the sandbox
so the agent can authenticate gh(1) via per-command token selection.
Off by default; values are printed as REDACTED under --dry-run so tokens
never reach the terminal.

Assisted-by: opencode:claude-opus-4-8
Assisted-by: opencode:claude-sonnet-4-6
Add --restrict-branch-creation and --only-restrict-creation to apply
an additive nsls2-restrict-branch-creation ruleset targeting ~ALL branches,
blocking creation of names outside --exclude-branches (default main,preview;
fnmatch, auto-prefixed refs/heads/). Validate --approvers team via API
before applying (GitHub silently ignores unknown dismissal teams; requires
read:org scope). Guard against empty --exclude-branches patterns. Document
exit codes accurately. Rebased onto current main; conflict resolution
preserved bash>=4 guard from ad7eca9 and pemdecompose row from upstream.

Assisted-by: opencode:claude-opus-4-8
Assisted-by: opencode:claude-sonnet-4-6
Assisted-by: opencode:gpt-5.6-sol
Assisted-by: opencode:claude-sonnet-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant