Skip to content

Require deterministic user confirmation for tool actions #3320

Done

Description

@sentry-junior

Some tool actions should never run without the user's explicit confirmation, no matter how clearly the request names them. Examples are creating a GitHub repository or other effects that are hard to undo. Junior has no code-enforced way to require this today.

  • Tools declare approvalMode as auto, review, or approve (packages/junior-plugin-api/src/tools.ts). approve skips review. auto and review route the call to Guardian.
  • Guardian rates risk and user authorization, and guardianDecision (packages/junior/src/chat/guardian/reviewer.ts) maps the named rule to allow, ask, or deny. Whether it asks depends on the model's judgment. A clear request usually gets allow.
  • Code forces only two outcomes: an ask turns into a deny in Automation runs, and high or critical risk with low or unknown authorization asks.
  • An ask rejection has no durable link to the user's later answer. A retry goes back through model review, so an earlier ask cannot be checked as a precondition.
  • Tool permissions (approvalMode) and Guardian policy are separate systems. A tool cannot declare "always needs this person's confirmation" in a way core enforces.

Prior art: #3319 first tried a confirm approval mode. It looked up earlier-Turn ask rejections for the exact input and capped the decision at ask without them. That was dropped from the PR because a correct version needs a refactor across Guardian and tool permissions. Known gaps of that attempt: a confirmation in the same Turn, compaction that drops the earlier ask, and child agents with a system Actor.

via @dcramer.

--

View Session [Sentry]

Activity

  1. sentry-junior commented on Nov 13, 2026

    @sentry-junior
    ContributorAuthor

    Direction from the prior-art review of Codex and Claude Code (canvas): add an ask permission that core enforces, following both tools.

    Prior art

    • Codex: a managed prompt-user rule becomes NeedsHumanApproval. Hooks, automated review and reusable approvals can't satisfy it, and it's rejected when no human can answer (core/src/tools/approvals.rs, config/src/requirements_exec_policy.rs).
    • Claude Code: ask rules, requiresUserInteraction tools and connector tools set to ask always prompt, even in auto and bypass mode, and offer no "don't ask again".

    Shape

    • Vocabulary: a tool's permission is allow / review / ask / deny. review sends the call to Guardian, which keeps returning allow / ask / deny.
    • What ask does: the call waits for a person instead of being rejected back to the model. Core stores the exact call (tool, input, credential, destination) and who may approve it, then files the review item itself. A child sends it up to the root, and the approver is still the person.
    • Approval: when the approver says yes, core runs the stored call and sends the result into the conversation. The model doesn't re-issue the call, and nothing a model writes can approve it.
    • No human present: in scheduled and event runs, ask is denied right away.
    • An ask from Guardian follows the same path.

    First tools on ask: deletes that can't be undone, which means deleteAutomation, deleteWorkspace and MCP tools marked destructiveHint, plus github_createRepository (#3319). Actions that can be undone (archive, stop, unpublish) stay on review.

    This also fixes the known gaps of the #3319 attempt: a confirmation in the same Turn, compaction dropping the earlier ask, and child agents with a system Actor.

  2. sentry-junior commented on Nov 23, 2026

    @sentry-junior
    ContributorAuthor

    Closing as superseded by the Guardian redesign: intent in #4139, technical proposal in #4140. This issue's concern is covered there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions