Skip to content

Guardian asks child agents before PR feedback upkeep #2438

Closed

Description

@sentry-junior

When Junior hands PR review feedback to a child agent, Guardian returns ask for the child's github_updatePullRequestFeedback (:+1:) and github_resolvePullRequestReviewThread calls. The child reports the action as blocked, and the parent then asks the user to confirm in Slack. When the root run does the same work itself, Guardian allows these calls.

  • Cause: CHILD_AGENT_RULES (packages/junior/src/chat/guardian/reviewer.ts) accept authorization only from root user: and automation: lines. The GitHub event that starts the work is an event: line, and the parent task text is not user intent. So the upkeep exception in policy.ts (marking or resolving feedback on a resource that the agent made) does not apply.
  • Parent turns too: when a child result starts a parent turn, action review uses the child result as the user intent (currentUserIntent in packages/junior/src/chat/agent/index.ts). That turn also logs ask or deny for these tools.
  • Evidence: Sentry sentry/junior spans show 9 ask/deny decisions for these two tools between Oct 28 and Oct 30, all in agent:* conversations. Root runs that do this work log allow.
  • When it started: feat(agents): Claude Code-style child agents with implicit delegation and agent types #2265 (Oct 28) began delegating to child agents implicitly. The child rules come from fix(agents): Never take parent agent text as user approval in a child #2147.
  • Coverage gap: no Guardian eval covers feedback upkeep by a child agent, or by a parent after a child result.

Proposed in discussion (two options):

  1. Parent does the upkeep (preferred). The child fixes the code and lists the comments it addressed. The parent adds 👍 and resolves. This needs a thread rule that treats this upkeep as allowed in a turn that a child result started. The child agent rules stay strict.
  2. Child does the upkeep. Treat 👍/resolve on feedback that the delegated work addressed, on a PR that Junior made, as upkeep in CHILD_AGENT_RULES. Keep it narrow, because the child rules block prompt injection from parent task text.

Related: #2258

via @szokeasaurusrex.

--

View Session [Sentry]

Activity

  1. dcramer commented on Oct 30, 2026

    @dcramer
    Member

    in general, we need tools to be allowed-by-default for junior when junior is acted on behalf of its own work units (e.g. if it created the pr)

  2. sentry-junior commented on Oct 30, 2026

    @sentry-junior
    ContributorAuthor

    More cases from Oct 30, all upkeep on #2435, a PR that Junior opened. A child agent ran each one:

    • 17:07 UTC: a +1 on 3 Bugbot comments and a resolve on their 3 threads. All 6 returned ask with authorization unknown. The reason: "changes review feedback status, which the user did not request."
    • 17:09 and 17:17 UTC: replacing the PR title and body. Both returned ask.

    The rule that allows upkeep on the agent's own PR needs evidence that the agent made it. The existing Guardian evals pass because the child's own github_createPullRequest result is in its evidence. Here, #2435 was opened outside that child's history. So Guardian had no evidence that Junior owned the PR, and it treated routine upkeep as an unrequested write.

    Lead: the GitHub create tools already write a conversation annotation for the object they create (githubObjectAnnotation). That could be a trusted record that Junior created the resource.

    The separate problem, where a later approval did not clear an earlier block, is #2450, with a fix in #2451.

  3. added a commit that references this issue on Nov 1, 2026
    218085e
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