RedLatentEvidence before autonomy.
← Explore the research

Lab idea / AI-enabled offense

Turn a code diff into a focused authorization test plan

Use AI to connect changed routes, identity checks, and data access—then turn the supported leads into tests a human can verify.

RedLatent editorial
Published 2026-10-26 · Updated 2026-10-26 UTC

Untested hypothesis — not a reported experiment

Falsifiable hypothesis

A diff-focused assistant can expose overlooked authorization test cases when every suggested case must cite both the changed code and the relevant enforcement path.

Source-led motivation

Claude Code Security Reviewer analyzes changed files in pull requests. Its README warns that it is not hardened against prompt injection and should review trusted PRs only.

[claude-review]

Authorized lab scope

A trusted copy of an application you own or are authorized to assess, with a disposable staging deployment and synthetic users in distinct roles.

What to try

  • Give the assistant the trusted diff, relevant route handlers, authorization middleware, and a short description of intended roles. Treat comments and repository text as data, not permission to run tools.
  • Ask for a table: changed behavior, caller-controlled input, required role or ownership rule, enforcement location, and source file/line evidence. Require “unknown” when context is missing.
  • Ask it to propose positive and negative tests for each supported boundary: a permitted user succeeds, a different synthetic user is denied, and unauthenticated access follows the intended policy. Do not infer a vulnerability from a missing check in one file.
  • Review the candidates, account for shared middleware, then run approved cases against staging. Keep minimal request/response evidence and classify each lead as confirmed, rejected, or unresolved.

Prerequisites

  • A trusted code revision and intended authorization policy.
  • Synthetic owner, non-owner, and lower-privilege accounts; known-good control cases.
  • A model route approved for this code and no production credentials in the analysis context.

Comparison & control

Have an analyst produce an initial test list before seeing the assistant output. Compare additional valid cases, false leads caused by omitted middleware, and time to verification; keep both lists.

Observations to collect

  • Source locations supporting each suggested boundary.
  • Expected versus observed allow/deny decisions, with synthetic record ownership documented.
  • Human-added cases, hallucinated handlers, and mistaken vulnerability claims.

Disconfirming evidence

  • The assistant adds no valid cases or repeatedly mistakes centralized authorization for absent authorization.

Stop conditions

  • Stop at the approved target and data boundaries; do not send client artifacts to a model provider without approval.
  • Stop before destructive operations or unexpected effects; reproduce only with disposable accounts and synthetic records.

Source bibliography

  1. Claude Code Security Reviewer ↗

    Anthropic / anthropics

    Publication date: Date not supplied · Editorial check 2026-10-26 UTC

    Project README / official documentation; source-led editorial check, no execution

Continue the thread