Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/insights/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ async function runInsightsAgent(params: {
chatId: `insights:${params.organizationId}:${params.websiteId}`,
serviceAuth: {
organizationId: params.organizationId,
scopes: ["read:data"],
scopes: ["read:data", "manage:websites"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 manage:websites scope is wider than the current mutation tools require

manage:websites is the correct scope to unblock goal/funnel/annotation mutations (per RESOURCE_SCOPE_OVERRIDES), but it also grants authority over the website entity itself — domain name changes, deletion, etc. Right now the actual tool set is the effective limiter, but if a new tool is later added to the "mutations" capability (e.g. delete_website, update_website_domain) it would silently inherit this scope without any corresponding auth review. Consider documenting the intent here (e.g. a comment listing the specific mutation types this scope is intended to cover) so future contributors know to re-evaluate the scope if the tool set expands.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

},
};

Expand Down