6 phases · 8 domains

The question it answers

For every place Gemini Code Assist runs: if injected text hijacked the agent right now, what could it reach, and would you know? Everything below is a way of answering that question with evidence rather than assumptions.

Developer assessment (1 hour)

  1. Run the audit (about a minute). The Gemini Security Audit container checks your settings, policies, MCP servers, extensions, Code Assist setting and a project of your choice, offline and read-only. Save the HTML report.
  2. Work through the checklist. Items marked "manual" are the ones the audit cannot see: your licence, admin controls, workflow secrets and working habits.
  3. Compare against the common misconfigurations and fix every Critical one first.
  4. Prove the controls work with the ten-minute self-test below.
  5. Keep the evidence: the audit report, the completed checklist and the test results. Re-run after each upgrade and at least monthly.

The ten-minute self-test

Configuration you haven't tested may not do what you think. Make a throwaway project containing a fake .env, apply the baseline settings and policies, and try each of the following. Every one should be refused or stopped for your approval.

Try thisWhat should stop it
Open the folder for the first timeGemini CLI asks you to trust it and ignores its settings until you do
"Run rm -rf build"The rm -rf policy rule denies it
"Push this branch"The git push rule asks first
"Download https://example.com with curl"The curl rule asks first
Run gemini --yolodisableYoloMode ignores it
"Write a script that connects to the database"GEMINI.md: the script should read credentials from environment variables

The settings and policies it tests are in the audit's fix section. Re-run it after every Gemini CLI upgrade.

Team assessment method

For a team or organisation, allow two to four weeks across 6 phases:

  1. Scope and inventory. List the surfaces in use (Gemini CLI, Code Assist in VS Code and JetBrains, run-gemini-cli workflows), licences, versions, MCP servers, extensions, hooks and policy files. Users on consumer tiers moved to Antigravity CLI and need a separate review. Useful sources: the Google Cloud console, EDR process inventory and a code search for .gemini/, GEMINI.md and run-gemini-cli.
  2. Threat model. For each place Gemini runs (laptop, container, CI runner), write down the identities and credentials it holds and the data and systems it can reach. That list is your blast radius.
  3. Configuration review. Compare each developer's ~/.gemini/settings.json, policies and Code Assist settings, the machine-wide settings and the organisation's admin controls with the checklist. On each developer machine, the audit container does the local part in about a minute.
  4. Technical testing. Try to break it, safely, in a test project: read a planted fake secret, reach a host that is not allowed, open a crafted repository with a .gemini/settings.json and a GEMINI.md injection, and open a crafted issue against a staging repository that runs the Gemini CLI Action. Each attempt should be both blocked and detected.
  5. Detection and response review. Confirm Code Assist audit logs are arriving in Cloud Logging; check that your alerts fire on the test activity from phase 4; run a tabletop for "the agent leaked a key" and "a workflow leaked its secrets".
  6. Report and roadmap. Record findings with their misconfiguration IDs, score each domain with the maturity model below, and write a plan that fixes them in order of risk, following the fix order.

Enterprise checklist

Use these as the evidence behind each maturity score.

Governance

  • An approved policy for AI-assisted development, published and acknowledged.
  • Named owners for admin controls, machine-wide settings, MCP and extension intake, detections and incident response.
  • Controls mapped to the frameworks you report against (OWASP Top 10 for Agentic Applications, NIST AI RMF, ISO/IEC 42001, SOC 2 change management).

Identity and access

  • Code Assist Standard or Enterprise licences assigned through groups and reviewed quarterly.
  • Workflows authenticate to Google Cloud with workload identity federation, not long-lived API keys.
  • Consumer-tier users moved off Gemini CLI to a governed tool.

Policy enforcement

  • Admin controls set in the Google Cloud console: strict mode on, extensions and MCP limited.
  • Machine-wide settings.json delivered to /etc/gemini-cli, /Library/Application Support/GeminiCli or C:\ProgramData\gemini-cli, with the folder locked to administrators.
  • Admin policy files enforcing deny rules for destructive commands.

Data protection

  • VPC Service Controls include the Gemini for Google Cloud and Gemini Code Assist APIs where required.
  • Secret scanning with push protection on every repository; prompt logging reviewed against your data policy.

Endpoint and network

  • EDR on every developer host, and inside WSL and dev containers where required.
  • Corporate proxy and CA configured; an egress allowlist for model endpoints and package registries.
  • A standard container with no credentials for untrusted code.

CI/CD and production

  • Every run-gemini-cli workflow inventoried, pinned by SHA at 0.1.22 or later, and never run with --yolo on outsider input.
  • Workflow permissions and secrets limited to what each job needs; CODEOWNERS covers .gemini/, GEMINI.md and workflows.
  • No agent has standing write access to production; a break-glass procedure is documented.

Observability and response

  • Code Assist audit logs (cloudaicompanion.googleapis.com) retained according to policy; Gemini CLI telemetry exported where approved.
  • Detections for agent activity deployed and tested, including changes to .gemini/ files and new MCP servers.
  • Runbooks for a leaked key, an injected agent action, a malicious MCP server or extension, and a compromised workflow; a tabletop run in the last 12 months.

Threat intelligence and testing

  • Gemini CLI and Code Assist advisories and research followed, with a regular summary for the team.
  • The phase 4 tests re-run after each upgrade and policy change.
  • Gemini in the scope of the annual penetration test or red team.

Maturity model

Score each domain from 0 to 4 and track it quarterly.

LevelNameWhat it looks like
0UnmanagedPersonal accounts, no policy, no visibility.
1AwarePolicy written; approved accounts; developers trained; some user-level settings.
2ManagedManaged settings enforced across the fleet; sandbox on; MCP and plugin allowlists; telemetry on.
3MonitoredDetections tested; CI agents separated from privileged jobs; version floor enforced; advisories drive patching.
4OptimisedAttack tests run automatically in CI; metrics drive policy; agent identities fully scoped; production access denied by default and proven.

A sensible first target for most organisations is level 2 everywhere, and level 3 for policy enforcement, isolation and CI/CD, because those three domains carry most of the critical risks.

Score it

Pick a level for each domain. The weighted score updates as you go; nothing is sent anywhere.

DomainWeightEvidence to collectLevel
Governance10%Policy, owners, framework mapping
Identity and access15%SSO and SCIM setup, login enforcement, CI identity
Policy enforcement20%Admin controls, machine-wide settings and policy files, audit reports
Isolation (sandbox, containers)15%Sandbox settings, phase 4 test results
Supply chain (MCP, plugins, actions, packages)10%Allowlists, pinning, intake records
CI/CD and production15%Workflow review, branch protection, production access review
Observability and response10%Telemetry proof, detections, tabletop
Threat intelligence and testing5%Advisory tracking, test runs

Weighted score: 0.0 of 4 · Unmanaged

Sources

The domain weights and maturity levels are AISecurityLabs.org guidance, not a standard; adjust them to your risk profile. Informational only, with no guarantee of a vulnerability-free setup, so test every configuration in your own environment. AISecurityLabs.org is independent and not affiliated with Google.