Loading…
An agent can author the change; a human still has to sign the deploy. Restrains AI-authored diffs that touch deploy, infra, or migration paths.
For: Teams whose coding agents open pull requests against production repos
Restrains an AI-authored change that touches deploy, infra, or migration paths until a human reviews it.
Allows AI-authored changes limited to documentation or test files.
Escalates any change that modifies secrets or rotation, requiring two approvers.
# GitHub AI-Authored Change Restraint
# Fork: adjust sensitive_paths for your repository layout.
apiVersion: decionis.dev/v1
kind: PolicyPack
metadata:
name: github-ai-authored-change-restraint
surface: github
workflow_key: github_agent_change_review
standards: [SOC2-CC8.1, ISO27001-A.8.9]
defaults:
mode: shadow
emit_dossier: true
comment_pr: true
sensitive_paths:
- ".github/workflows/**"
- "infra/**"
- "**/migrations/**"
rules:
- name: agent_authored_path_restraint
when: "context.agent_generated == true"
decision: |
RESTRAIN IF changed_paths matches any sensitive_paths
ALLOW OTHERWISE
reason_code: agent_change_needs_human_review
- name: docs_and_tests_allowance
when: "context.agent_generated == true"
decision: |
ALLOW IF changed_paths matches only ['docs/**', '**/*.test.*', '**/*.md']
ESCALATE OTHERWISE
reason_code: agent_change_outside_safe_paths
- name: secrets_touching_escalation
when: "always"
decision: |
ESCALATE IF changed_paths matches ['**/secrets/**', '**/*.pem', '.github/workflows/*secret*']
ALLOW OTHERWISE
reason_code: secret_change_requires_two_approvers
Fork it, change the thresholds to match your environment, and deploy in shadow mode first — it defaults to listen-only so nothing in your live pipeline changes.
Drops into any workflow YAML in one line. Verdicts surface on the PR + the run summary.
# .github/workflows/deploy.yml
- uses: decionis/govern@v1
with:
api-key: ${{ secrets.DECIONIS_API_KEY }}
org-id: ${{ secrets.DECIONIS_ORG_ID }}
workflow-key: github_deploy_approval
mode: shadow # ← every verdict recorded; step never fails
comment-pr: 'true' # ← post verdict + verify URL on the PR