Open Context Protocol is live! 🚀 Read the launch post
codeSecurityGetConfigurationForRepository

codeSecurityGetConfigurationForRepository

Get the code security configuration associated with a repository

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/code-security-configuration
  • Operation ID: code-security/get-configuration-for-repository

Parameters

{
  "owner": {
    "description": "The account owner of the repository. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "repo": {
    "description": "The name of the repository without the `.git` extension. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  }
}

Response Schema

{
  "type": "object",
  "description": "Code security configuration associated with a repository and attachment status",
  "properties": {
    "status": {
      "type": "string",
      "description": "The attachment status of the code security configuration on the repository.",
      "enum": [
        "attached",
        "attaching",
        "detached",
        "removed",
        "enforced",
        "failed",
        "updating",
        "removed_by_enterprise"
      ]
    },
    "configuration": {
      "type": "object",
      "description": "A code security configuration",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The ID of the code security configuration"
        },
        "name": {
          "type": "string",
          "description": "The name of the code security configuration. Must be unique within the organization."
        },
        "target_type": {
          "type": "string",
          "description": "The type of the code security configuration.",
          "enum": [
            "global",
            "organization",
            "enterprise"
          ]
        },
        "description": {
          "type": "string",
          "description": "A description of the code security configuration"
        },
        "advanced_security": {
          "type": "string",
          "description": "The enablement status of GitHub Advanced Security",
          "enum": [
            "enabled",
            "disabled",
            "code_security",
            "secret_protection"
          ]
        },
        "dependency_graph": {
          "type": "string",
          "description": "The enablement status of Dependency Graph",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "dependency_graph_autosubmit_action": {
          "type": "string",
          "description": "The enablement status of Automatic dependency submission",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "dependency_graph_autosubmit_action_options": {
          "type": "object",
          "description": "Feature options for Automatic dependency submission",
          "properties": {
            "labeled_runners": {
              "type": "boolean",
              "description": "Whether to use runners labeled with 'dependency-submission' or standard GitHub runners."
            }
          }
        },
        "dependabot_alerts": {
          "type": "string",
          "description": "The enablement status of Dependabot alerts",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "dependabot_security_updates": {
          "type": "string",
          "description": "The enablement status of Dependabot security updates",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "dependabot_delegated_alert_dismissal": {
          "type": "string",
          "nullable": true,
          "description": "The enablement status of Dependabot delegated alert dismissal",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "code_scanning_options": {
          "type": "object",
          "description": "Feature options for code scanning",
          "nullable": true,
          "properties": {
            "allow_advanced": {
              "nullable": true,
              "type": "boolean",
              "description": "Whether to allow repos which use advanced setup"
            }
          }
        },
        "code_scanning_default_setup": {
          "type": "string",
          "description": "The enablement status of code scanning default setup",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "code_scanning_default_setup_options": {
          "type": "object",
          "description": "Feature options for code scanning default setup",
          "nullable": true,
          "properties": {
            "runner_type": {
              "nullable": true,
              "type": "string",
              "enum": [
                "standard",
                "labeled",
                "not_set"
              ],
              "description": "Whether to use labeled runners or standard GitHub runners."
            },
            "runner_label": {
              "nullable": true,
              "type": "string",
              "description": "The label of the runner to use for code scanning when runner_type is 'labeled'."
            }
          }
        },
        "code_scanning_delegated_alert_dismissal": {
          "type": "string",
          "description": "The enablement status of code scanning delegated alert dismissal",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "secret_scanning": {
          "type": "string",
          "description": "The enablement status of secret scanning",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "secret_scanning_push_protection": {
          "type": "string",
          "description": "The enablement status of secret scanning push protection",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "secret_scanning_delegated_bypass": {
          "type": "string",
          "description": "The enablement status of secret scanning delegated bypass",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "secret_scanning_delegated_bypass_options": {
          "type": "object",
          "description": "Feature options for secret scanning delegated bypass",
          "properties": {
            "reviewers": {
              "type": "array",
              "description": "The bypass reviewers for secret scanning delegated bypass",
              "items": {
                "type": "object",
                "required": [
                  "reviewer_id",
                  "reviewer_type"
                ],
                "properties": {
                  "reviewer_id": {
                    "type": "integer",
                    "description": "The ID of the team or role selected as a bypass reviewer"
                  },
                  "reviewer_type": {
                    "type": "string",
                    "description": "The type of the bypass reviewer",
                    "enum": [
                      "TEAM",
                      "ROLE"
                    ]
                  }
                }
              }
            }
          }
        },
        "secret_scanning_validity_checks": {
          "type": "string",
          "description": "The enablement status of secret scanning validity checks",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "secret_scanning_non_provider_patterns": {
          "type": "string",
          "description": "The enablement status of secret scanning non-provider patterns",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "secret_scanning_generic_secrets": {
          "type": "string",
          "description": "The enablement status of Copilot secret scanning",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "secret_scanning_delegated_alert_dismissal": {
          "type": "string",
          "description": "The enablement status of secret scanning delegated alert dismissal",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "private_vulnerability_reporting": {
          "type": "string",
          "description": "The enablement status of private vulnerability reporting",
          "enum": [
            "enabled",
            "disabled",
            "not_set"
          ]
        },
        "enforcement": {
          "type": "string",
          "description": "The enforcement status for a security configuration",
          "enum": [
            "enforced",
            "unenforced"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the configuration"
        },
        "html_url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the configuration"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('github')

# Call this tool
result = await agent.call_tool('codeSecurityGetConfigurationForRepository', {
    # Add required parameters here
})