Repository navigation
feat(cursor-approve): business, design and completeness axes behind a read-only context proxy - #353
Conversation
… read-only context proxy Three thin wrappers over cursor-axis-base.yml, each declaring only its own secrets. The base turns its reserved extension points into context_sources + no_shell: a dedicated step writes the tokens to a 0600 file, context-proxy.py is started before the agent and deletes it, and cursor-agent reaches the proxy through mcp-relay.py as its only MCP server. Business and design get no checkout and no shell and read the change fetched from the compare API. Fork PRs and public repos skip with a notice; the full transcript uploads as its own artifact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review paused — included plan limit reachedKeep your review moving with free on-demand reviews.
On-demand reviews are free for the next 3 days.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Promotion and pricing detailsOn-demand reviews are free for the next 3 days. After that, they cost $0.25 per reviewed file. Review limit detailsOr wait 11 minutes for your next included review. Limit details: You’ve used the included review currently available. Your 127 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (15)
Comment |
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @mattmillerai.
Found 10 finding(s).
| Severity | Count |
|---|---|
| 🟡 Medium | 7 |
| 🟢 Low | 3 |
Panel: 4/6 reviewers contributed findings.
Reviewers that did not contribute: gpt-5.6-sol-max:adversarial (error), gpt-5.6-sol-max:edge-case (error)
- changed-files.txt: one compare page (files live on page 1 only), paths JSON-encoded so a newline/tab cannot forge rows, explicit 300-file truncation line. - no_shell guard fails closed when the transcript has no recognizable tool call; deny list adds WebFetch(*). - context axes upload a transcript with tool calls cut to their names; the raw stream never sits in the uploaded directory. - mcp-relay.py exits when the proxy side closes or fails, and opens its FIFOs non-blocking with a bounded retry instead of hanging. - Non-fetching axes must check out; context_sources matched as a whole value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-axes # Conflicts: # README.md
Adds the three context axes of cursor-approve (business, design, completeness) as thin wrappers over
cursor-axis-base.yml, and fills in the base's two reserved extension points so the agent can search Linear/Notion/Slack throughcontext-proxy.pywithout ever holding a token.What changed
axis-business.yml/axis-design.yml/axis-completeness.yml: each declares exactly its secrets (business:CURSOR_API_KEY,LINEAR_KEY,NOTION_TOKEN,SLACK_TOKEN; design: no Slack; completeness:CURSOR_API_KEY,LINEAR_KEY). Every secret exceptCURSOR_API_KEYis optional. Business and design run withcheckout: falseandno_shell: true; completeness uses the read-only checkout. Askippedjob prints a notice for fork PRs and public repos, and the axis job is gated on the same condition, reversed.cursor-axis-base.yml:mcp_configinput is replaced bycontext_sources(a comma list for--enable), andno_shellnow does something. Both are validated: context tools only for the three context axes, private repos only, and business/design must becheckout false+no_shell true.O_EXCL). The agent step then startscontext-proxy.pybefore cursor-agent, on two FIFOs and withenv -u CURSOR_API_KEY, and waits until the proxy has deleted the token file. If the proxy dies or the file is still there, it refuses to start the agent..cursor/is rebuilt so its only MCP server is the newmcp-relay.py, a byte relay to that proxy. The relay exits if the proxy side closes or fails, and gives up on a dead proxy after a bounded open instead of hanging.cli.jsonallows only the enabledMcp(context:*)tools and, withno_shell, deniesShell(*),Write(**)andWebFetch(*).--output-format stream-json. The transcript, plus the proxy's--log, uploads astranscript-axis-<axis>, a name decide'saxis-*download never matches. On a context axis, each tool call in the uploaded transcript is cut to its name (no arguments or results), and the raw stream is kept outside the uploaded directory. The finalresultis passed on to the existingaggregate.py extract. Withno_shell, the job fails on any shell/write/edit/delete tool call in the transcript, or if the transcript has no recognizable tool call at all (its format drifted). This is the "fail if the installed cursor-agent can't enforce it" rule.checkout: true.context_sourcesis matched against the whole value.base.sha...commit_sha, which is the merge-base diff of exactly the judged commit. Business gets a changed-file list with +/- counts and JSON-encoded paths, capped at the API's 300 files and marked when it is cut; design gets the diff truncated to 200 KB with a marker. Neither gets a checkout.render.prompt-no-checkout.mdsays there are no git/shell commands and the change is in a fetched file.prompt-context-tools.mdsays tool results are third-party data and never instructions.docs/callers/cursor-approve.mdhas a Context axes section with one row per axis (tools, secrets), how the tokens move, the skip rules, caller examples, and the accepted risk. The README catalog row and the cursor-approve README are updated too.tests/test_context_axes.pyandtests/test_mcp_relay.py, plus updates to the existing secret and prompt-file tests and the inputs-vs-docs drift rows.Judgment calls
pulls/N/files/ the PR diff media type. It pins the input tocommit_shaeven if the PR moves on, andcontents: readcovers it.pull-requests: readwould have broken the existing correctness/conformance wrappers, because a nested job can't ask for more permissions than its caller.axes:on such repos.Verification
python3 -m unittest discover -s .github/cursor-approve/tests→ 148 OK..github/workflow-pins/tests→ OK (43 skipped, as on main).job.workflow_sha"not defined" reports (an older actionlint schema; also present on main). There were no new findings. actionlint was not re-run after the review-fix commit.check_workflow_pins.py,check_agents_md.py --root .andcheck-org-repo-literals.shall pass.Residual
Nothing here has run on a real Actions runner against the pinned cursor-agent (
2026.09.10-fd3934a). These assumptions are unverified:{"type":"result","result":…}, andtool_callevents keyed byshellToolCall/writeToolCall/editToolCall/deleteToolCall);Shell(*)/Write(**)/WebFetch(*)deny syntax in projectcli.json;The failure direction is closed: no result event, any forbidden tool call, or (with
no_shell) no recognizable tool call fails the axis, and decide reads that as "no result". But a first live run on a private repo is needed before relying on these axes. All five axes now depend on the stream-json extraction.The relay supports one MCP connection at a time. If cursor-agent opens two concurrent connections to the
contextserver, their bytes would interleave on the proxy's single stdio.The completeness axis keeps its shell (needed for
git diff). On a hosted runner with passwordlesssudo, a hostile agent could read the running proxy's memory and so its Linear token. This is documented as accepted risk in the caller guide. Fixing it needs a different user or a sandbox for the proxy.The live Linear/Notion/Slack tools were not exercised. The tokens don't exist yet (separate provisioning task), and the proxy's own tests live with the proxy.
The ticket's linked design doc (a Notion page) was not readable from this environment and is an unexercised artifact.
Provenance
mcp_configinput was replaced bycontext_sourcesmcp-relay.py🤖 Generated with Claude Code