Skip to content

A known bot can ask for more permissions (GRYT-2006) - #361

Merged
grytchat merged 1 commit into
mainfrom
claude/GRYT-2006-bot-asks-more
Nov 3, 2026
Merged

grytchat merged 1 commit into
mainfrom
claude/GRYT-2006-bot-asks-more

Conversation

@grytchat

@grytchat grytchat commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review-required: touches src/db/ (a migration and the bot record).

A bot's list was fixed at its first knock, so a bot that needed more had to come back with a new key. That made a second bot under the same name, with none of the first one's history. It happened with the Gryt MCP on beta today.

What changes

  • An approved bot that declares permissions it never asked for still gets in with what it holds. The new ones are stored as more_permissions, an audit entry bot_asked_more is written, and the Bots list refreshes.
  • server:bots:decide on such a bot answers the new ask. Approve grants what's ticked from the new ones on top of what it had. Unticked ones go into declined_permissions and aren't asked again. Decline leaves the bot approved with exactly what it had.
  • server:bots:list carries more for the client.
  • Two columns on bots: more_permissions and declined_permissions, both TEXT NOT NULL DEFAULT '[]'.

Look at

  • decideBot's new branch. It only runs for an approved bot with something pending, and the grant is bounded by requested ∪ more, so it can't hand out anything never asked for.
  • The existing decide route still checks that the admin holds what they grant and outranks the bot. A bot with pending asks is answered through the same route and the same checks.
  • Declining keeps the bot in. If you'd rather a decline also pull the bot, that's a one-line change.

Tested: four new cases in bots.test.ts (held not granted, partial approve plus remembered no, decline keeps it in, a pending bot can't use it). Full suite: 2155 pass.

Client: Gryt-chat/client#1146. Docs and the bot README follow, since they say the list is fixed.

🤖 Generated with Claude Code

A bot's list was fixed at its first knock, so a bot that needed more had
to come back with a new key: a second bot under the same name, with none
of the first one's history.

Now an approved bot that declares permissions it never asked for still
gets in with what it holds, and the new ones are stored as
more_permissions for an admin. Nothing is granted until one answers.
Approve grants what was ticked from the new ones on top of what it had;
whatever isn't ticked goes into declined_permissions and isn't asked
again. Declining leaves the bot approved with what it had.

The reason the list was fixed still holds: a taken-over image can ask,
but it can't give itself anything. The bot list carries "more" so the
client can show the question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@grytchat
grytchat requested a review from sivert-io as a code owner November 3, 2026 12:05
@grytchat
grytchat merged commit 2e2ed93 into main Nov 3, 2026
8 checks passed
@grytchat
grytchat deleted the claude/GRYT-2006-bot-asks-more branch November 3, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants