GitHub’s CodeQL 2.27.5 release adds something more consequential than another framework model: it teaches static analysis to treat data produced by a language model as untrusted input when that data reaches Model Context Protocol servers. For platform teams building internal AI tools, that change supplies a practical way to enforce an old security principle at a new boundary. Agent output may look structured and may have passed through a schema, but it is still input that can drive tools, resources, prompts, shells, and downstream services.
The release models the official MCP SDKs and FastMCP packages for JavaScript, TypeScript, and Python. When CodeQL’s opt-in ai threat model is enabled, arguments passed to tool, resource, and prompt handlers become taint sources because a model produced them. Separately, request headers and bearer tokens are sources under the remote threat model. The distinction matters: it lets security teams reason about model-controlled values and conventional network-controlled values without flattening both into one vague category.
The central lesson for DevOps and platform engineering is straightforward: an MCP server should be operated like an internet-facing automation service, even when it initially serves only an internal agent. CodeQL’s new modeling can help teams discover where model-originated values cross into dangerous operations, but the scanner is most useful when paired with explicit trust boundaries, narrow tool contracts, and deployment controls.
What CodeQL 2.27.5 Actually Models
In JavaScript and TypeScript, CodeQL now recognizes the official @modelcontextprotocol/sdk and @modelcontextprotocol/server packages as well as the fastmcp package. Arguments delivered to MCP tool, resource, and prompt callbacks—and requests passed to low-level server handlers—can be tracked under the AI threat model. In Python, the release models the official mcp package and fastmcp, treating parameters of tool, resource, and prompt handlers as model-originated sources while excluding the injected context object.
This is important because data-flow analysis needs framework knowledge. A generic scanner may understand that an operating-system command is a dangerous sink, yet miss the point where an SDK invokes application code with an argument selected or composed by a model. Framework modeling connects those ends of the path. It allows a query to ask whether an MCP argument can reach a file operation, process invocation, URL fetch, database query, or another sensitive sink without an effective barrier.
The update also gives remote inputs their own treatment. JavaScript, TypeScript, and Python models identify request headers and bearer tokens exposed by MCP libraries as sources under the remote threat model. That separation supports more precise policies. A platform team may accept that a model can choose a deployment environment from a fixed enumeration while applying stricter controls to an authorization header arriving over the network.
CodeQL 2.27.5 runs 499 security queries covering 169 CWEs in its default suite, with 131 additional queries in the extended suite. Those totals provide useful scale, but they are not the reason this release matters. The significant change is semantic: the analysis understands a growing agent framework well enough to place a security boundary at the handler rather than relying on teams to write custom models before finding basic flows.
Why Schema Validation Is Not a Trust Boundary
The same CodeQL release adds flow summaries for Zod’s parse, safeParse, and asynchronous variants. Data now flows from the parser’s input to its parsed result. That behavior captures a subtle but operationally critical point. A schema can prove that a value is a string, an enum, or an object with required fields; it does not automatically prove that the value is safe to pass to a shell, use as a path, interpolate into a query, or send to an arbitrary host.
Consider an MCP deployment tool whose contract accepts {"service":"...","environment":"..."}. A schema might reject missing keys and malformed types, yet still permit a service name containing shell metacharacters if the implementation constructs a command string. It might accept a syntactically valid environment URL that targets a cloud metadata endpoint. It might accept a relative path containing traversal sequences. Structural validity and security validity are different properties.
That is why the new Zod modeling complements the MCP modeling. If parsing were treated as a universal sanitizer, taint could disappear at precisely the point developers feel most confident about the input. Preserving the flow encourages controls that match the sink: fixed command arguments rather than shell strings, canonical path checks for filesystem access, hostname allowlists for outbound requests, parameterized queries for databases, and object-level authorization before an action is executed.
The Shell Boundary Deserves Immediate Attention
CodeQL 2.27.5 also improves JavaScript and TypeScript command-injection analysis. Its queries now recognize untrusted arguments passed to spawn or execFile when the shell option is enabled, including input in argument arrays. This is directly relevant to MCP tools because many early agent integrations wrap existing command-line utilities. The implementation may appear safer because it uses an argument array, but enabling a shell changes how those arguments are interpreted.
Platform teams should inventory MCP handlers that launch processes and divide them into three groups:
- No shell required: invoke a fixed executable directly, pass each argument separately, and keep
shelldisabled. - Shell behavior genuinely required: replace free-form model text with server-side identifiers mapped to prebuilt operations, then isolate the runner with a minimal filesystem and identity.
- Arbitrary command execution is the product: treat the tool as a privileged execution environment, with sandboxing, approval policy, network restrictions, complete audit logs, and short-lived credentials.
The third category cannot be made low risk through prompt wording. Instructions such as “only run safe commands” are not authorization controls. The server must assume that a model can be manipulated, can misunderstand intent, or can produce an unexpected string. The enforceable boundary belongs in deterministic application logic and infrastructure policy.
A Deployment Playbook for Platform Teams
Enable the Relevant Threat Models Deliberately
Do not assume existing CodeQL configuration automatically analyzes model-originated MCP values. GitHub describes the AI threat model as opt-in. Review the query-suite configuration used in pull requests and default-branch scans, enable the model where appropriate, and verify the behavior against a small test repository containing a known unsafe flow. Keep the remote threat model in scope for transports and authentication data.
Run the test through the same reusable workflow or organization policy that production repositories use. A local success does not prove that a centrally managed workflow loads the same suites, packs, or configuration. Record the expected alert as a regression test so future workflow changes do not silently remove coverage.
Classify Tools by Capability, Not by Their Friendly Names
A tool called “read deployment status” may fetch a caller-controlled URL. A tool called “update documentation” may write anywhere the service account can reach. Build an inventory based on effects: process execution, filesystem write, network egress, secret access, infrastructure mutation, and data deletion. Associate every capability with an owner, an identity, an approval rule, and an audit destination.
This classification also improves code-review routing. A change to a prompt template may be low risk; a change that expands egress or adds a new process sink should require platform or security review even if the public tool schema barely changes.
Constrain Inputs at the Last Responsible Moment
Validate structure at the handler boundary, but enforce security invariants immediately before the sensitive operation. Map user-facing names to server-side IDs. Resolve and canonicalize paths before comparing them with an allowed root. Parse URLs and compare normalized hosts and schemes against a fixed policy. Recheck authorization using the concrete target, not merely the requested tool name.
This defense remains useful when data passes through helper functions, queues, or orchestration layers. CodeQL can reveal unexpected flows, while sink-adjacent checks reduce the chance that a refactor separates validation from use.
Separate Agent Identity from Human Identity
An MCP server should not inherit a developer’s broad workstation credentials merely because the developer initiated the session. Give the service its own workload identity and restrict permissions to the specific resources its tools require. Prefer short-lived tokens and make the identity visible in audit trails. For mutating operations, preserve the requesting human or upstream agent as context, but do not confuse attribution with authorization.
Roll Out Scanning Without Normalizing Alert Fatigue
Start with repositories that host MCP servers or shared tool libraries, then prioritize findings by sink and reachable deployment path. Process execution, infrastructure mutation, credential handling, and unrestricted egress should lead the queue. Baseline existing findings with named owners and deadlines rather than suppressing broad categories. New-code enforcement can prevent further debt while teams remediate the baseline.
Limits of the New Coverage
Framework modeling is not a complete agent-security program. CodeQL analyzes code and modeled data flow; it cannot determine whether a tool should exist, whether a human approval is meaningful, or whether an agent has accumulated excessive privileges across several individually reasonable tools. It may also miss flows through unsupported wrappers, dynamically loaded components, custom protocol adapters, or external services.
The release is also version-sensitive. GitHub says new CodeQL versions are deployed automatically to code scanning users on GitHub.com, while the functionality will arrive in a future GitHub Enterprise Server 3.24 release. Operators on older GHES versions can manually upgrade CodeQL, but that creates another lifecycle to manage and verify.
CodeQL 2.27.6, released shortly after 2.27.5, illustrates that lifecycle pressure. It updates the CLI’s bundled JDK to Temurin jdk-25.0.5.1+2 to mitigate CVE-2026-114938 and changes how the Java extractor launches that bundled runtime. Self-managed scanning infrastructure is software supply chain infrastructure; its runtime and distribution cadence need the same patch discipline as build agents and deployment controllers.
What to Measure Next
The most useful outcome is not the number of MCP alerts closed. Track the share of agent tools with an explicit capability classification, dedicated workload identity, constrained egress, sink-specific input controls, and an accountable owner. Measure how many process-launching handlers run without a shell and how many mutating tools require deterministic authorization outside the model.
CodeQL 2.27.5 gives platform teams a valuable new lens: model-produced arguments are visible as untrusted data, not privileged intent. Teams that carry that assumption from static analysis into tool design, identity, runtime isolation, and deployment policy will be better prepared as MCP servers move from experiments to shared production infrastructure.


