Skip to content

feat(api): agent identity on v2 meta, scoped CLI pairing keys, and v2 workspace rename - #9904

Merged
waleedlatif1 merged 6 commits into
stagingfrom
feat/v2-agent-identity
Nov 11, 2026
Merged

waleedlatif1 merged 6 commits into
stagingfrom
feat/v2-agent-identity

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • GET /api/v2/meta now reports keyId, userId, the bound workspaceId (workspace keys), and links to the OpenAPI document, API docs, and MCP server. No email. Existing fields unchanged.
  • sim login pairing can mint a read-only and/or expiring key (--read-only, --expires-in <days>). The request is shown on the approval card and applied from the approval server-side; the unauthenticated poll can't set it. The CLI refuses to store a key that doesn't match what was asked (protects against an older server that ignores the request). sim whoami shows key expiry and bound workspace. Defaults are unchanged.
  • Fixed the signed-out pairing bounce dropping handoff params (a platform login came back as copilot, and a read-only request would have been lost).
  • POST /api/v2/credentials/connections returns draftId. A connection link opened by the wrong account (or expired) now says to sign in as the account that created it or make a new one, without revealing which case applied.
  • New PATCH /api/v2/workspaces/{workspaceId} for name and logo, via the narrow workspaces.identity.update operation (the one Copilot already uses), widened to personal keys and OAuth api:write with Admin. Workspace keys stay denied; billing and personal-key policy stay session-only. Generates sim workspaces update and the MCP tool.

Test plan

  • Targeted vitest: cli auth approve/poll, approval store, oauth authorize, v2 workspaces, meta, lib/workspaces, sim-cli auth/client/device-flow/program/contract
  • Each new guard test fails with its fix reverted
  • Generators current: openapi, mcp-operations, cli-api, cli-docs, v2-route-table; api-validation:strict, principal-kind-parity, permission-group-enforcement, boundaries audits
  • sim login --method api-key --read-only --expires-in 30 end to end
  • CI gate

… workspace rename

- GET /api/v2/meta adds keyId, userId, workspaceId and links {openapi, docs, mcp};
  existing fields unchanged. The API catalog shares the same link source.
- CLI pairing login accepts --read-only and --expires-in <days>. The request rides
  the approval URL, is shown on the approval card, is recorded with the approval
  and applied at mint; the unauthenticated poll cannot set either. The poll echoes
  access and expiresAt, and the CLI refuses to store a key that does not match
  what was asked (an older server mints full access). The signed-out login bounce
  now keeps scope, workspace, access and expiry instead of dropping them.
  sim whoami shows the key's expiry and bound workspace.
- POST /api/v2/credentials/connections returns draftId. Opening a connection link
  that is unknown, expired or another account's now explains to sign in as the
  creating account, without saying which case applied.
- PATCH /api/v2/workspaces/{workspaceId} renames a workspace or changes its logo
  through the existing workspaces.identity.update operation, widened to personal
  API keys and OAuth tokens (api:write); Admin still required, workspace keys
  still denied. Workspace update operations move into the operations registry.
- Regenerated OpenAPI, MCP catalog, CLI client and CLI docs.
@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview Nov 11, 2026 10:20pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues remain from this review.

Summary

This PR adds credential identity and discovery links, read-only and expiring CLI pairing keys, and workspace name and logo updates.

  • CLI pairing lets people request read-only keys and set when keys expire.
  • Workspace admins can change a workspace name or logo through the API.
  • API metadata identifies the caller's credential and points to API resources.
  • Credential connection links identify their draft and explain when they cannot be opened.

Reviews (4) · Last reviewed commit: "fix(api): publish the workspace PATCH bo..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to 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.

All reported issues were addressed across 45 files

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

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/app/cli/auth/search-params.ts Resolved
Comment thread apps/docs/openapi-v2-resources.json Resolved
Comment thread apps/docs/openapi-v2-resources.json Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to 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.

No issues found across 46 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

… keys exactly

- PATCH /v2/workspaces/{id}: the body schema publishes minProperties 1, and
  logoUrl is a pattern (root-relative path or https URL, protocol-relative
  refused) instead of an unpublished refine.
- sim login refuses a minted key whose access or expiry differs from the
  request in either direction, with the expiry checked against the requested
  days within a clock tolerance.
- sim workspaces update --logo-url documents that clearing the logo goes
  through the API or MCP.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to 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.

No issues found across 46 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

This branch was successfully deployed

1 active deployment
Preview — 3f070382 Deployed Nov 11, 2026 by vercel[bot]
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