Skip to content

feat!: enforce the permissions input via SDK tool restrictions - #23

Merged
PunGrumpy merged 2 commits into
mainfrom
feat/enforce-permissions
Oct 18, 2026
Merged

PunGrumpy merged 2 commits into
mainfrom
feat/enforce-permissions

Conversation

@PunGrumpy

Copy link
Copy Markdown
Owner

Description

permissions accepted read-only, read-write, and full, validated the value, and then discarded it; the README, the docs, and action.yml all said it would be wired to the SDK in v2. The SDK's AgentOptions has had tools (allow list) and disallowedTools (deny list) for local agents since the version this action already uses, so this wires the input up: read-only offers read, search, and web tools only; read-write removes shell and task from the default toolset; full leaves the SDK default. The mapping lives in one place, src/permissions.ts.

This is a breaking change: read-only is the default, so workflows that relied on it not restricting anything must set permissions: full. It ships as v2; @v1 keeps the old behaviour. Stacked on #22.

Related Issues

None.

Checklist

  • I've reviewed my code
  • I've written tests (skip if not applicable, e.g. .github/–only changes)
  • I've added a changeset when the change affects the published action or release notes (skip for .github/–only community or template updates)
  • I've updated the docs, if necessary

Screenshots (if applicable)

N/A

Additional Notes

Two calls worth a look before release. read-only includes webSearch and webFetch: read-only towards the checkout, not the network. And the input keeps its name; the old reference page floated renaming it to agent-permissions in v2 so it reads differently from the workflow-level permissions: key. That rename is not done here and would be a one-line change in action.yml plus the docs if wanted. Unknown tool names make Agent.create throw a ConfigurationError; the names used come from the SDK's own ToolName type, and the manual Smoke Test (which runs with read-only) is the runtime check. cursor-version stays accepted and ignored.

@changeset-bot

changeset-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a58b650

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

This PR includes changesets to release 1 package
Name Type
@pungrumpy/cursor-action Major

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

@vercel

vercel Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cursor-action Ready Ready Preview Oct 18, 2026 11:44am UTC

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6f1b3713-f0b8-4d7e-a411-5721bf422fe1
📥 Commits

Reviewing files that changed from the base of the PR and between b13383c and a58b650.

⛔ Files ignored due to path filters: 1
  • dist/index.mjs is excluded by !**/dist/**
📒 Files selected for processing: 11
  • .changeset/enforce-permissions.md
  • README.md
  • __tests__/permissions.test.ts
  • __tests__/runner.test.ts
  • action.yml
  • docs/content/behaviour.mdx
  • docs/content/examples.mdx
  • docs/content/quickstart.mdx
  • docs/content/reference.mdx
  • src/permissions.ts
  • src/runner.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The permissions input was validated and then discarded, so read-only never stopped the agent from editing files or running commands. Map each level to the SDK's tools and disallowedTools options so the value does what its name says.

This is a breaking change for workflows that relied on read-only not restricting anything. They now need permissions: full to keep the old behaviour.
@PunGrumpy
PunGrumpy force-pushed the feat/enforce-permissions branch from ac0f16e to 039a60c Compare October 18, 2026 11:32
@PunGrumpy
PunGrumpy changed the base branch from fix/hard-timeout-dispose-agent to main October 18, 2026 11:33
Replace the not-enforced warnings with the tool mapping for each permissions level, regenerate the input reference from action.yml, and switch the usage examples to the v2 tag.
@PunGrumpy
PunGrumpy force-pushed the feat/enforce-permissions branch from 039a60c to a58b650 Compare October 18, 2026 11:44
@PunGrumpy
PunGrumpy merged commit eb34fe0 into main Oct 18, 2026
12 of 13 checks passed

This branch was successfully deployed

1 active deployment
Preview — a58b6501 Deployed Oct 18, 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