Letting an AI agent create pull requests sounds useful—but it can quickly become a security nightmare if the agent gets raw GitHub access. This is why most teams start with something narrower: a safe draft PR workflow that proves the concept without opening the door to chaos. Many teams want agents to help with routine engineering work: update docs, fix small issues, open draft pull requests and run tests. The dangerous part is giving an agent raw write access without a narrow workflow.

A safe draft PR workflow is a good first use case for agent capabilities because it is useful, concrete and has clear policy boundaries.
Unsafe version
Agent gets:
- github.create_branch
- github.commit_files
- github.create_pull_request
- shell.run
Safe version
Agent gets:
- create_safe_draft_pr
The capability describes the workflow and hides low-level steps behind policy.
Recommended policy
- Require branch prefix such as
gpt/orai/. - Force pull requests to be draft.
- Block secret-like paths.
- Limit changed files and diff size.
- Run tests or record why tests were not run.
- Audit original input, mutated input and final result.
Actlane manifest sketch
kind: Capability
metadata:
name: create-safe-draft-pr
spec:
policyRef:
name: safe-gitops-policy
execution:
tools:
- sandbox.run_tests
- github.create_branch
- github.commit_files
- github.create_pull_request
targets:
- mcp
- openapi
- opencode
- policyBundle
Why this is a strong first workflow
It proves the value of typed inputs, agent instructions, policy checks and generated integrations without requiring a full enterprise control plane.
Why this topic is related to Actlane
Safe draft PR creation is Actlane's reference workflow: a mutating AI-agent action with branch naming, draft mode, forbidden paths, optional tests, approval rules and audit output defined in one capability contract.
Try Actlane
Actlane is a DSL-first toolkit for safe AI-agent actions. The safe draft PR is Actlane's reference workflow—showing branch prefixes, draft mode, forbidden paths, approval rules and audit metadata all defined in one capability contract.
Explore on GitHub · See the safe draft PR example · Back to all articles