Give the agent complete control over git operations, API calls, and external interactions. Simpler setup, requires more trust.Example: In our Auto Update Documentation cookbook, the first workflow lets the agent:
Analyze PR changes
Create and manage git branches
Commit and push changes
Post comments on pull requests
Handle all error scenarios
Copy
Ask AI
- name: Update docs (full autonomy) run: | cursor-agent -p "You have full access to git, GitHub CLI, and PR operations. Handle the entire docs update workflow including commits, pushes, and PR comments."
We recommend using this approach with permission-based restrictions for production CI workflows. This gives you the best of both worlds: the agent can intelligently handle complex analysis and file modifications while critical operations remain deterministic and auditable.
Limit agent operations while handling critical steps in separate workflow steps. Better control and predictability.Example: The second workflow in the same cookbook restricts the agent to only file modifications:
Copy
Ask AI
- name: Generate docs updates (restricted) run: | cursor-agent -p "IMPORTANT: Do NOT create branches, commit, push, or post PR comments. Only modify files in the working directory. A later workflow step handles publishing."- name: Publish docs branch (deterministic) run: | # Deterministic git operations handled by CI git checkout -B "docs/${{ github.head_ref }}" git add -A git commit -m "docs: update for PR" git push origin "docs/${{ github.head_ref }}"- name: Post PR comment (deterministic) run: | # Deterministic PR commenting handled by CI gh pr comment ${{ github.event.pull_request.number }} --body "Docs updated"