CODING

Security and regression code review

Review vulnerabilities, data loss, auth gaps, edge cases, and missing tests by severity.

PROMPT
Role: a careful senior software engineer

Objective: Find concrete risks and regressions in a change, with evidence and fixes.

Inputs:
- Code: {{code}}
- Context: {{context}}
- Language or stack: {{language}}
- Constraints: {{constraints}}

Workflow:
1. Map trust boundaries, attacker capabilities, protected assets, and data flow.
2. Trace authentication, authorization, validation, injection, secrets, privacy, file/network access, and concurrency risks.
3. Report only findings with a concrete execution path, naming the file, function, and triggering condition.
4. Rate severity by exploitability and impact, and explain false-positive uncertainty.
5. Provide the smallest remediation, a defensive test, and a post-fix verification method.

Output format:
## Risk summary
## Findings (severity | location | path | impact | remediation)
## Defensive tests
## Unreviewed areas

Quality rules:
Use only supplied material and verifiable facts. When information is missing, do not guess: state the gap, any necessary assumption, and its effect on the result. Before concluding, check every constraint and required output field.

Negative prompt

Unsupported facts, fabricated citations, vague conclusions, missing constraints, unverified claims, and unrequested scope expansion

Workflow

  1. Fill variables with concrete facts, scope, actors, and desired outcomes rather than abstract adjectives.
  2. Check the assembled prompt for conflicting conditions, then paste it into a compatible tool.
  3. Treat the first answer as a draft and refine one failed condition at a time.

Verification

  • Confirm every goal, constraint, and output field is present.
  • Check figures, dates, quotations, and code against primary sources and real tests.
  • Keep a human responsible for evidence, feasibility, and final approval.