Repository navigation
fix(agent): ask before a path outside the sandbox in auto mode - #366
Conversation
Auto-mode runs started the CLI without --require-approval, so no approval broker was attached and every path outside the sandbox failed outright. The broker is now attached in both modes. Auto mode still approves tool calls automatically, except SandboxAccess, which the user decides. Computer-use actions gated by INFER_COMPUTER_USE_APPROVAL in a run started in auto mode are now auto-approved instead of blocked, matching runs switched to auto mode mid-way.
|
@infer CI is failing, can you fix this? make this PR ready for a review. |
|
Model: Todos
Pull Request✅ Infer Result: SuccessCI is green again and the PR is ready for review. Here is what happened: DiagnosisThe failing Verdict: a one-off flake, not this PR. Evidence:
Fix applied
Follow-up worth considering: if Model: Tokens: 3,661,011 in · 30,059 out · 3,691,070 total (34 requests) Tool calls: 47 total · 100% success rate TracesStatsTriggered by edenreich · Infer Action · OSS |
|
🎉 This PR is included in version 0.51.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
In auto mode, a tool call on a path outside the sandbox failed with "outside configured sandbox directories" and the user was never asked. The desktop started auto-mode runs without
--require-approval, so the CLI had no approval broker and treated nobody as able to answer. Now the user decides, in either mode.Depends on inference-gateway/cli#1388 for symlinked paths. Plain outside paths already work with any CLI that has the sandbox approval flow.
Changes
apply_approval_modepasses--require-approvalin both modes. Auto mode still setsINFER_SUBAGENT_AGENT_MODE=auto, and the CLI skips per-tool approval in auto mode before it consults the broker. So the flag only opens the sandbox prompt (plus the per-call approvers below).SandboxAccess(autoApprovesinlib/transcript.ts), so the existing Approve / Always allow / Deny card shows up.INFER_COMPUTER_USE_APPROVAL=destructivegates, in a run started in auto mode, used to be blocked because no broker was attached. They are now auto-approved, which is what already happened for runs switched to auto mode partway through.Verified end to end against the CLI with the mock gateway (
--format ag-ui --require-approval, auto mode, sandbox limited to the working directory):SandboxAccessrequest reads the file.