GitHub Enterprise Controls
GitHub Enterprise is where AI coding features, secrets, code scanning and workflow tokens are switched on, delegated or refused. The controls are few and blunt. Most of the design work is deciding at which level each one lives, and what evidence it leaves behind.
This page is scoped to GitHub Enterprise Cloud. Where a control is not available on GitHub Enterprise Server, the page says so once rather than implying parity with an empty cell in a table somewhere.
Where each control lives
Settings sit at three levels: enterprise, organisation and repository. Enterprise policy is set by an enterprise owner, organisation settings by organisation owners, repository settings by whoever administers the repository. The AI features live in the enterprise's AI controls, split across Agents, Copilot, Configure features and clients, and MCP.
Conflicts resolve mostly in favour of the least restrictive setting. A named set of sensitive settings resolves the other way, most restrictive, and across several enterprises the most restrictive wins. So the enterprise value is not the answer to what applies: for an ordinary feature, a permissive organisation setting can widen what the enterprise intended.
| Setting | Level | What it enforces |
|---|---|---|
| AI feature enablement | Enterprise, delegable to organisations | Which agent, Copilot, client and MCP features exist for the account |
| Managed settings | Enterprise | Permission rules, sandbox behaviour, MCP server lists and telemetry |
| Secret scanning and push protection | Repository and user | Alerts on public repositories; push protection off by default per repository, on per user |
| Custom patterns | Organisation or enterprise | Extra patterns, 500 per organisation or enterprise and 100 per repository |
| Code scanning and dependency review | Repository | Default setup needs Actions and public visibility or Code Security; dependency review needs the graph |
| Rulesets | Repository and organisation | Merge-time gates, including the scanning rules below |
| Actions token and allowed actions | Organisation and enterprise | The workflow token's default permission, and which actions may run |
| Audit log | Enterprise | Policy changes, bypasses and agent activity, retained 180 days |
GitHub Enterprise Server is a different product for this purpose. Copilot policies and managed settings are not available on Enterprise Server, so an estate running its own server cannot govern AI coding features through the controls in this page. A different menu does not help, and neither does a renamed setting. That estate governs code, secrets and Actions with the controls it has, and assistant governance moves to the repository, the network and the endpoint policy on the pages either side of this one.
Governing AI coding features
The AI controls expose per-feature enable and disable switches, and that is the whole granularity of the surface. The switches exist by display name only; no REST or GraphQL identifier is documented, so there is no field name to script against and none is printed here. Anything automated drives the interface, and the audit log is the record of who changed what.
Where the enterprise has left a feature at No policy, which is the delegation state and not an enabled one, the organisation decides. Where both set a value, the resolution is mostly least restrictive, with the named sensitive set most restrictive. A control matrix that assumes the enterprise always wins mis-describes an estate on almost every row but the sensitive ones.
Below the switches sits the managed settings file, managed-settings.json, which carries the
rules the agent itself has to obey. The keys that matter:
| Key | What it decides |
|---|---|
permissions.disableBypassPermissionsMode |
Whether bypass mode can be entered at all |
permissions.deny, ask, allow |
The rule lists, evaluated with deny above ask above allow |
permissions.defaultMode |
The mode a session starts in |
sandbox.* |
Sandbox behaviour for command execution |
allowedMcpServers, deniedMcpServers |
Which MCP servers the agent may connect to |
telemetry |
What the agent reports and where |
A rule is written with a selector rather than a bare string: Shell() and
Bash() for command execution, PowerShell() for the Windows shell,
Read() for file reads, Edit() and Write() for modification,
Domain() for hosts the agent reaches. The argument in the parentheses narrows the selector
to the command, path or host.
Precedence is deny, then ask, then allow. A rule in both deny and allow is denied, so the safe shape is a broad allow with deny subtracting from it, never the reverse where a broad deny is expected to be overridden by a narrow allow. The other order reads permissively and behaves restrictively.
Two controls, two failure directions
The MCP keys are the cheapest lever in the file and the least complete: they decide which servers are reachable by name, not what a permitted server may do with what it is given. An inventory control with a known edge, not a boundary.
Secret scanning and push protection
The accurate answer to whether push protection is on by default is: for users yes, for repositories no. User-level push protection is on by default for public repositories on GitHub.com. Repository-level push protection is off by default and needs Secret Protection. Secret scanning alerts appear on public repositories, and organisation-owned repositories need Secret Protection for either half to apply.
That split is where estates lose the control. The people are covered and the repositories holding the credentials are not, so the organisation concludes it has push protection because a developer's own push was blocked once. Enumerate the repositories rather than the users: the ones that matter are private, organisation-owned, and off until somebody turns them on.
A bypass is not silent, which is the part worth relying on: it requires a reason, raises an alert and writes an audit event. So the review is a person reading reasons, and the control is only as good as they are. A reason that says false positive without naming the pattern cannot be revisited.
Custom patterns extend coverage: Hyperscan regular expressions with separate fields for the secret and for the text before and after it, up to 500 per organisation or enterprise and 100 per repository, with push protection enableable per pattern. Adding a pattern and enabling prevention for it are two decisions, and an organisation that adds thirty patterns without the second has detection, not prevention.
# A committed record of the decisions. The switches themselves are set in
# repository and organisation settings; this file is the audit trail that says
# which defaults apply and which repository had to be changed by hand.
secret_scanning:
alerts:
public_repositories: on
organisation_repositories: requires_secret_protection
push_protection:
repositories:
default: off
change_requires: secret_protection
users:
default: on
scope: public_repositories_on_github_com
bypass:
reason: required
record: alert_and_audit_event
custom_patterns:
syntax: hyperscan
fields: secret_before_after
limit_organisation: 500
limit_repository: 100
push_protection_per_pattern: trueCode scanning and default setup
Default setup is the documented starting point, and it has two prerequisites: Actions has to be available, and the repository has to be either public or covered by Code Security. Where either is missing, default setup is not offered and the alternative is a workflow you write and maintain yourself.
The trade between the two is ownership, not capability. A managed configuration is changed by the platform and needs no workflow in the repository; a workflow is changed by you, which is right when the analysis needs a build step the managed setup does not perform, and wrong when the reason is that nobody wanted to look after a YAML file. Either way the alerts land in the same place, which is what the merge gate reads.
Dependency review is the adjacent control and needs the dependency graph. The action is available on public repositories or on repositories with Code Security, and enforcing it across an organisation is a documented how-to rather than a switch. Its value is narrow and real: it refuses a pull request that introduces a vulnerable dependency, at the moment it is introduced, rather than reporting it later against a merged default branch.
Rulesets and required checks
The rules below turn the platform's own findings into merge gates. Require code scanning results blocks a merge on alert severity, on an analysis still in progress, or on a tool that is not configured. Require secret scanning alerts are resolved blocks a merge while an alert the pull request introduced is open, and until a secret scan completes for the head commit. Require an additional approval for unattributed Copilot pull requests adds a human decision to a pull request the agent identity did not author, which is a review gate rather than a scanning one.
The first rule has a consequence people discover late: on a repository where scanning is not configured, the rule does not pass quietly, it blocks. The behaviour is intended, and it means the order of operations is scanning first, rule second; otherwise the gate takes out merges for a reason nobody can fix from the pull request.
There is no rule that gates on Copilot Autofix state, which is worth saying plainly because it is natural to assume. The gate reads the code scanning alert: an Autofix suggestion sitting unmerged leaves the alert open, so the merge stays blocked. Autofix removes some of the work of clearing an alert and none of the obligation.
Organisation-level rulesets are available on Team and Enterprise plans, and the limits are 75 rulesets per repository and 75 per organisation. The cap is not a design constraint until an estate generates a ruleset per team; at that point an organisation ruleset plus a few repository-specific ones stays inside it.
{
"name": "default-branch-protection",
"target": "branch",
"enforcement": "active",
"conditions": {
"ref_name": {
"include": ["~DEFAULT_BRANCH"],
"exclude": []
}
},
"rules": [
{ "type": "Require code scanning results" },
{ "type": "Require secret scanning alerts are resolved" },
{ "type": "Require an additional approval for unattributed Copilot pull requests" }
],
"bypass_actors": [
"Repository admin",
"Team: release-engineering"
]
}The rule names above are the interface's names, and the bypass list is short enough to read. Each bypass entry also carries a mode in the editor: bypass always, or only through a pull request. Export the ruleset you build rather than transcribing it; the export is the authority for the wire field names.
Hardening Actions
The default permission of the workflow token depends on when the enterprise, organisation or personal repository was created: on or after 2023-02-02 it defaults to read-only, and before that date it defaults to read and write. A repository owned by an organisation inherits the organisation's setting whatever the repository's own age. Nothing announces the second case, so an estate is a mixture, and the only way to know which repositories are in which half is to read the setting at each level.
The default is a floor, not a ceiling. Anyone with write access to a repository can still change the permissions block in a workflow file and ask for more, so the default protects the repository from the workflow nobody wrote, the one added by a template, a generator or a dependency, and protects nothing from a contributor who has already decided what the workflow should have. Review covers that, which is why the allowed-actions mode matters as much as the token default.
The allowed-actions modes include one that requires actions to be pinned to a full-length commit SHA. The SHA-pinning mode is the strongest for third-party actions, because a tag can be moved after review and a SHA cannot. It changes the maintenance rhythm too: every action bump becomes an explicit, reviewed change.
Actions policies can also add actor and event rules. A default policy that blocks
pull_request_target in public repositories is enforced from 2026-12-02. The trigger is
dangerous structurally, because it runs in the base repository's context with the base repository's
token, so the useful work before that date is to find every workflow that uses it and decide whether the
base-context token is needed at all.
name: verify
on: [pull_request]
permissions:
contents: read
jobs:
build:
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@<full-length-commit-sha>
- run: npm ci && npm testTwo details are the point. The permissions block is written down rather than inherited, so a change to it is visible in review. The action reference is a placeholder for a full-length SHA on purpose. Printing a real one would print a value that goes stale, and the SHA you pin has to be the one you verified.
The audit log is the evidence
Most of what this page describes leaves a record. The audit log can be searched by action and by actor,
so action:copilot finds Copilot activity and actor:Copilot finds activity
performed by the agent identity. Policy changes, push protection bypasses and agent actions are the
three things an investigation asks for first, and all three are queryable.
Retention is 180 days, which decides the design: anything that must be answerable for longer has to leave the platform, and a review starting after an incident is already too late to reconstruct last year's policy state.
What the audit log does not contain
What AI-generated code changes about review
An assistant lowers the cost of producing a plausible diff. It does not lower the cost of reading one, or the cost of being wrong. So the volume arriving at review rises while the capacity to review it stays where it was, and the reviewer becomes the remaining control in the chain.
Which is why the ruleset deserves more attention than the model: it is enforced on every merge regardless of which assistant wrote the code or whether anyone knows, whereas a model choice changes behaviour at the margin and leaves no gate behind. Where the two are in tension, the gate is what survives a change of tooling.
The uncomfortable part is that the human control degrades silently. Review capacity that is exceeded produces no error. It produces faster approvals, shallower reading and a backlog absorbed by people working later. Watching merge latency and review depth is part of operating the control set, not a management metric bolted onto it. A gate that requires a human decision, such as the extra approval for unattributed agent pull requests, moves work rather than removing it, so scope it to the repositories where the risk justifies the queue.
Practice Lab
Enable push protection on a personal repository you own and try to push a commit containing a synthetic secret. Done when the push is blocked and you can point at the record: the block message, the reason the bypass demands, and the alert and audit event the bypass raises. Delete the branch afterwards — the secret never needed to be real.
Related Topics
VS Code as a Managed Endpoint
The editor-side controls that decide what reaches the repository
OpenCode and Other IDEs
What still applies when the editor is outside central policy
GitHub Actions Security
The exploitation detail behind the Actions hardening above
Secrets Scanning
Discovery techniques that complement push protection