← Back to Pull requests

feat(agent): オートモードで隔離サンドボックスの shell を自動承認する #1295

Open
unknown opened this pull request with 163 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 15, 2026 01:51 UTC
Author

Closes #1294

背景


オートモードでも shell は承認カードで止まる。誰も押さなければ却下扱いで run が止まり、「続けて」なしで完遂できない(検証ループの S4 が 1,800 秒停止、モンテカルロのスレッドで shell が却下)。human 決定(2026-11-15)で、オートの自動承認に shell を加える。

変更


  • crates/chat/src/autonomous.rs: オートの事前許可に ISOLATED_EXEC = [Shell] を足す。理由をコメントに残す(gVisor の使い捨てサンドボックス内で走り、届くのは run の /workspace と egress 許可先だけ。code_interpreter と同じ境界)

  • - 承認必須モード・システム領域の合成では従来どおり止まる(既存テストを維持)
    - fs_delete / office.live_edit / drive.move はオートでも承認維持
  • テスト auto_allows_versioned_writes_but_keeps_irreversible_gated を更新

  • UI のモード説明(approval-mode-select.tsx)と chat-api.ts のコメント

  • docs/design.md の 3 モードの記述(human 承認済みの方針変更に合わせる)
  • 検証


  • cargo fmt --all --check ✅

  • cargo clippy -p shiki-chat --all-targets --all-features -- -D warnings ✅

  • cargo nextest run -p shiki-chat -E 'test(/autonomous|gate/)' 23 passed ✅

  • cargo nextest run -p shiki-gui --test first_party_skills 4 passed ✅

  • Web は文言 1 行の変更のみ(ビルドは CI で確認)
  • 🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    新機能
    オートモードで、隔離サンドボックス内のシェル実行が自動承認されるようになりました。
    * ファイル削除や移動など、不可逆または影響の大きい操作には引き続き承認が必要です。

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 163 lines (+122 / -41) across 2 files Reviewer: coderabbitai[bot] Review duration: 8m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.40) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 163 lines diff across 2 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.305
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #1295"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.0% (MEDIUM) · Higher = larger blast radius
    40.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.8% · Safe to merge
    22.8%