Skip to content

docs(design): Rewrite Guardian intent for the redesign - #4139

Merged
dcramer merged 8 commits into
mainfrom
docs/guardian-design-rewrite
Nov 25, 2026
Merged

dcramer merged 8 commits into
mainfrom
docs/guardian-design-rewrite

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Guardian today asks people to confirm work they already asked for. It loses their request when work moves to a child agent, a Lead, a Watch, or an Automation run. It treats their own GitHub comments as untrusted. And when a review fails, it aborts the whole Run. This PR states the intent that the redesign must meet, so code and evals have a fixed target.

It restates design/guardian.md in the Jobs + named rules + examples shape (#4342, getsentry/junior-prod#779). Every rule and gap gets an ID, and each gap cites the rules it breaks.

The main change in intent: authority comes from the instruction an action serves. Nobody owns a Conversation or a resource. The person's own words and Inbox answers travel with the work, and text from another agent, a tool, or another person is never approval. Also added:

  • Junior files the ask, and a confirmed exact action runs as the person who confirmed it.
  • One ask per Code Mode batch, and no re-ask about a step the person requested.
  • A failed review fails only that action.
  • The person's own linked account speaks for them.

This changes docs only, so no behavior changes. TERMINOLOGY.md ("Trusted author", "Agent message") changes to match. The technical approach is in #4140.

via @dcramer.

--

View Session [Sentry]

State who can authorize, that authority follows the work, that Junior
supplies facts while the model judges risk, that a confirmed action runs
as confirmed, and that review never stops a Run. Record the gaps on main
against that intent.

Co-Authored-By: David Cramer <[email protected]>
@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 25, 2026 11:27pm UTC

Request Review

@blacksmith-sh

This comment has been minimized.

@dcramer

dcramer commented Nov 23, 2026

Copy link
Copy Markdown
Member

Can you give me a list of BDD-style scenarios that we can validate that this behaves as we expect

@dcramer

dcramer commented Nov 23, 2026

Copy link
Copy Markdown
Member
image

example of something that is just engineered the wrong way - it could just be my users instruction vs telephone

@dcramer

dcramer commented Nov 24, 2026

Copy link
Copy Markdown
Member

The note about the parent agent might also be part of our agent teams model where maybe we shouldn't be sending messages as a system actor and actually should send them on behalf of the user identity, but I'm not 100% sure there yet

@thomasjiangcy

Copy link
Copy Markdown
Contributor

It's probably worth defining what "work" means precisely. This affects how the facts are gathered. Does it refer to Tasks started from a turn owned by a user? does it include linked work? everything that stems from the originating turn? I think there's already an implicit definition right now - anything that was created from the originating turn.

Given that, does it mean that work ownership can change hands? I think this PR and #4140 conflict wrt this. Here it says that the owner is the person running the turn while #4140 says the authority is fixed per root work item (does this mean the whole conversation or a turn?).

I suspect that we might go in circles if we try to tie authority to turn/conversation ownership. We may need a way to extract "work" out first so we can tie actors/owners to them instead.

Example scenario:

  • User A owns PR 1 created from Turn X
  • User B wants to update PR 1's description in Turn Y
  • PR 1 is owned by User A and thus User A's approval is required here

@thomasjiangcy

Copy link
Copy Markdown
Contributor

Junior don't change anything in this PR yet, just sharing my initial thoughts

@dcramer

dcramer commented Nov 24, 2026

Copy link
Copy Markdown
Member

Some behaviors we need to make sure we cover that you can dig through our transcripts to understand how bad it is. For example, I will often comment on GitHub to tell you to do something and then you give me a prompt to confirm it. We already have identification. We have trust systems. It should be using that and it should have treated that as instruction. We have a variety of things like that that some of it's the way our agent tools work where you again double confirm often. And we need to make sure that we factor that into this because one thing that's going to be really important is not just the guardian, but how the guardian interacts with other systems and making sure the other systems have intent clearly defined as well. That might be through evals. Some of those evals are in Guardian that makes sure it doesn't double prompt, but it also might be the way we pass trusted blocks or instructions or actors. It also might be the way we encode say that this tool call is already pre-trusted versus just asking the guardian to review every single thing

…rewrite

Co-Authored-By: David Cramer <[email protected]>

# Conflicts:
#	design/guardian.md
Authority comes from the instruction an action serves, not from owning
the work. Another agent's retelling is never authority, and a message
from the person's own linked account counts as their message.

Co-Authored-By: David Cramer <[email protected]>
dcramer added a commit that referenced this pull request Nov 25, 2026
This is the daily design doc audit of `design/` at
0ac434c34. It covers main commits from
00967f406. @dcramer confirmed the exact text of every
changed line and each intent change.

**New gaps**
- `inbox.md`: in a private Space, the Inbox lists and counts a "To do
for you" item by Participants and Destination, not by Space membership
(#4279).
- `inbox.md`: a typed message leaves a question for Everyone, or a
question with no assignees, open (#4225).
- `spaces.md`: a Space's Lead cannot archive a Conversation that it
started.
- `spaces.md`: a Space's Lead has no To-do list.
- `spaces.md`: the public MCP server does not show a Conversation's
Space.
- `spaces.md`: private work cannot move out of its Space, and only
public work can join a Space (#4279).
- `inbox-stacks.md`: on a phone, question rows and "To do for you" rows
show the names of Dismiss and Snooze.

**Intent changes**
- `inbox.md`: "Only an assignee answers a private item" is now scoped to
private items that have assignees. This matches the no-assignee rule
confirmed in #4218.

**Closed or corrected**
- `agent-teams.md`: removes three closed gaps. Thread and Task replies,
and cut-off text counted as a reply, were closed by
#4180. `noReply` with a Watch sending no update was
closed by #4271.
- `agent-teams.md`: the toolset gap now names only the Lead, because
`spawnAgent` is gone (#4182). The Watch Events gap is
narrowed, because the starter now gets the update
(#4271).
- `child-agents.md`: the kind gap now quotes the rule from
#4292 and adds #4275.
- `inbox-stacks.md`: the stack gap uses "summary", not "Brief", and
names the rule that it breaks.

**Cuts**
- `agent-teams.md`: "from the same code".
- `github.md`: the cache and tables detail.
- `inbox-stacks.md`: a repeat of `inbox.md`, the title layout detail,
and the code change row click line.
- `sandbox-credentials.md`: the intro is scoped to requests that ask for
access.
- `context-compaction.md`: the setting name.

**Skipped**
- `guardian.md`: the Lead wording and the child-agent Inbox gap. Open
#4139 covers both.
- `github.md`: the draft conflict and Watch expiry gaps. Open
#3885 covers both.

<!-- junior-request-attribution:start -->
via @dcramer.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!--
junior-conversation-id:agent-dispatch%3Adispatch_4a4fb37d9a36598fc60b2e47348ad753
-->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent-dispatch%3Adispatch_4a4fb37d9a36598fc60b2e47348ad753)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent-dispatch%3Adispatch_4a4fb37d9a36598fc60b2e47348ad753/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <[email protected]>
The per-person Lead is gone. A Conversation that a Lead starts serves
the request of the Member who asked for it.

Co-Authored-By: David Cramer <[email protected]>
sentry-junior Bot and others added 2 commits November 25, 2026 23:03
Regroups every Guardian rule and gap under IDs, adds Jobs and Non-goals,
and folds in recent concerns: relayed words, must-name slots, one ask per
batch, no re-ask, and a bounded review failure. TERMINOLOGY.md now lets a
linked account's text and relayed own words count as the person's.

Co-Authored-By: David Cramer <[email protected]>

@dcramer dcramer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one gripe. Make sure it's reviewed after we change that

Comment thread design/guardian.md Resolved
@sentry-junior
sentry-junior Bot requested a review from dcramer November 25, 2026 23:26
@dcramer
dcramer merged commit ae76113 into main Nov 25, 2026
57 checks passed
@dcramer
dcramer deleted the docs/guardian-design-rewrite branch November 25, 2026 23:54

This branch was successfully deployed

1 active deployment
Preview – junior-docs — a64e781a Deployed Nov 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants