Repository navigation
Conversation
Register ai as a shared threat model, document its scope, and add a regression test for explicit enablement. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3b1133f4-388a-4e13-a00f-dce2b41cd295
| - ["windows-registry", "local"] | ||
|
|
||
| # AI threat models | ||
| - ["ai", "all"] |
There was a problem hiding this comment.
Maybe this line would be better at the bottom of the file, with the other threat models that aren't grouped with any other threat models.
|
|
||
| The less commonly used categories are: | ||
|
|
||
| - ``ai`` which represents output generated by large language models (LLMs). This threat model is opt-in and does not include any built-in source models. |
There was a problem hiding this comment.
I wouldn't mention that it doesn't include any built-in source models. We'll just have to remove it at some point soon (I assume we're merging some soon). But if you want to coordinate removing it when we merge the first ones then it's fine.
jacknojo
left a comment
There was a problem hiding this comment.
Thanks Owen, made two followup commits for your comments.
| - ["windows-registry", "local"] | ||
|
|
||
| # AI threat models | ||
| - ["ai", "all"] |
|
|
||
| The less commonly used categories are: | ||
|
|
||
| - ``ai`` which represents output generated by large language models (LLMs). This threat model is opt-in and does not include any built-in source models. |
There was a problem hiding this comment.
🟢 Approval recommended
The shared configuration, documentation, and focused regression coverage consistently implement the described opt-in behavior.
0 open findings
What changed in this PR
Adds the shared, opt-in ai threat model for LLM-generated output.
Changes:
- Registers
aias a known threat-model kind. - Documents the new kind and adds a change note.
- Tests explicit enablement while preserving default-disabled behavior.
| File | Description |
|---|---|
shared/threat-models/ext/threat-model-grouping.model.yml |
Registers ai under all. |
shared/threat-models/change-notes/2026-10-12-ai-threat-model.md |
Announces the opt-in threat model. |
javascript/ql/test/library-tests/threat-models/ai-enabled/ActiveAiThreatModel.ql |
Verifies ai is known and active. |
javascript/ql/test/library-tests/threat-models/ai-enabled/ActiveAiThreatModel.ext.yml |
Enables ai for the regression test. |
javascript/ql/test/library-tests/threat-models/ai-enabled/ActiveAiThreatModel.expected |
Records the expected test result. |
docs/codeql/reusables/threat-model-description.rst |
Documents the ai category. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
Introduce the shared
aithreat-model kind for output generated by large language models (LLMs). This establishes the configuration support for follow-up source models and queries, without adding third-party library models or new queries.aiunderall, making it a known, independently configurable threat-model kind. It remains disabled by default.codeql/threat-models.aiand requires bothknownThreatModel("ai")andcurrentThreatModel("ai")to hold. The existing default-configuration test confirms thataiis not enabled by default.No new QL framework logic is necessary: the existing threat-model implementation derives known kinds and configuration behavior from the shared grouping table.
Validation
Both tests passed with the CodeQL CLI:
codeql test run \ javascript/ql/test/library-tests/threat-models/ai-enabled \ javascript/ql/test/library-tests/threat-models/default