Skip to content

GitHub: Get default code security configurations for an enterprise

GitHub codeSecurity.codeSecurityGetDefaultConfigurationsForEnterprise: arguments, response, policy and SDK examples.

← Code security operations · Get started

Operation github.code_security_get_default_configurations_for_enterprise

Provider route: GET /enterprises/{enterprise}/code-security/configurations/defaults. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/github with npm, or alter-sdk-github with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { GitHubIntegration } from "@alter-ai/github";
async function execute(input: Parameters<GitHubIntegration["codeSecurity"]["codeSecurityGetDefaultConfigurationsForEnterprise"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new GitHubIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.codeSecurity.codeSecurityGetDefaultConfigurationsForEnterprise(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_github import GitHubIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = GitHubIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.code_security.code_security_get_default_configurations_for_enterprise(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.enterprisestringRequired within parent

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get default code security configurations — response body

Referenced models: Get default code security configurations — response body

Get default code security configurations — response body
FieldTypePresenceDescription and constraints
$arrayRootA list of default code security configurations
$[]objectEach item
$[].configurationModelOptionalExpand Get a code security configuration — response body
$[].default_for_new_reposJSONOptionalThe visibility of newly created repositories for which the code security configuration will be applied to by default
Known values: public, private_and_internal, all

Referenced models: Get a code security configuration — response body

Get a code security configuration — response body
FieldTypePresenceDescription and constraints
$objectRootA code security configuration
advanced_securitystringOptionalThe enablement status of GitHub Advanced Security
Known values: enabled, disabled, code_security, secret_protection
code_scanning_default_setupstringOptionalThe enablement status of code scanning default setup
Known values: enabled, disabled, not_set
code_scanning_default_setup_optionsJSONOptional
code_scanning_default_setup_options (anyOf 1)objectAlternativeFeature options for code scanning default setup
code_scanning_default_setup_options (anyOf 1).runner_labelJSONOptional
code_scanning_default_setup_options (anyOf 1).runner_label (anyOf 1)stringAlternativeThe label of the runner to use for code scanning when runner_type is 'labeled'.
code_scanning_default_setup_options (anyOf 1).runner_label (anyOf 2)nullAlternative
code_scanning_default_setup_options (anyOf 1).runner_typeJSONOptional
code_scanning_default_setup_options (anyOf 1).runner_type (anyOf 1)stringAlternativeWhether to use labeled runners or standard GitHub runners.
Known values: standard, labeled, not_set
code_scanning_default_setup_options (anyOf 1).runner_type (anyOf 2)nullAlternative
code_scanning_default_setup_options (anyOf 2)nullAlternative
code_scanning_delegated_alert_dismissalstringOptionalThe enablement status of code scanning delegated alert dismissal
Known values: enabled, disabled, not_set
code_scanning_optionsJSONOptional
code_scanning_options (anyOf 1)objectAlternativeFeature options for code scanning
code_scanning_options (anyOf 1).allow_advancedJSONOptional
code_scanning_options (anyOf 1).allow_advanced (anyOf 1)booleanAlternativeWhether to allow repos which use advanced setup
code_scanning_options (anyOf 1).allow_advanced (anyOf 2)nullAlternative
code_scanning_options (anyOf 2)nullAlternative
created_atstringOptionalFormat: date-time
dependabot_alertsstringOptionalThe enablement status of Dependabot alerts
Known values: enabled, disabled, not_set
dependabot_delegated_alert_dismissalJSONOptional
dependabot_delegated_alert_dismissal (anyOf 1)stringAlternativeThe enablement status of Dependabot delegated alert dismissal
Known values: enabled, disabled, not_set
dependabot_delegated_alert_dismissal (anyOf 2)nullAlternative
dependabot_reachabilitystringOptionalThe enablement status of reachability analysis for Dependabot. Only returned for organizations and enterprises with access to reachability analysis.
Known values: enabled, disabled, not_set
dependabot_security_updatesstringOptionalThe enablement status of Dependabot security updates
Known values: enabled, disabled, not_set
dependency_graphstringOptionalThe enablement status of Dependency Graph
Known values: enabled, disabled, not_set
dependency_graph_autosubmit_actionstringOptionalThe enablement status of Automatic dependency submission
Known values: enabled, disabled, not_set
dependency_graph_autosubmit_action_optionsobjectOptionalFeature options for Automatic dependency submission
dependency_graph_autosubmit_action_options.labeled_runnersbooleanOptionalWhether to use runners labeled with 'dependency-submission' or standard GitHub runners.
descriptionJSONOptional
description (anyOf 1)stringAlternativeA description of the code security configuration
description (anyOf 2)nullAlternative
enforcementstringOptionalThe enforcement status for a security configuration
Known values: enforced, unenforced, enterprise_enforced
html_urlstringOptionalThe URL of the configuration
Format: uri
idJSONOptional
id (anyOf 1)integerAlternativeThe ID of the code security configuration
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
namestringOptionalThe name of the code security configuration. Must be unique within the organization.
private_vulnerability_reportingstringOptionalThe enablement status of private vulnerability reporting
Known values: enabled, disabled, not_set
secret_scanningstringOptionalThe enablement status of secret scanning
Known values: enabled, disabled, not_set
secret_scanning_delegated_alert_dismissalstringOptionalThe enablement status of secret scanning delegated alert dismissal
Known values: enabled, disabled, not_set
secret_scanning_delegated_bypassstringOptionalThe enablement status of secret scanning delegated bypass
Known values: enabled, disabled, not_set
secret_scanning_delegated_bypass_optionsobjectOptionalFeature options for secret scanning delegated bypass
secret_scanning_delegated_bypass_options.reviewersarrayOptionalThe bypass reviewers for secret scanning delegated bypass
secret_scanning_delegated_bypass_options.reviewers[]objectEach item
secret_scanning_delegated_bypass_options.reviewers[].modestringOptionalThe bypass mode for the reviewer
Known values: ALWAYS, EXEMPT
Default: ALWAYS
secret_scanning_delegated_bypass_options.reviewers[].reviewer_idJSONRequired within parent
secret_scanning_delegated_bypass_options.reviewers[].reviewer_id (anyOf 1)integerAlternativeThe ID of the team or role selected as a bypass reviewer
secret_scanning_delegated_bypass_options.reviewers[].reviewer_id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
secret_scanning_delegated_bypass_options.reviewers[].reviewer_typestringRequired within parentThe type of the bypass reviewer
Known values: TEAM, ROLE
secret_scanning_delegated_bypass_options.reviewers[].security_configuration_idJSONOptional
secret_scanning_delegated_bypass_options.reviewers[].security_configuration_id (anyOf 1)integerAlternativeThe ID of the security configuration associated with this bypass reviewer
secret_scanning_delegated_bypass_options.reviewers[].security_configuration_id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
secret_scanning_extended_metadatastringOptionalThe enablement status of secret scanning extended metadata
Known values: enabled, disabled, not_set
secret_scanning_generic_secretsstringOptionalThe enablement status of Copilot secret scanning
Known values: enabled, disabled, not_set
secret_scanning_generic_secrets_push_protectionstringOptionalThe enablement status of generic secrets push protection
Known values: enabled, disabled, not_set
secret_scanning_non_provider_patternsstringOptionalThe enablement status of secret scanning non-provider patterns
Known values: enabled, disabled, not_set
secret_scanning_push_protectionstringOptionalThe enablement status of secret scanning push protection
Known values: enabled, disabled, not_set
secret_scanning_validity_checksstringOptionalThe enablement status of secret scanning validity checks
Known values: enabled, disabled, not_set
target_typestringOptionalThe type of the code security configuration.
Known values: global, organization, enterprise
updated_atstringOptionalFormat: date-time
urlstringOptionalThe URL of the configuration
Format: uri

SDK function policy ID: github.code_security_get_default_configurations_for_enterprise. Catalog operation: code-security/get-default-configurations-for-enterprise. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"X-GitHub-Api-Version": "2026-03-10", "User-Agent": "Alter", "Accept": "application/vnd.github+json"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.