Skip to content

feat: cross-reference existing Network and Data tests into AI pillar#1234

Open
praneeth-0000 wants to merge 5 commits into
devfrom
show-existing-tests-AI-pillar
Open

feat: cross-reference existing Network and Data tests into AI pillar#1234
praneeth-0000 wants to merge 5 commits into
devfrom
show-existing-tests-AI-pillar

Conversation

@praneeth-0000
Copy link
Copy Markdown
Contributor

@praneeth-0000 praneeth-0000 commented May 22, 2026

Cross-reference tests across pillars

Adds support for tests to declare multiple pillars, enabling existing Network and Data tests to surface on the AI pillar page without duplicating test logic.

Problem

The AI pillar assessment previously only showed AI-specific tests. Several existing Network and Data tests are directly relevant to AI security posture (e.g. AI Gateway prompt injection protection, Conditional Access for AI workloads), but had no way to appear on the AI pillar page.

Solution

The [ZtTest()] attribute's Pillar property is changed from [string] to [string[]], allowing a test to declare membership in multiple pillars. Restriction logic in Get-ZtAssessmentResults then controls which pillars are visible based on how the assessment was invoked.

Behavior

Invoke-ZtAssessment -Pillar All (default, no preview)

Cross-referenced tests run and appear on their original pillar pages only. The AI pillar page remains empty.

image

Pillar All - AI page empty


Invoke-ZtAssessment -Pillar All -Preview

The AI pillar page now shows both cross-referenced tests (from Network and Data) and AI-only tests. Cross-referenced tests also continue to appear on their original pillar pages.

Pillar All Preview - AI page with cross-ref and AI-only tests

Network and Data cross-referenced tests on the AI page:

Network and Data tests on AI page

AI-only tests on the AI page:

AI-only tests


Invoke-ZtAssessment -Pillar AI

Only the AI pillar runs. Both cross-referenced tests and AI-only tests appear exclusively on the AI pillar page.

Pillar AI - cross-ref and AI-only tests

Pillar AI - full list


Tests cross-referenced to AI

Test Original Pillar Reason
25415 — AI Gateway prompt injection protection Network Directly protects AI workloads via GSA
35001–35041 (32 tests) — Conditional Access, Purview, RMS Data Data protection controls are critical for AI data pipelines

Files changed

PowerShell module

  • classes/ZtTest.ps1Pillar type: [string][string[]]
  • public/Get-ZtTest.ps1 — array-safe pillar filter
  • private/tests/Invoke-ZtTests.ps1 — array-safe stable-pillar filter; stores RequestedPillar for post-run restriction
  • private/core/Get-ZtAssessmentResults.ps1 — restriction logic: sets TestPillar based on -Pillar argument and preview flag
  • private/core/Clear-ZtModuleVariable.ps1 — resets RequestedPillar on each new assessment
  • tests/Test-Assessment.25415.ps1Pillar = ('Network', 'AI')
  • tests/Test-Assessment.350*.ps1 (32 files) — Pillar = ('Data', 'AI')

React report

  • src/config/report-data.tsTestPillar: string | string[] | null
  • src/components/test-table/data-table.tsxArray.isArray check for pillar filtering

Routing rules based on how the assessment is invoked:
  -Pillar AI           -> test appears only on AI page
  -Pillar All -Preview -> test appears on all tagged pages
  -Pillar All          -> AI stripped, test on its original pillar only
@praneeth-0000 praneeth-0000 self-assigned this May 22, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables “cross-referenced” tests to appear under multiple pillars (notably adding existing Network/Data tests into the AI pillar) by allowing multi-pillar metadata in PowerShell and updating the report UI/data model to handle TestPillar as either a string or an array.

Changes:

  • Expand report model and UI filtering to support TestPillar as string | string[] | null.
  • Update PowerShell test metadata (ZtTest.Pillar) and selection/filtering logic to support multi-pillar tests.
  • Add assessment-result post-processing to restrict multi-pillar TestPillar output based on the requested pillar / preview mode behavior.

Reviewed changes

Copilot reviewed 40 out of 41 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/report/src/config/report-data.ts Widens TestPillar typing to support multi-pillar arrays in report JSON.
src/report/src/components/test-table/data-table.tsx Updates pillar filtering to match either a scalar pillar or an array of pillars.
src/powershell/classes/ZtTest.ps1 Changes Pillar metadata type to string[] to allow multi-pillar test attribution.
src/powershell/public/Get-ZtTest.ps1 Updates pillar filtering to treat test pillars as potentially multi-valued.
src/powershell/private/tests/Invoke-ZtTests.ps1 Stores requested pillar in session and updates stable-pillar filtering for multi-pillar metadata.
src/powershell/private/core/Get-ZtAssessmentResults.ps1 Post-processes multi-pillar TestPillar results based on requested pillar / preview mode.
src/powershell/private/core/Clear-ZtModuleVariable.ps1 Clears new session variable RequestedPillar between runs.
src/powershell/tests/Test-Assessment.25415.ps1 Tags test as both Network and AI.
src/powershell/tests/Test-Assessment.35003.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35004.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35005.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35006.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35007.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35008.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35010.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35011.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35012.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35013.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35014.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35015.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35016.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35017.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35019.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35020.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35021.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35022.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35023.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35024.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35025.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35030.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35032.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35033.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35034.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35035.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35036.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35037.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35038.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35039.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35040.ps1 Tags test as both Data and AI.
src/powershell/tests/Test-Assessment.35041.ps1 Tags test as both Data and AI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 40 out of 41 changed files in this pull request and generated 1 comment.

Comment thread src/powershell/private/tests/Invoke-ZtTests.ps1
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 40 out of 41 changed files in this pull request and generated 3 comments.

Comment thread src/report/src/components/test-table/data-table.tsx
Comment thread src/powershell/classes/ZtTest.ps1
Comment thread src/powershell/private/core/Get-ZtAssessmentResults.ps1
@praneeth-0000 praneeth-0000 requested a review from alexandair May 22, 2026 09:36
@praneeth-0000 praneeth-0000 added the ready for review PR is ready for review and merging label May 22, 2026
Copy link
Copy Markdown
Contributor

@alexandair alexandair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@praneeth-0000 Please, address my feedback.

Comment thread src/powershell/private/core/Get-ZtAssessmentResults.ps1
Comment thread src/powershell/private/tests/Invoke-ZtTests.ps1 Outdated
@praneeth-0000 praneeth-0000 requested a review from alexandair May 25, 2026 07:35
Copy link
Copy Markdown
Contributor

@alexandair alexandair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review PR is ready for review and merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants