· 2 min read · Engineering & delivery · 閱讀中文版
CodeQL and MCP inputs: put acceptance criteria at the tool boundary
Use CodeQL’s AI threat model update to separate parameter validation, authorization, and side-effect checks when delivering MCP tools.
On this page
GitHub’s December 4, 2026 CodeQL announcement says enabling the ai threat model tracks model-generated arguments in JavaScript, TypeScript, and Python MCP handlers. It is a useful prompt to make acceptance boundaries explicit. The checks below are proposed delivery guidance, not a report of an implementation on this site.
Map where each parameter goes
Imagine an internal tool accepting a project identifier and document name, then returning a document. I would map the path through parsing, authorization, and the actual read. This hypothetical example helps distinguish the step that recognizes a valid format from the step that permits access.
A well-formed string does not establish a caller’s right to the resource. Document allowed values, resource ownership, and where authorization is evaluated separately. A single checkbox labelled “input validation complete” can hide several different responsibilities.
Make rejection reasons testable
Prepare three sets of synthetic requests: valid and authorized, malformed, and well-formed but unauthorized. Write the expected result before running each case, then compare both the response and backend behavior with that expectation.
For a tool that changes data, also check that rejection leaves no partial writes. An error response is a visible outcome, not sufficient evidence that side effects stopped. Disposable test data and before-and-after records make that claim verifiable without involving private information.
Keep the scan configuration with the result
The announcement makes enabling the ai threat model a condition. Retain the scanner version, configuration, language coverage, and scanned commit so the team can establish what actually ran. When no alert appears, ask whether the relevant path was analyzed before interpreting the result.
For an existing alert, retain the source of the data, the handling point, and the reason for the disposition. If it does not apply, explain which condition prevents the unwanted behavior and how that condition was tested. A bare “false positive” label gives the next maintainer little to evaluate.
Leave unknowns visible in the handover
Scanning, functional checks, and authorization tests complement one another, but answer different questions. I would separate verified behavior, uncovered paths, and follow-up owners in the handover, with reproducible test conditions attached.
As tools become easier to connect to AI workflows, their contracts need to say what they may do, when they must refuse, and whether refusal truly prevents changes. Improved analysis supplies additional evidence; the delivery decision still needs to be checked against observable behavior.