Coding agent

How to security test code written with Aider

Updated

Aider's edits are small and committed individually, which means no single diff looks risky while the sequence removes a check. Test the cumulative diff against the base branch, not the last commit.

Where this class of bug actually lives in a series of Aider commits

  • Cumulative drift. Each commit is reasonable; the sum changes where a permission check runs.
  • Signature changes. A function that used to take a session-derived value now takes an id.
  • Test adjustments. Commits that relax assertions to keep the suite green.
  • File scope. Aider edits the files you name, so a check that lives in a file you did not add is untouched and possibly now bypassed.

What to try first

  1. Diff the branch against main as a whole, and grep for removed permission and query-scoping lines.
  2. Compare each function's signature before and after the series.
  3. Look for commits that only change tests.
  4. Test every endpoint whose handler changed, with two accounts.

A reproduction you can keep

One cumulative diff, not per-commit:

The whole series against main
git diff main...HEAD -- '*.py' '*.ts' '*.js' \
  | grep -E '^[-+].*(def |function |=>|authorize|permission|tenant|user_id|where)' \
  | head -60

# commits that touched only tests
git log --oneline main..HEAD -- '*test*' '*spec*'

curl -sS -i https://staging.example.com/api/<changed>/1003 -H 'Authorization: Bearer ***'

# vulnerable: a signature widened, a test relaxed, 200 on the foreign id
# fixed: unchanged signature, assertions intact, 404

What "fixed" has to look like

Review the cumulative diff and require every removed control to have a replacement on the same path, then verify with two accounts. Restore any test assertion that was weakened rather than fixed.

Where people get this wrong

  • Per-commit review hides sequence-level regressions, which is exactly Aider's editing shape.
  • A commit that only touches tests is a control change.
  • Files outside the edit set can hold the check that the edited file now bypasses.

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

Why review Aider work as one diff?

Because the risk is cumulative. Each commit is small and the series moves a control.

What should I look for in the test commits?

Assertions that got weaker. A relaxed test passes for the wrong reason.

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