fix(workflow-tags): enforce workspace scoping for tag links#2206
fix(workflow-tags): enforce workspace scoping for tag links#2206daryllimyt wants to merge 9 commits intomainfrom
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Free Tier Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
There was a problem hiding this comment.
1 issue found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tracecat/workflow/tags/router.py">
<violation number="1" location="tracecat/workflow/tags/router.py:41">
P2: Duplicate tag assignments will raise an unhandled `IntegrityError`, resulting in a 500 Internal Server Error. Following the error handling guidelines, the service layer should catch `IntegrityError`, roll back, and raise a `ValueError`, which this router should then map to a 409 Conflict.
(Based on your team's feedback about Error handling posture (updated) and returning HTTP 409 Conflict for duplicate assignments.) [FEEDBACK_USED]</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
69d4efb to
5ebfe09
Compare
5ebfe09 to
b5a42ef
Compare
9194362 to
b9cdd2e
Compare
b9cdd2e to
ed6b32a
Compare
b5a42ef to
0150cb6
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0150cb6194
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0150cb6194
ℹ️ 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".
ed6b32a to
571c254
Compare
0150cb6 to
0018b13
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0018b1336c
ℹ️ 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".
571c254 to
37f760c
Compare
0018b13 to
91e6ec5
Compare
3834276 to
4937fa5
Compare
91e6ec5 to
d166b45
Compare
4937fa5 to
ac4cbe2
Compare
d166b45 to
4b62d41
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b62d41c49
ℹ️ 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".
4b62d41 to
35f07c4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35f07c43ae
ℹ️ 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".
2eb724c to
a4d465c
Compare
35f07c4 to
17b69cd
Compare
|
✅ No security or compliance issues detected. Reviewed everything up to e181fb6. Security Overview
Detected Code Changes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17b69cd5d2
ℹ️ 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".

Checklist
uv run pytest tests)?pre-commit run --all-files)?Description
Related Issues
Screenshots / Recordings
Steps to QA
Note
Medium Risk
Primarily query-level scoping changes to prevent cross-tenant data access; risk is moderate because it can change 404/409 behavior and potentially break callers relying on previously-permissive lookups.
Overview
Hardens tenant isolation by enforcing organization/workspace scoping in several read/write paths.
Workflow tag links now require both the workflow and tag to exist in the caller’s workspace; duplicate associations are translated to a 409, and missing/cross-workspace refs return 404. Case tag listing and table column lookup are updated to join through the parent
Case/Tableand filter byworkspace_id, and RBAC group member remove/list now verifies the group belongs to the caller’s organization.Adds unit/HTTP tests covering cross-workspace/org non-leakage and the new workflow-tags error mapping.
Written by Cursor Bugbot for commit b5a42ef. This will update automatically on new commits. Configure here.
Summary by cubic
Enforces workspace scoping for workflow tag links, case tag associations, and table column lookups, and scopes RBAC group member operations by organization. Duplicate workflow tag adds are idempotent; missing or cross‑workspace refs return 404.
WorkflowandWorkflowTagand require both in the caller’s workspace; POST maps missing refs to 404; duplicate adds succeed without error.CaseandCaseTagand filter by the caller’s workspace; stale cross‑workspace links are ignored.get_columnjoinsTableand enforces the table’s workspace; cross‑workspace lookups return not found.Groupand filter by caller organization.Written for commit e181fb6. Summary will update on new commits.