github-outside-sandbox

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GitHub Outside Sandbox

GitHub 沙箱外执行指南

  1. Start normally. Escalate only the blocked command and only within the user's authorization.
  2. If sandboxed
    gh auth status
    fails, rerun it outside the sandbox before claiming authentication is broken. Never expose or copy tokens.
  3. Run GitHub CLI network operations outside the sandbox when required:
    gh repo ...
    ,
    gh pr ...
    , and related
    gh
    commands.
  4. Run Git writes outside the sandbox when
    .git
    is outside writable roots or errors mention
    index.lock
    or
    Operation not permitted
    :
    git add
    ,
    git commit
    , and
    git push
    .
  5. Use the harness's official host-execution mechanism. In Codex, set
    sandbox_permissions: "require_escalated"
    , give a concrete
    justification
    , and use only a narrow safe
    prefix_rule
    when appropriate.
  6. Never use shell wrappers, credential copying, or broad approval prefixes to bypass the sandbox.
  7. Verify from the host context with
    git status -sb
    ,
    git remote -v
    , and the relevant
    gh ... view
    command. Ask the user to authenticate only if the host-context check also fails.
  1. 正常启动流程。仅在用户授权范围内,对被阻止的命令进行权限提升。
  2. 如果沙箱内执行
    gh auth status
    失败,需先在沙箱外重新运行该命令,再判定认证是否失效。严禁暴露或复制令牌。
  3. 当需要时,在沙箱外执行GitHub CLI网络操作:
    gh repo ...
    gh pr ...
    及相关
    gh
    命令。
  4. .git
    目录位于可写根目录之外,或错误提示包含
    index.lock
    或“Operation not permitted”时,在沙箱外执行Git写入操作:
    git add
    git commit
    git push
  5. 使用测试工具的官方主机执行机制。在Codex中,设置
    sandbox_permissions: "require_escalated"
    ,提供具体的
    justification
    ,并在合适时仅使用范围狭窄的安全
    prefix_rule
  6. 严禁使用Shell包装器、凭据复制或宽泛的批准前缀来绕过沙箱。
  7. 通过主机上下文使用
    git status -sb
    git remote -v
    及相关
    gh ... view
    命令进行验证。仅当主机上下文检查也失败时,才要求用户进行认证。