Skip to content

feat(workflows): expose authenticated run subjects - #7088

Open
TheodoreSpeaks wants to merge 3 commits into
feat/workspace-principalfrom
feat/subject-metadata-start
Open

feat(workflows): expose authenticated run subjects#7088
TheodoreSpeaks wants to merge 3 commits into
feat/workspace-principalfrom
feat/subject-metadata-start

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • preserve authenticated principals across synchronous, queued, resumed, and nested workflow execution
  • expose normalized Sim user, chat email, and provider subjects through optional Start run metadata
  • keep actorless callers identity-free and enforce subject-scoped credential access

Type of Change

  • New feature

Testing

  • 771 tests across 31 changed test files
  • bun run lint
  • bun run check:audits (33 audits)

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 26, 2026 12:43am

Request Review

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR propagates authenticated subjects through workflow execution and exposes normalized identity metadata to Start blocks while keeping actorless runs identity-free.

  • Adds signed authenticated-email claims to deployment cookies and recovers them during chat and public-file authentication.
  • Carries Sim-user, authenticated-email, and provider subjects through synchronous, queued, resumed, and nested workflow execution.
  • Enforces subject-scoped credential access and adds coverage across authentication and execution paths.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported untyped authentication fixture now uses a typed NextRequest helper and real Cookie headers.

Important Files Changed

Filename Overview
apps/sim/app/api/chat/utils.test.ts Replaces ad-hoc authentication request casts with typed NextRequest fixtures using real Cookie headers, resolving the prior review concern.
apps/sim/lib/core/security/deployment.ts Extends signed deployment authentication tokens to preserve normalized authenticated-email subjects.
apps/sim/lib/workflows/executor/start-run-identity.ts Normalizes trusted execution principals into optional Start-block subject metadata.
apps/sim/lib/workflows/executor/execution-core.ts Propagates authenticated principal identity into workflow execution and Start metadata.
apps/sim/executor/handlers/workflow/workflow-handler.ts Preserves principal subjects across nested workflow execution boundaries.
apps/sim/lib/credential-groups/credentials.ts Applies subject-aware constraints when resolving credentials for authenticated workflow runs.
packages/auth/src/principal.ts Defines the shared principal-subject contract used across authentication and execution layers.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Authenticated caller] --> B[Normalized principal subject]
  B --> C[Workflow execution context]
  C --> D{Execution path}
  D --> E[Synchronous run]
  D --> F[Queued or resumed run]
  D --> G[Nested workflow]
  E --> H[Start run metadata]
  F --> H
  G --> H
  H --> I[Subject-scoped credential access]
  J[Actorless caller] --> K[Identity-free execution]
Loading

Reviews (2): Last reviewed commit: "fix(auth): harden subject delegation and..." | Re-trigger Greptile

Comment thread apps/sim/app/api/chat/utils.test.ts Outdated

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 90 files

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

Re-trigger cubic

Comment thread apps/sim/background/workflow-column-execution.ts
Comment thread apps/sim/app/api/mcp/serve/[serverId]/route.ts
Comment thread apps/sim/lib/credentials/application/resolve-managed-oauth-token.ts
Comment thread apps/sim/lib/auth/internal.ts Outdated
Comment thread apps/sim/lib/core/security/deployment.ts Outdated
Comment thread apps/sim/app/api/mcp/serve/[serverId]/route.test.ts
Comment thread apps/sim/app/api/workflows/[id]/execute/route.ts
Comment thread apps/sim/lib/webhooks/slack-dispatch.ts
Comment thread design/credential-group-authorization.md
@TheodoreSpeaks
TheodoreSpeaks force-pushed the feat/subject-metadata-start branch from b3ca91c to 266f4fc Compare August 26, 2026 00:34
@TheodoreSpeaks
TheodoreSpeaks changed the base branch from staging to feat/workspace-principal August 26, 2026 00:34
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor

cursor Bot commented Aug 26, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

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