Skip to main content
GitHub GitLab Bitbucket The compliance tool performs comprehensive compliance checks on PR code changes, validating them against security standards, ticket requirements, and custom organizational compliance checklists, thereby helping teams, enterprises, and agents maintain consistent code quality and security practices while ensuring that development work aligns with business requirements.

Setting up custom compliance

Each compliance is defined in a YAML file as follows:
  • title (required): A clear, descriptive title that identifies what is being checked
  • compliance_label (required): Determines whether this compliance generates labels for non-compliance issues (set to true or false)
  • objective (required): A detailed description of the goal or purpose this compliance aims to achieve
  • success_criteria and failure_criteria (at least one required; both recommended): Define the conditions for compliance
  • Avoid overly complex or subjective compliances that are hard to verify
  • Keep compliances focused on security, business requirements, and critical standards
  • Use clear, actionable language that developers can understand
  • Focus on meaningful compliance requirements, not style preferences
For production-ready compliance checklist templates organized by programming languages and technology stacks, check out the PR Compliance Templates repository.

Local compliance checklists

For basic usage, create a pr_compliance_checklist.yaml file in your repository’s root directory containing the compliance requirements specific to your repository. The AI model will use this pr_compliance_checklist.yaml file as a reference, and if the PR code violates any of the compliance requirements, it will be shown in the compliance tool’s comment.

Global hierarchical compliance

Qodo supports hierarchical compliance checklists using a dedicated global configuration repository.

Setting up global hierarchical compliance

1
Create a new repository named pr-agent-settings in your organization or workspace.
2
Build the folder hierarchy in your pr-agent-settings repository:
Note:In this structure, pr-agent-settings, codebase_standards, global, groups, metadata.yaml, and pr_compliance_checklist.yaml are hardcoded names that must be used exactly as shown.All other names (such as frontend_repos, backend_repos, repo_a, monorepo-name, service-a, etc.) are examples and should be replaced with your actual repository and service names.
  • Each folder (including the global folder) can contain a single pr_compliance_checklist.yaml file
  • Organize repository compliance checklists by creating subfolders within the groups folder. Group them by purpose, programming languages, or other categories
3
Define the metadata file metadata.yaml in the root of pr-agent-settings:
4
Set the following configuration:
  1. Global Checklists: Hierarchical compliance from pr-agent-settings repository   a. If the repository is mapped in metadata.yaml, it uses the specified paths and the global compliance checklist
      b. For monorepos, it automatically collects compliance checklists matching PR file paths
      c. If the repository is not mapped in metadata.yaml, global checklists are not loaded
  2. Local Repository Checklist: pr_compliance_checklist.yaml file in the repository   a. Loaded if present in the repository
      b. Content is merged with global checklists (if loaded) to create the final compliance checklist

Configuration options

Usage tips

Blocking PRs based on compliance

You can configure CI/CD Actions to prevent merging PRs with specific compliance labels:
  • Possible security concern - Block PRs with potential security issues
  • Failed compliance check - Block PRs that violate custom compliance checklists
Implement a dedicated GitHub Action to enforce these checklists.