Skip to content

feat: remove agents-access role and enable Coder Agents by default - #28184

Open
ibetitsmike wants to merge 11 commits into
mainfrom
mike/codagt-554-remove-agents-access
Open

feat: remove agents-access role and enable Coder Agents by default#28184
ibetitsmike wants to merge 11 commits into
mainfrom
mike/codagt-554-remove-agents-access

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Removes the org-scoped agents-access ("Coder Agents User") role and enables Coder Agents for every organization member by default.

Closes https://linear.app/codercom/issue/CODAGT-554/remove-agents-access-role-and-enable-agents-by-default

Why

Coder Agents access previously required granting the agents-access role user by user, per organization. There was no org-wide or default enablement, which made rollout painful. Per-user enablement is unusually unergonomic for basic product functionality, so Agents is now on by default for regular members.

What changed

  • RBAC: the chat permissions the role carried (create, read, share, update on owned chats; no delete, hard-deletion stays in dbpurge) move into the organization-member permission floor (OrgMemberPermissions). The agents-access built-in role, its assignment entries, and its name helpers are deleted. ReservedRoleName keeps agents-access reserved so a custom role cannot adopt the name and collide on rollback. Service accounts keep their own permission set (OrgServiceAccountPermissions) and do not receive chat access by default.
  • Migration 000570: scrubs stored agents-access strings from organization_members.roles, users.rbac_roles, and organizations.default_org_member_roles; stale strings would otherwise fail role-update validation and render as raw labels in the UI. The down migration restores the role to all current non-service-account memberships so a rollback to an older binary preserves member chat access; org defaults are not restored because older binaries union them into service-account memberships too.
  • SDK/frontend: codersdk.RoleAgentsAccess is retained as a deprecated constant for downstream Go consumers; types regenerated. Role description/sort metadata, MockAgentsAccessRole, and role-specific stories removed or repurposed. The frontend already gated on the createChat permission (not the role name), so it now lights up for all members with no logic change. The chat access denied alert keeps working for the remaining denial case (service accounts) and no longer points at a deleted docs anchor.
  • Docs: the "Grant Coder Agents User" step is removed from the getting-started guide and the glossary entry is dropped. An upgrade note tells operators to drop agents-access from Terraform or scripted role sets, since role updates that still include it are rejected.
  • Tests: role fixtures drop the grant; member-denial tests are repurposed as plain-member success, cross-user denial, or service-account denial coverage; TestListRoles, enterprise role listing, SSR permission, querier, migration, and Navbar/AgentCreateForm story tests updated.

Notes for reviewers

  • Chat authorization is purely policy-driven on ResourceChat; no handler checked the role name, so removing the role only changes which subjects hold the permissions.
  • Model configs, AI providers, and MCP server configs remain deployment-wide. The removed role never scoped them, so this change does not regress isolation; per-org admin controls remain future Admin Controls PRD work.

Remote dogfood UAT was run against this branch via a Coder Agent on dev.coder.com covering the plain-member happy path, role-list removal, migration scrubbing, and service-account denial.

Mux (AI agent) authored this PR on Mike's behalf.

Chat permissions (create, read, share, update on owned chats) move from
the removed org-scoped agents-access role into the organization-member
permission floor, so every org member can use Coder Agents without a
per-user grant. Service accounts remain excluded. Migration 000570
scrubs stored role strings so role expansion cannot fail after the
built-in role is gone.
@linear-code

linear-code Bot commented Aug 14, 2026

Copy link
Copy Markdown

CODAGT-554

@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

@ibetitsmike
ibetitsmike marked this pull request as ready for review August 14, 2026 22:23
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c98b65c4f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/database/migrations/000570_remove_agents_access_role.down.sql Outdated
Comment thread codersdk/rbacroles.go
Comment thread site/src/pages/AgentsPage/components/ChatAccessDeniedAlert.tsx
Restore agents-access to non-service-account org memberships in the
down migration so pre-removal binaries keep chat access on rollback,
keep the deprecated codersdk.RoleAgentsAccess constant for source
compatibility, and pin the chat access denied alert docs href in its
story.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ff3ead19a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/rbac/roles.go
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ff3ead19a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 314859e079

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/database/migrations/000570_remove_agents_access_role.down.sql Outdated
Comment thread coderd/rbac/roles.go
Reserving the retired role name prevents a custom role from shadowing
the built-in on rollback. The down migration no longer restores
default_org_member_roles because pre-removal binaries union defaults
into service-account memberships, which would grant every service
account chat access.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f35dd8b1e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/database/migrations/000570_remove_agents_access_role.up.sql
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 125d99d57d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/rbac/roles.go
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 125d99d57d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/modules/dashboard/Navbar/NavbarView.stories.tsx
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e5de52948

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/ai-coder/agents/getting-started.md Outdated
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b4ab4108f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/ai-coder/agents/getting-started.md Outdated
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: f758e0bd0b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd65b14a5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/rbac/roles.go
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: dd65b14a5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant