Audit system-configured command ownership, writable ancestors and wrapper dependency closure independently of server-name allowlists.
An allowlisted name does not freeze executable bytes
An administrator defines a local MCP server in a system configuration and adds its name to an allowlist. A developer cannot replace that configuration entry, but can modify the script at the configured command path. The approved name still resolves to code whose contents the administrator did not approve. This is a filesystem ownership problem beneath the configuration boundary, and it survives a perfectly implemented merge of system and user settings.
On 17 November 2026, the Gemini CLI source change identified by commit 4fa64e7 was reviewed for this guide. Its documentation change adds ownership and write-permission requirements for system-configured local commands and describes skipping servers that fail startup checks. The commit is dated 16 November 2026 UTC. A recheck on 24 November found it inside the v0.70.0 tag, published 19 November 2026 UTC, whose release notes list the change as pull request 30283; v0.71.0 also contains it. It is also in v0.70.0-preview.0 but not in v0.69.0.
The practical implication is broader than one CLI. A trusted configuration points to executable resources whose integrity depends on ownership, directory permissions and dependencies. The original fixture below models that trust chain without reading or changing the machine's real permissions. It does not attempt to reproduce every platform-specific check in Gemini CLI or certify a local installation as secure.
Trace the complete command path
Begin with the resolved executable path. If a non-administrative actor can rewrite the executable, an allowlist of server names does not preserve its meaning. Then inspect the parent directories. An attacker who cannot edit the file itself may still be able to replace a directory entry under a writable parent. The relevant boundary is control over what bytes are executed, not merely the mode bits on the final filename.
A wrapper adds another layer. A protected script may invoke a helper from an unprotected location or resolve a command through a mutable PATH. The wrapper's own permissions do not make its dependencies trustworthy. Record the interpreter, helper paths and configuration files that influence execution. Some dependencies are loaded dynamically, so a static list is only as complete as the launch contract it represents.
The reviewed Gemini documentation explicitly calls attention to secondary scripts, binaries and dependencies, and distinguishes local command protection from remote server allowlists. It also notes the tool-approval implications of its MCP allowlist setting. This guide uses that change as a reason to examine an execution chain, while keeping its example's policy independent of the CLI's internal implementation.
Model trust as a closure of owned resources
The synthetic policy below accepts only resources owned by an administrative principal and rejects group- or world-writable resources. It evaluates the supplied closure: the executable, its directories and declared helper resources. The strings are fictional labels, not paths on the reader's computer. This POSIX-like mode model does not represent Windows ACL inheritance, access-denial entries, symlinks or mount behavior.
# Author: Sandeep Belgavi. Synthetic executable trust-closure model.
from dataclasses import dataclass
@dataclass(frozen=True)
class Resource:
name: str
owner: str
mode: int
def audit(resources):
if not resources:
return {"allowed": False, "reasons": ["empty execution closure"]}
reasons = []
seen = set()
for item in resources:
if item.name in seen:
reasons.append("duplicate resource: " + item.name)
seen.add(item.name)
if item.owner != "administrator":
reasons.append("untrusted owner: " + item.name)
if item.mode & 0o022:
reasons.append("shared write access: " + item.name)
return {"allowed": not reasons, "reasons": reasons}
fixture = [Resource("root", "administrator", 0o755),
Resource("tools", "administrator", 0o777),
Resource("server", "administrator", 0o755)]
assert audit(fixture)["allowed"] is False
assert audit([Resource("server", "administrator", 0o755)])["allowed"] is TrueThe second assertion deliberately demonstrates a limitation: a safe-looking supplied file passes the model even if the caller omitted an unsafe parent. The auditor cannot discover missing dependencies from a list it is told is complete. A real launcher needs an authoritative path-resolution and dependency policy. The completeness of the execution closure is an assumption that must be tested, not a property this small function can establish.
Migrate without silently weakening a failed check
Inventory system-configured local servers and record their resolved launch chains. Start with read-only inspection in the environment that actually launches them; an interactive shell may resolve a different command than a background service. Identify writable ancestors, user-owned package locations and wrappers that invoke unpinned commands. The result should be a concrete list of ownership gaps, not a generic instruction to make everything executable.
Move managed executables and required dependencies into a deliberately administered location using the organization's normal software-distribution process. Preserve the ability to update them through that process. Do not respond to a startup refusal by disabling the check, broadening filesystem write access or silently falling back to a user-defined server with the same name. Those actions change the trust contract rather than repair it.
Keep rollout behavior visible. A server skipped at startup should produce a clear diagnostic naming the failed boundary without exposing secrets. The application should distinguish an unavailable server from an empty tool list and from a tool invocation failure. Otherwise an agent may improvise an alternate path because the intended capability disappeared without explanation.
Test an unsafe parent and an unsafe helper
A meaningful test matrix includes a protected executable under a writable parent, a protected wrapper with a user-owned helper, a fully protected supplied closure and an empty closure. The expected refusals must identify the resource that violated policy. Test the same cases in the actual platform's permission model before making deployment claims; the offline mode-bit fixture is only a teaching abstraction.
Add a launch-boundary test in which the checked resource changes before execution. The expected result depends on the real launcher design: it must either retain the verified object identity or detect and refuse the change. A test that checks permissions once and then invokes a separately resolved command proves less than it appears to prove. Keep that limitation explicit in any validation report.
Use the source change as a bounded operational lesson
The reviewed commit supports a specific claim about a documented startup protection and its configuration guidance. It does not establish that an exploit occurred or that all local MCP servers are unsafe. Check that the installed version is v0.70.0 or later before relying on this behavior, and retain the source revision used for a reproduction.
The original lesson is a deterministic one: follow a trusted name down to the code and dependencies that will execute. An agent can help explain an inventory, but it should not decide that writable code is trustworthy because the configuration looks official. Keep configuration precedence, executable integrity and exposed capabilities as separately inspectable parts of the server's launch contract.
Run the example yourself
The synthetic fixtures, expected output and tests behind this guide are in the companion code on GitHub; its README lists the prerequisites, exact commands, expected output and limits.