feat: add CI/CD pipeline policy template with intent fixtures#110
feat: add CI/CD pipeline policy template with intent fixtures#1104444J99 wants to merge 1 commit intoClyra-AI:mainfrom
Conversation
Add a starter policy template for AI agents operating inside CI/CD pipelines. The template covers five verdict paths: - allow: artifact reads, staging deploys - block: production deploys, infrastructure destruction - require_approval: secret access, infrastructure provisioning Includes five deterministic intent fixtures, CI validation cases in policy_compliance_ci.sh, and documentation in the policy README.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5435747fc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| priority: 10 | ||
| effect: allow | ||
| match: | ||
| tool_names: [artifact.read, artifact.download, artifact.list, tool.read] |
There was a problem hiding this comment.
Narrow read allowlist to artifact-specific tools
Including tool.read in the artifact-read rule allows any generic read call at low/medium risk, not just artifact access. In adapters that surface secret or vault retrieval as tool.read, those requests bypass the require-approval-secret-access rule and are approved as allow, which weakens the template’s stated secret-access guardrail. Restrict this rule to artifact-specific tool names (or add strict target/path constraints) so non-artifact reads do not auto-pass.
Useful? React with 👍 / 👎.
| tool_names: [deploy.apply, deploy.push] | ||
| risk_classes: [medium] | ||
| workspace_prefixes: [/ci/staging, /deploy/staging] |
There was a problem hiding this comment.
Constrain staging deploys by destination scope
The staging deploy allow rule only checks tool name, risk class, and workspace prefix, so a request can still target production infrastructure while presenting workspace as /ci/staging and risk_class as medium, and it will be allowed. Because this rule does not validate destination/target scope, it can authorize production deploy behavior under a staging label; add destination constraints (allowlist/denylist) to enforce true staging-only deploys.
Useful? React with 👍 / 👎.
Context
AI agents operating inside CI/CD pipelines present distinct risk surfaces:
production deployments, secret access, infrastructure mutation. The existing
policy templates cover risk tiers (low/medium/high), knowledge workers,
endpoint constraints, and skill provenance, but no template addresses the
CI/CD pipeline domain specifically.
What this adds
A starter policy template (
examples/policy/ci_cd_pipeline.yaml) with fivedeterministic intent fixtures demonstrating all three verdict paths:
allow: artifact reads (artifact.readat low risk), staging deploys(
deploy.applyscoped to staging workspace prefixes)block: production deploys (deploy.applyat critical risk scoped toproduction workspaces), infrastructure destruction (
infra.destroy,db.drop, etc.)require_approval: secret/vault access (secret.read,vault.readathigh/critical risk), infrastructure provisioning (
infra.create,infra.updaterequiring 2 distinct approvers)The policy uses
fail_closedon critical risk class with required targetsand arg_provenance fields. Default verdict is
block.Files added:
examples/policy/ci_cd_pipeline.yamlexamples/policy/intents/intent_ci_read_artifact.jsonexamples/policy/intents/intent_ci_deploy_staging.jsonexamples/policy/intents/intent_ci_deploy_production.jsonexamples/policy/intents/intent_ci_secret_access.jsonexamples/policy/intents/intent_ci_infra_destroy.jsonFiles modified:
examples/policy/README.md(document new template and expected verdicts)scripts/policy_compliance_ci.sh(add 5 test cases + 1 validate case)Validation
go build -o ./gait ./cmd/gaitbash scripts/policy_compliance_ci.sh(all 21 cases pass)go test ./...(all packages pass)intent_ci_read_artifact.json=> exit0(allow)intent_ci_deploy_staging.json=> exit0(allow)intent_ci_deploy_production.json=> exit3(block)intent_ci_secret_access.json=> exit4(require_approval)intent_ci_infra_destroy.json=> exit3(block)gait policy validate examples/policy/ci_cd_pipeline.yaml --json=> exit0