﻿---
title: Cross-project search and detection rules
description: Learn how detection rules work with cross-project search to query data across linked projects.
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/solutions/security/detect-and-alert/cross-project-search-detection-rules
products:
  - Elastic Security
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Unavailable
---

# Cross-project search and detection rules
When [cross-project search](https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/explore-analyze/cross-project-search) is enabled and you have [linked projects](https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/deploy-manage/cross-project-search-config/cps-config-link-and-manage), rules query data across linked projects based on the **space-level cross-project search scope**.
For how cross-project search applies when you create or edit rules (space-level scope, the read-only scope selector, and query-level overrides) refer to [Cross-project search availability by app](/elastic/docs-content/tree/main/explore-analyze/cross-project-search/cross-project-search-manage-scope#cps-availability).
For prerequisites such as linking projects and configuring default scope, refer to [Cross-project search](https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/explore-analyze/cross-project-search) and [Configure cross-project search access and scope](https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/deploy-manage/cross-project-search-config/cps-config-access-and-scope).
<note>
  Machine learning rules don't support cross-project search; they search data in the origin project only. Other features also have limited or no cross-project search support. For details, refer to [Cross-project search availability by app](/elastic/docs-content/tree/main/explore-analyze/cross-project-search/cross-project-search-manage-scope#cps-availability).
</note>