Repository navigation
feat!: enforce the permissions input via SDK tool restrictions - #23
Conversation
🦋 Changeset detectedLatest commit: a58b650 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou'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. View limit details
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. Comment |
710b82c to
5b35e19
Compare
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.
ac0f16e to
039a60c
Compare
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.
039a60c to
a58b650
Compare
Description
permissionsacceptedread-only,read-write, andfull, validated the value, and then discarded it; the README, the docs, andaction.ymlall said it would be wired to the SDK in v2. The SDK'sAgentOptionshas hadtools(allow list) anddisallowedTools(deny list) for local agents since the version this action already uses, so this wires the input up:read-onlyoffers read, search, and web tools only;read-writeremovesshellandtaskfrom the default toolset;fullleaves the SDK default. The mapping lives in one place,src/permissions.ts.This is a breaking change:
read-onlyis the default, so workflows that relied on it not restricting anything must setpermissions: full. It ships as v2;@v1keeps the old behaviour. Stacked on #22.Related Issues
None.
Checklist
.github/–only changes).github/–only community or template updates)Screenshots (if applicable)
N/A
Additional Notes
Two calls worth a look before release.
read-onlyincludeswebSearchandwebFetch: read-only towards the checkout, not the network. And the input keeps its name; the old reference page floated renaming it toagent-permissionsin v2 so it reads differently from the workflow-levelpermissions:key. That rename is not done here and would be a one-line change inaction.ymlplus the docs if wanted. Unknown tool names makeAgent.createthrow aConfigurationError; the names used come from the SDK's ownToolNametype, and the manual Smoke Test (which runs withread-only) is the runtime check.cursor-versionstays accepted and ignored.