Coding agent

How to security test an app built with Gemini CLI

Updated

Gemini CLI's long context lets it touch many files in one pass, so the risk is edits outside the feature and dependencies added to make something work. Test the dependency diff and the files that changed without being mentioned.

Where this class of bug actually lives in Gemini CLI output

  • Unrelated edits. Files changed because the model noticed something, reviewed less carefully than the feature.
  • Dependency additions. A package added for a utility the standard library already covers, often unpinned.
  • Config changes. Deploy, CI and env edits made to get a command to run.
  • Authorization in the wide context. A check applied to the paths the model focused on and missed on the ones it inferred.

What to try first

  1. List changed files and separate those named in the request from those it chose.
  2. Review the dependency diff for publisher and version pinning.
  3. Test access on the inferred paths, not just the requested ones.
  4. Check config diffs for wildcard CORS, debug flags and log levels.

A reproduction you can keep

Separate intended from incidental, then test the incidental:

Files it changed that you did not ask about
git diff --name-only main | grep -vE '^(src/feature|tests/feature)'

git diff main -- package.json requirements.txt go.mod | grep '^+'

for r in /api/<inferred-1> /api/<inferred-2>; do
  printf '%-16s ' "$r"; curl -sS -o /dev/null -w '%{http_code}\n' \
    "https://staging.example.com$r/1003" -H 'Authorization: Bearer ***'
done

# vulnerable: an unrelated file with a changed query, a new package,
#            and a 200 on an inferred path
# fixed: feature-only diff, pinned known packages, 404s

What "fixed" has to look like

Keep the change set to the feature, or review the extras with the same rigour, and pin and vet every added dependency. Verify access on every path that changed, not only on the requested ones.

Where people get this wrong

  • Incidental edits get less scrutiny precisely because they were not the point.
  • An unpinned dependency resolved today can resolve differently next month.
  • A model with a large context may 'fix' something in a file nobody asked it to touch.

What Offense does here

Offense runs an agent swarm against your app in a disposable sandbox, keeps the request, the identity and the vulnerable response as evidence, and replays the same attack after the fix so the retest is a control comparison rather than a green check. It does not read your source and it does not patch your code: the finding goes to your coding agent with the reproduction attached. The hosted workspace is invite-only — join the waitlist — and the free dependency audit in /install needs no account.

Questions this page answers

What should I check in a Gemini CLI change?

The files it chose to edit and every dependency it added, then access on those paths.

Are incidental improvements a problem?

Not by themselves. The problem is that they get reviewed less and can carry a control change.

Written by Offense Research, reviewed December 2, 2026. Correct something? Email imran@offenseresearch.com.