You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GitHub Security-by-Default: Policies and Settings Recommendations
This document provides comprehensive security policy and settings recommendations for GitHub Enterprise Cloud across three hierarchical levels: Enterprise, Organization, and Repository. Following these recommendations will help establish a strong security posture following the principle of "security by default."
Document status
Last reviewed: 2026-05-19
Authorship: Drafted with AI assistance (GitHub Copilot, multi-model review) and reviewed by a human maintainer before publication.
Verify before acting: GitHub and Microsoft update product documentation continuously. Re-confirm against the live source pages before relying on this content for production decisions.
⚠️Important Compliance Note: These recommendations are based on official GitHub documentation and the GitHub Well-Architected Framework. Settings may vary based on your enterprise type (EMU vs. standard), compliance requirements, and organizational needs. Always verify current documentation at docs.github.com before implementing. Some policies behave differently for Enterprise Managed Users (EMU) enterprises vs. standard enterprises.
Enterprise policies provide the highest level of governance and cascade down to all organizations and repositories. Enforcing policies at this level ensures consistent security controls across your entire enterprise.
Identity and Access Management
Level
Policy/Setting
Description
Recommended Setting
Reference
Enterprise
Enterprise Managed Users (EMU)
Centrally managed user accounts controlled through your identity provider
Enable - Use EMU for centralized identity management, ensuring all users are provisioned/deprovisioned through IdP
Restrict - Allow forking only within the same organization or disable if not needed. Note: If EMU blocks user namespace repos and forking is allowed, users cannot fork to their user accounts regardless of this policy
Restrict - Consider restricting or using GitHub Apps instead for better access control. Warning: Changing to disabled will disable existing deploy keys in all repositories
Controls availability of GHAS features (GitHub Secret Protection, GitHub Code Security, GitHub Code Quality (public preview)). Note: GitHub Code Quality is in public preview as of mid-2026; availability and billing may differ from GA products.
Enable for all organizations - Allow organizations to enable advanced security features. Note: This policy only impacts repository administrators; organization owners and security managers can always enable security features
AI-powered security fix suggestions for code scanning results
Enable - Allow Copilot Autofix for code security results. Note: This policy controls Autofix for code scanning security queries only; Copilot Autofix is integral to GitHub Code Quality and cannot be disabled for that feature
Enable - Allow AI detection to find passwords and unstructured secrets. Note: This policy requires that repository administrators are allowed to enable Secret Protection (controlled by a separate policy)
Read-only - Set to read-only for all scopes. Note: Enterprises created on or after February 2, 2023 default to read-only; older enterprises may default to read-write
Require approval for all outside collaborators - Prevent malicious workflow execution. Note: Workflows triggered by pull_request_target events always run regardless of approval settings
Controls creation of repository-level self-hosted runners
Disable - Prevent repository-level self-hosted runners; use org/enterprise level for better security control. Self-hosted runners at repository level pose risks as they may be compromised by untrusted code
Enable - Set maximum lifetime (e.g., 90-365 days) to limit exposure window. Note: For fine-grained PATs, the default maximum lifetime is 366 days. Classic PATs do not have an expiration requirement by default
Organization settings provide granular control within the boundaries set by enterprise policies. These settings should complement enterprise policies while allowing necessary flexibility.
Access and Permissions
Level
Policy/Setting
Description
Recommended Setting
Reference
Organization
Base Repository Permissions
Default access for organization members
No permission or Read - Follow least privilege; use Read for innersource. Note: Internal repositories have a minimum visibility of read even if base permission is set to none
Repository settings provide the most granular control for individual repositories. These should be configured to meet specific project needs while adhering to organization and enterprise policies.
Branch Protection and Rulesets
Level
Policy/Setting
Description
Recommended Setting
Reference
Repository
Ruleset - Require Pull Request
Requires PRs before merging
Enable - Require PRs for default/protected branches
Accuracy review: Added EMU-specific clarifications, updated policy notes for 2FA, workflow permissions, PAT lifetimes, fork restrictions, deploy keys, Copilot Autofix, AI detection, and signed commits
Note: This document should be reviewed and updated regularly as GitHub releases new features and security capabilities. Always refer to the official GitHub documentation for the most current information.