Skip to Content
FeaturesPolicies

Policies

Policies define your organization’s security standards. They control scan behavior, quality gates, notification rules, and enforcement across all repositories.

Policy Levels

Policies are configured at two levels:

  1. Organization policies — apply to every repository in the org
  2. Repository overrides — override specific fields for a single repo

When a repository has an override, that value takes precedence. All other fields fall back to the organization default.

Configuration

Navigate to Settings → Policies to manage policies.

Scan Settings

FieldTypeDefaultDescription
default_scan_typesmart / deepsmartDefault scan type for manual and scheduled scans
auto_scan_on_pushbooleanfalseTrigger a scan automatically when code is pushed
scan_on_prbooleantrueTrigger PR review on pull request events
scan_branchesstring[]["main"]Branches that trigger auto-scans
exclude_pathsstring[][]Glob patterns to exclude from scanning (e.g., test/**, vendor/**)
scanners_enabledstring[]allWhich scanners to run: sast, sca, secrets, iac, container

Quality Gate

FieldTypeDefaultDescription
gate_enabledbooleantrueWhether the quality gate is enforced
max_criticalinteger0Maximum critical findings allowed to pass
max_highinteger5Maximum high findings allowed to pass
max_risk_scoreinteger50Maximum PR risk score allowed to pass
require_no_secretsbooleantrueBlock if any secrets are detected
require_no_new_critical_cvesbooleantrueBlock if new critical CVEs are introduced

Notifications

FieldTypeDefaultDescription
notify_on_criticalbooleantrueSend email/Slack on critical findings
notify_on_gate_failbooleantrueNotify when a quality gate fails
notify_on_scan_completebooleanfalseNotify on every scan completion
notification_channelsstring[]["email"]Channels: email, slack
notification_recipientsstring[]org adminsEmail addresses or Slack channels

Compliance & Retention

FieldTypeDefaultDescription
compliance_frameworksstring[][]Enabled frameworks: soc2, iso27001
retention_daysintegerplan defaultDays to retain scan results
require_sbombooleanfalseGenerate SBOM on every deep scan
auto_remediationbooleanfalseAutomatically create fix PRs for critical issues

Inheritance Model

Organization Policy (base) └── Repository Override (specific fields only) └── Effective Policy (merged result)

When evaluating a policy for a repository:

  1. Start with the organization policy as the base
  2. Apply any repository-level overrides on top
  3. The merged result is the effective policy

Only fields explicitly set at the repository level override the org default. Unset fields inherit from the org.

Viewing Effective Policy

On any repository’s settings page, the Effective Policy section shows the merged result with indicators showing which values are inherited vs. overridden.

API Access

Retrieve or update policies via the API:

# Get org policy curl -H "X-API-Key: $CODESTAX_API_KEY" \ https://codestax.co/api/v1/policies/org # Update org policy curl -X PATCH -H "X-API-Key: $CODESTAX_API_KEY" \ -H "Content-Type: application/json" \ -d '{"max_critical": 0, "auto_scan_on_push": true}' \ https://codestax.co/api/v1/policies/org # Set repo override curl -X PATCH -H "X-API-Key: $CODESTAX_API_KEY" \ -H "Content-Type: application/json" \ -d '{"default_scan_type": "deep", "exclude_paths": ["docs/**"]}' \ https://codestax.co/api/v1/policies/repo/123

Permissions

ActionRequired Role
View org policyMEMBER or above
Edit org policyORG_ADMIN or above
View repo overrideMEMBER or above
Edit repo overrideORG_ADMIN or above