> [!WARNING]
> **Preview**
>
>
> This product or feature is subject to the "Pre-GA Offerings Terms" in the
> General Service Terms section of the
> [Service Specific Terms](https://cloud.google.com/terms/service-terms#1),
> and the
> [Additional Terms for Generative AI Preview Products](https://cloud.google.com/trustedtester/aitos).
> Pre-GA products and features are available "as is" and might have limited
> support. For more information, see the
> [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages).
>
>
> Pre-GA products are in various stages of internal testing and review. As such,
> customers should closely supervise the use of CodeMender, and not use CodeMender
> in situations where serious errors cannot be corrected. This product is made
> available to Customers solely for limited testing and evaluation, and may not be
> used for commercial or production purposes.
>
>
> You may only use CodeMender to analyze (i) source code that you own or are authorized to use or (ii) open source code distributed under an OSI-approved license. You must use this offering solely for legitimate security defense purposes (and not for unauthorized testing, exploitation, or cyberattacks) in compliance with the
> [Google Cloud Acceptable Use Policy](https://cloud.google.com/terms/aup?e=48754805)
> and the [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy). When using CodeMender built with a
> Google Cyber Model or Google Frontier Cyber Model, or a Google Frontier Model,
> your access to and use of those models is also governed by Sections 31 and 34 of
> the
> [Service Specific Terms](https://cloud.google.com/terms/service-terms#1),
> respectively.
>
>
> When disabling human confirmation of write and tool execution actions (as
> described in the
> [configuration file parameters](https://docs.cloud.google.com/gemini-enterprise-agent-platform/agents/codemender/set-up-environment.md.txt#configuration-file)), Customer is responsible for such
> modification under Section 20(j) ("Modifying, Disregarding, or Disabling Safety
> Filters") of the Service Specific Terms. The customer agrees not to
> automatically bypass or circumvent other responses requiring human
> confirmation.

<br />

CodeMender lets you proactively scan your codebase for software weaknesses and execute proof-of-concept (PoC) exploits in your local sandbox to confirm exploitability and reduce false positives.

## Scan for vulnerabilities

To scan your codebase for vulnerabilities, run `cm find`. By default, `cm find`
runs a concurrent file-by-file deep scan across the target path. For a faster
single-session scan, pass the `--quick` flag.

Scan a specific subdirectory:

```bash
cm find ./src/auth/
```

Run a faster single-session quick scan on a subdirectory:

```bash
cm find ./src/auth/ --quick
```

Scan only the modified files in a subdirectory:

```bash
cm find --diff ./src/auth/
```

Scan a single file:

```bash
cm find ./src/auth/session_manager.py
```

Skip interactive approval prompts during the scan:

```bash
cm find ./src/auth/ -y
```

For more information about default deep scans, scanning pull requests with
`--diff`, or running single-session scans with `--quick`, see [CodeMender find
modes](https://docs.cloud.google.com/gemini-enterprise-agent-platform/agents/codemender/find-modes) and [Integrate with
CI/CD](https://docs.cloud.google.com/gemini-enterprise-agent-platform/agents/codemender/integrate-with-cicd).

## Verify vulnerabilities

> [!WARNING]
> **Warning:** CodeMender executes commands and may modify files directly on your host system. By default, these commands run inside a local process-level sandbox and are restricted to your workspace directory and command policy. If you disable the sandbox (in `config.yaml` or using the `--sandbox=false` flag) or bypass path or command boundaries (using the `--allow-all-paths` or `--allow-all-commands` flags), run the CLI in an isolated VM or container to protect your host system.

Once CodeMender identifies potential vulnerabilities, ask it to verify exploitability. During verification, CodeMender generates and executes a proof-of-concept (PoC) exploit (inside the default [sandbox](https://docs.cloud.google.com/gemini-enterprise-agent-platform/agents/codemender/set-up-environment.md.txt#execution-sandboxing)) to confirm whether the issue is genuinely exploitable.

Locate the `finding-id` from the output of `cm report` or `cm find`, then run:

```bash
cm verify FINDING_ID
```

### Verification flags

The following flags configure `cm verify`:

| Flag | Default | Description |
|---|---|---|
| `-c, --context TEXT` | `""` | Pass steering instructions or application domain context to guide the agent (for example, `cm verify FINDING_ID -c "Focus analysis on the multi-tenant session validation path"`). |
| `--skip-exploit-verification` | `false` | Mark high-confidence findings as verified without rerunning the PoC exploit script after the verification agent finishes. The agent still generates and runs a PoC exploit during verification. |
| `--sandbox` | `true` | Explicitly enable or disable the OS-level sandbox for this run (for example, `--sandbox=false` to disable). |
| `--allow-all-paths` | `false` | Disable the workspace path boundary check so agent tools can access paths outside the project root and configured `project_paths` (combine with `--sandbox=false` to access host paths that aren't mounted inside the sandbox). |
| `--allow-all-commands` | `false` | Disable `command_policy.yaml` blocklist enforcement for this run. |
| `-y, --yes` | `false` | Skip interactive confirmation prompts (`[Y/n]`) for tool actions and PoC exploit execution. Commands remain contained within the OS-level sandbox container (`exebox`) unless you also pass `--sandbox=false`. |
| `--bypass-warning` | `false` | Skip the warning prompt shown when running commands on the host without the OS-level sandbox or interactive confirmation prompts. |
| `--duration DURATION` (or `--timeout DURATION`) | `0s` (unlimited) | Set a maximum wall-clock execution duration for verification (for example, `15m` or `30m`). You can also set the `CM_DURATION` environment variable or `execution.duration` in `config.yaml`. If the session stops at its budget limit before confirming exploitability, the finding stays `OPEN` (it isn't marked `DISMISSED`), and `cm verify` exits with status `50`. |