Code Criteria group your repositories and their connected runtime/deployment assets to automatically generate Business Applications based directly on your VCS structure. This criteria type is most commonly used by organizations that follow code-centric ownership models.
Criteria are dynamic automated rule sets (patterns) to create and maintain applications that scale with your development. As developers create new repositories that match your criteria, the system automatically recognizes and onboards these repositories without any manual intervention.
You can create criteria to group assets by your VCS hierarchy at the organization, project, or repository level. A single Code Criteria can target multiple VCS provider types (for example, GitHub, GitLab, and Bitbucket), and unify same-named applications across those providers. Each provider covers both the cloud and self-managed variants; for example, GITHUB includes assets from both GitHub Cloud and GitHub Enterprise integrations.
You can create Code Criteria using two available workflows: the tenant UI or the API. The steps below outline the tenant UI workflow.
Prerequisites
Data source: Your Version Control System (such as GitHub, GitLab) must already be onboarded as a Data Source with at least one onboarded repository
RBAC role: You must have the AppSec Admin role, or a custom role with
read/writeaccess to application resources on ASPM (Criteria and Applications). Account Admin also has sufficient permissions but is broader than requiredSBAC: You can only create applications from VCS entities (Organizations, Projects, or Repositories) that are already included in your SBAC Asset Groups
Under Modules, select → , then open the Application Criteria tab and select .
Configure the General step.
Select Code as the Criteria type.
Provide a Criteria name (required) and description.
Click .
Configure the Define Criteria step.
The Define Criteria step determines how matching assets group into applications. These settings control whether an application is defined as a single repository or a broader organization, and how the system handles assets with identical names across your environment. Connected runtime and deployment assets are automatically linked to these boundaries to provide a complete view of the application lineage.
Select one or more VCS provider tiles to include in the Criteria: GitHub, GitLab, Bitbucket, Azure Repos, or AWS CodeCommit. Only providers with active integrations appear as selectable tiles.
Inside each selected provider tile, select a Group by level from the dropdown. The Group by level is configured per provider tile, so different providers in the same Criteria can use different grouping levels.
Organization: Group all repositories under the same VCS organization into one application
Project: Group all repositories under the same VCS project into one application
Repository: Create one application per repository
Merge organizations/projects/repositories with identical names (optional): The engine merges applications with the same name from the same VCS provider into one application .
Example use case: Two projects in the same GitHub organization expose repositories with identical names that represent the same logical application. For a working example, refer to Example: Merge within a provider below.
Tip
Recommended: When creating your first Code Criteria, enable Merge organizations/projects/repositories with identical names unless you know that repositories with the same name across platforms must remain separate. When this toggle is off and the engine encounters identically named sources, every generated application name is automatically suffixed with the provider name (for example,
payments-api_GitHub), and any remaining collisions receive an additional UTC timestamp suffix in the formatMM_DD_YY_HH:MM:SS(for example,payments-api_GitHub_05_31_26_07:42:18). Warning: Because Criteria are immutable, consolidating these into one application later requires deleting and recreating the Criteria.Unify applications across providers (optional): The engine merges applications with the same name from different VCS providers into one application. Available only when the Criteria targets more than one provider type; enabling it auto-enables and locks the first toggle.
Example use case: The organization is migrating between VCS providers (for example, Bitbucket to GitHub) or runs the same application's source across multiple VCS systems. For a working example, refer to Example: Unify across providers
Click .
Note
To understand how the system treats cloud and self-managed environments as a single provider, or how it merges applications across different VCS providers, see Reference: Advanced Unification Logic.
Configure the Scope step.
The Scope step defines which assets the Criteria evaluates. Use Scope filters to include or exclude specific organizations, projects, or repositories within each provider.
The Scope step displays one tab per selected provider tile from the Define Criteria step. Each tab is an independent filter expression for that provider. A tab left without filters includes every asset for that provider at the Group by level selected for that provider in the Define Criteria step.
Scope is dynamic. The engine re-evaluates filter matches on every refresh, so newly matching assets join automatically and assets that stop matching drop out.
How filters and tabs combine: Scope has three independent combination layers. The engine applies them in order: layer 1 inside each filter row, layer 2 across filter rows in the same tab, layer 3 across tabs.
Layer
Where
Combinator
Effect
1
Within one filter (multiple values in the same field)
ORThe asset matches if any listed value matches. Example: Organization Name Equal
payments,billingmatches an asset whose organization is eitherpaymentsorbilling2
Within one tab (multiple filter rows on different fields)
ANDThe asset matches only if every filter row in that tab matches. Example: Organization Name Contains
paymentsAND Repository Name Containsapimatches an asset only when both conditions are true3
Across tabs (one tab per provider)
OR(union)The asset matches if any one tab's full configuration (provider + Group by level + filters) matches. Adding more tabs widens scope; it never narrows it
For a worked walkthrough across multiple providers — including the case where one tab carries strict filters and another is left empty, refer to Example: Multi-provider scoping with filters.
Select the provider tab you want to filter.
The tab name reflects the provider and its Group by level chosen in Step 2 (for example, GitHub — Repository). Repeat steps 4b-4d for each provider tab that requires filters. Tabs left without filters include all assets for that provider.
Note
A provider tab with no filters configured includes every asset for that provider at the chosen Group by level. Combined with the union behavior above, leaving multiple tabs unfiltered means the Criteria includes every connected asset across all selected providers , which is often the desired result for an organization-wide baseline Criteria, but can produce a large application count if used without intent. Use filters on tabs where the scope needs to be narrowed.
Select the filter field to narrow assets by:
Repository Name : Available at all Group by levels
Organization Name: Available when the tab's Group by level is Organization, Project, or Repository
Project Name: Available only when the provider supports projects (GitLab, Bitbucket, Azure Repos) and the tab's Group by level is Project or Repository
Note
Field availability is driven by the active tab's Group by level and provider capability. Fields that do not apply to the active tab are not displayed.
Choose an operator for the selected field: Equal, Not Equal, Contains, or Not Contains.
Enter one or more filter values.
Multiple values within the same filter combine with
ORlogic; multiple filters across fields combine withANDlogic.Click .
For an example of Multi-provider scoping with filters, refer to Example: Multi-provider scoping with filters below.
Configure the Metadata step.
Configure rules to automatically assign ownership and risk levels to the generated applications.
Business Owner (required): Select the VCS hierarchy level from which to inherit ownership for every generated application. Options include None, Organization Owner, Project Owner, or Repository Owner (inherit the owner from the VCS repository).
Configure Business Criticality:
Select a default severity level: Critical, High, Medium, Low.
(Optional): Automatically upgrade criticality to Critical if a mapped asset is exposed to the internet: Enable this checkbox to elevate the criticality of internet-exposed assets to Critical, ensuring accurate risk prioritization.
The business criticality level feeds the Urgency calculation for every issue associated with the generated applications.
Click .
Cortex Cloud will begin processing your criteria. Navigate to the Business Applications list to verify that your new applications have been generated and populated with assets.
Examples: Grouping and unification
The procedure above references the following worked examples. For the exhaustive toggle-combination matrix and the cloud-vs-self-managed deployment rules refer to Reference: Advanced unification logic (Code Criteria) below.
Example: Merge within a provider
This example illustrates the Merge organizations/projects/repositories with identical names option on a Criteria that targets a single VCS provider.
Scenario: A Code Criteria targets GitHub with Group by = Repository. The GitHub organization acme-eng contains two projects, each exposing a repository named payments-api.
Inputs
Provider | Organization | Project | Repository |
|---|---|---|---|
GitHub |
|
|
|
GitLab |
|
|
|
Result
Merge toggle | Applications produced |
|---|---|
Off | Two applications named `payments-api` — one per source repository |
On | One application named `payments-api` containing both repositories and their connected runtime assets |
Example: Unify across providers
This example illustrates the Unify applications across providers option on a Criteria that targets two VCS provider types.
Scenario: A Code Criteria targets GitHub and GitLab with Group by = Repository on both tiles. Each provider hosts a repository named payments-api
Inputs
Provider | Organization / Group | Repository |
|---|---|---|
GitHub |
|
|
GitLab |
|
|
Result
Merge toggle | Unify toggle | Applications produced |
|---|---|---|
Off | Off | Two applications: |
On | Off | . |
On | On | One application named |
Note
Enabling Unify applications across providers auto-enables and locks the Merge organizations/projects/repositories with identical names option, so the Off / On combination is not reachable. For the full matrix and edge cases, refer to Reference: Advanced unification logic (Code Criteria).
Example: Multi-provider scoping with filters
This example illustrates the Scope step on a Code Criteria that targets three providers with different Group by levels and different per-tab filters
Scenario: A single Code Criteria selects GitHub, GitLab, and Bitbucket. Each provider tab is configured independently:
GitHub tab: Group by = Organization, filter: Organization Name Contains payments
GitLab tab: Group by = Repository, filter: Repository Name Equal api-gateway
Bitbucket tab: Group by = Project, no filter
Result: Effective scope is the union of the three expressions
Tab | Included assets |
|---|---|
GitHub | Every repository under any GitHub organization whose name contains payments, grouped per organization |
GitLab | Every GitLab repository named exactly api-gateway, one application per matching repository |
Bitbucket | Every repository under every Bitbucket project the tenant has connected, grouped per project (no filter restricts the set) |
A repository that matches the GitHub filter is included even if it does not appear in GitLab or Bitbucket. A Bitbucket repository is included regardless of name because the Bitbucket tab has no filter. The three result sets do not intersect; they are added together. If unification toggles are enabled in Step 3, identically named applications produced by different tabs subsequently merge per the rules described in Reference: Advanced unification logic (Code Criteria) below.
Reference: Advanced unification logic (Code Criteria)
When configuring grouping and unification in the Define Criteria step, specific rules govern cross-provider dependencies, deployments of the same provider type, and how different toggle combinations determine your final application boundaries.
The Unify applications across providers toggle is available only when your Criteria targets more than one VCS provider type. Activating this toggle automatically turns on and locks the Merge organizations/projects/repositories with identical names setting, since cross-provider unification requires within-provider merging to happen first.
Provider unification configuration options
Consider a tenant setup with GitHub Cloud (organizations acme-eng, acme-research), GitHub Enterprise (organization acme-legacy), and GitLab (group acme-platform). The user selects Repository grouping on the GitHub tile and Project grouping on the GitLab tile. A repository named payments-api exists across all three environments.
The engine produces the following results based on your configuration:
Merge toggle | Unify toggle | Expected result |
|---|---|---|
OFF | OFF | Three separate applications (one per repository). Each repository's unique asset ID keeps it separate. The same behavior applies when only one provider type is selected and the Merge organizations/projects/repositories with identical names toggle is OFF |
ON | OFF | Two applications. The first application combines GitHub Cloud and Enterprise (merged because they act as a single provider tile). The second application isolates GitLab because cross-provider unification is OFF |
ON | ON | One single application. All three repositories collapse into a unified application boundary across all providers |
OFF | ON | Not reachable. The UI automatically enables and locks the Merge toggle whenever cross-provider unification is enabled, making this state impossible to submit via the Console or API. |
Cloud and self-managed deployments of the same VCS
The Unify applications across providers toggle becomes available only when the Define Criteria step shows two or more separate provider tiles with a group-by selected (for example, mixing GitHub and GitLab).
Because Cortex Cloud and self-managed deployments of the same provider (for example, GitHub Cloud and GitHub Enterprise) collapse into one tile, this toggle stays disabled for the pair. It is not needed, because the Merge organizations/projects/repositories with identical names toggle already merges assets across those deployments within that single tile.
Warning
If two unrelated organizations with identical names exist across your cloud and self-managed deployments and must remain separate applications, do not enable within-provider merging. Instead, define one Criteria per deployment scope using filters on Organization Name to isolate the content.