Skip to content

feat: gate agent management rollout - #6055

Merged
danielkov merged 9 commits into
mainfrom
daniel/aim-190-test-gate-m1-agent-identity-and-setup-authorization
Sep 8, 2026
Merged

danielkov merged 9 commits into
mainfrom
daniel/aim-190-test-gate-m1-agent-identity-and-setup-authorization

Conversation

@danielkov

@danielkov danielkov commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Gates agent-management endpoints behind an organization-targeted agent-management feature flag and extends authorization and audit coverage for agent identity and setup. Endpoints fail closed unless the flag is explicitly enabled, and rollout requires administrator-grant verification before the feature flag is enabled.

Motivation

Agent-management surfaces must not become reachable until administrator grants are fully backfilled and verified.

Technical details

Rollout control

The feature flag is evaluated after session authentication using the authenticated organization ID and organization cohort. Disabled, missing, indeterminate, and provider-error results return a uniform not-found response before an endpoint can read or mutate agent state.

Grant verification

The operator runbook requires complete-database grant verification before enabling the feature for an environment or cohort. Verification fails when required grants are missing, unexpected agent grants exist, or administrator roles remain unresolved.

Rollout prerequisite

This PR targets main. The backfill command and runbook remain in #6044; they are an operational rollout prerequisite, not a runtime code or merge dependency of this PR.

Run the administrator-grant backfill and verify the complete target database before enabling the agent-management feature flag for an environment or cohort. Keep the flag disabled until verification exits zero and reports summary.verification.ready_for_enforcement=true.

Linear: AIM-190

@danielkov
danielkov requested a review from a team as a code owner September 4, 2026 02:27
@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

AIM-190

@changeset-bot

changeset-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1f0a170

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
server Minor
dashboard Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Running ultrareview automatically — This PR introduces a fail-closed authorization gate for agent management endpoints controlled by an org-targeted feature flag, with the gate applied in the auth path and a new CI gate; a subtle bug could expose or block agent management incorrectly, warranting a deeper review.. I'll post findings when complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

Ultrareview completed in 3m 57s

All reported issues were addressed across 10 files

Linked issue analysis

Linked issue: AIM-190: test: gate M1 agent identity and setup authorization

Status Acceptance criteria Notes
A standalone, non-retrying CI gate runs the combined M1 identity, lifecycle, authorization, policy, migration, audit, telemetry, and privacy test suites. The new m1-agent-gate job runs the listed server packages with count=1 and is required by the main PR checks.
M1 agent-management endpoints remain unavailable unless the organization-targeted rollout flag is authoritatively enabled. Authentication is followed by per-organization flag evaluation, and disabled, missing, indeterminate, or provider-error states return a uniform not-found error.
Rollout requires both the focused M1 CI result and complete-database administrator-grant verification before enforcement. The runbook explicitly requires the published-SHA CI gate and successful migration verification before enabling the feature flag.
M1 management audit actions emit the existing agent webhook event with the expected attribution. Lifecycle, ownership, and policy tests now compare recorded audit actions with agent webhook outbox actions, while the helper validates organization and agent subject attribution.

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread .github/workflows/pr.yaml Outdated
Comment thread server/internal/agentmanagement/service.go Outdated
@danielkov
danielkov force-pushed the daniel/aim-190-test-gate-m1-agent-identity-and-setup-authorization branch from 9c8b486 to 36d2d13 Compare September 4, 2026 07:36
Comment thread .github/workflows/pr.yaml Outdated
Comment thread server/cmd/tools/migrations/AGENT_MANAGEMENT_GRANTS_MIGRATION.md Outdated
Comment thread server/internal/agentmanagement/service.go Outdated
Comment thread server/internal/feature/flags.go Outdated
@danielkov danielkov changed the title test: gate M1 agent identity and setup authorization feat: gate agent management rollout Sep 4, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

All reported issues were addressed across 5 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread server/internal/agentmanagement/gate_test.go
@danielkov
danielkov force-pushed the integration/aim-190-prerequisites branch from 5e9bca1 to fa67467 Compare September 8, 2026 20:51
@danielkov
danielkov requested a review from a team as a code owner September 8, 2026 20:51
@danielkov
danielkov force-pushed the daniel/aim-190-test-gate-m1-agent-identity-and-setup-authorization branch from ca78e45 to 972317d Compare September 8, 2026 20:51
@blacksmith-sh

This comment has been minimized.

@danielkov
danielkov changed the base branch from integration/aim-190-prerequisites to main September 8, 2026 21:25
@danielkov
danielkov changed the base branch from main to daniel/aim-187-agent-management-grants-backfill September 8, 2026 21:26
@danielkov
danielkov force-pushed the daniel/aim-190-test-gate-m1-agent-identity-and-setup-authorization branch from 972317d to db91a5a Compare September 8, 2026 21:28
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


7 out of 8 committers have signed the CLA.
✅ (bflad)[https://github.com/bflad]
✅ (daviddanialy)[https://github.com/daviddanialy]
✅ (chase-crumbaugh)[https://github.com/chase-crumbaugh]
✅ (danielkov)[https://github.com/danielkov]
✅ (simplesagar)[https://github.com/simplesagar]
✅ (disintegrator)[https://github.com/disintegrator]
✅ (bradcypert)[https://github.com/bradcypert]
@speakeasyforgebot
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

atlas migrate lint on server/migrations

Status Step Result
No migration files detected  
ERD and visual diff generated View Visualization
No issues found View Report
Read the full linting report on Atlas Cloud

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

atlas migrate lint on clickhouse/migrations

Status Step Result
No migration files detected  
ERD and visual diff generated View Visualization
No issues found View Report
Read the full linting report on Atlas Cloud

@danielkov
danielkov force-pushed the daniel/aim-190-test-gate-m1-agent-identity-and-setup-authorization branch from fec3154 to 1f0a170 Compare September 8, 2026 21:38
@danielkov
danielkov changed the base branch from daniel/aim-187-agent-management-grants-backfill to main September 8, 2026 21:39
@danielkov

Copy link
Copy Markdown
Contributor Author

recheck

@danielkov
danielkov added this pull request to the merge queue Sep 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 8, 2026
@danielkov
danielkov added this pull request to the merge queue Sep 8, 2026
Merged via the queue into main with commit 718b3e4 Sep 8, 2026
82 of 84 checks passed
@danielkov
danielkov deleted the daniel/aim-190-test-gate-m1-agent-identity-and-setup-authorization branch September 8, 2026 22:08
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants