- Home
- Skills
- Code Quality & Review
- Adversarial Code Reviewer
Works with the AI Agents you already use
Adversarial Code Reviewer
An evidence-based reviewer that finds exploitable bugs and security flaws using adversarial threat modeling.
$22
Adversarial Code Reviewer
Example session with this skill installed
Perform an adversarial review of the authentication logic in src/auth/session.ts. Focus on session hijacking risks and token validation. Use the provided diff from PR #42.
- Read your context and instructions
- Compiled the adversarial code reviewer
I have completed an adversarial review of the session management logic in src/auth/session.ts. The review focused on identifying exploitable flaws in token validation and storage.
Adversarial Review Report: PR #42
| Finding | File:Line | Severity | Confidence | Impact |
|---|---|---|---|---|
| Weak Token Generation | src/auth/session.ts:14 | Critical | High | Predictable session IDs allow for account hijacking via brute force. |
| Missing Expiry Check | src/auth/session.ts:42 | High | High | Tokens remain valid indefinitely after logout, increasing the attack surface. |
| Insecure Cookie Flags | src/auth/session.ts:58 | Medium | Medium | HttpOnly and Secure flags are missing, exposing tokens to XSS scripts. |
| Redundant Type Check | src/auth/session.ts:89 | Low | High | Minor maintainability issue; duplicate validation of the userId string. |
Technical Analysis
The implementation uses Math.random() for session secret generation at line 14. This is cryptographically insecure. Furthermore, the validateSession function lacks a timestamp comparison against the expires_at column in the database, meaning revoked sessions may still grant access if the token is known.
Verification Plan
- Test Command:
npm run test:security -- src/auth/session.test.ts - Expected Result: Should fail on session reuse after
logout()call. - Execution Status: NOT RUN (Environment requires
process.env.DB_URL)
Verdict
CHANGES REQUESTED
The predictable token generation is a blocker. The session validation logic must be updated to check expiration timestamps before authorizing requests.
Next steps
- Replace
Math.random()withcrypto.randomBytes()for all secret generation. - Add a
Date.now() > session.expiresAtcheck in thevalidateSessionmiddleware. - Configure the session cookie with
httpOnly: trueandsecure: truein the production config.
Connects securely to your tools. The creator never sees your data.
About this skill
Code reviews often suffer from "LGTM" culture or subjective nitpicking that misses critical logic flaws. This skill implements an adversarial review workflow designed to find exploitable bugs, security vulnerabilities, and functional regressions before they hit production. It prioritizes evidence over opinion by requiring specific file paths, line ranges, and reproduction steps for every finding.
What it does
- Adversarial threat modeling proactively identifies risks in authentication, authorization, and data handling.
- Evidence-based reporting requires exact file/line references and impact analysis for every identified issue.
- Confidence scoring distinguishes between confirmed exploits and unverified hypotheses to prevent false alarms.
- Prioritized severity ranking ensures critical security and correctness blockers are addressed before maintainability nits.
- Verification checklists provide concrete commands and criteria to validate that fixes actually work.
How it works
- Scope definition establishes the baseline by reading diffs, callers, and requirement docs.
- Assumption falsification attempts to break the logic using static checks or focused tests.
- Structured reporting generates a review ordered by impact with minimal recommended fixes.
- Final verdict issues a
block,changes requested, orapprovestatus with a verification plan.
Frameworks & tools
This skill is language-agnostic and works with any version control system. It utilizes standard CLI tools for static analysis and testing when available in the environment.
Why this beats prompting it yourself
Generic prompts often return vague advice like "add more comments" or "refactor this function." This skill enforces a strict evidence-driven contract that prevents the agent from praising code it hasn't thoroughly stress-tested against boundary conditions.
Use cases
- Reviewing security-sensitive patches before merging into main branches.
- Auditing code written by other AI agents to catch "hallucinated" logic.
- Identifying data races and persistence failures in backend microservices.
- Performing pre-release regression checks on complex PRs.
Known limitations
Requires access to surrounding context beyond just the diff for high-confidence reviews. It cannot execute destructive operations or external service requests without explicit user authorization.
How to use
Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scanned
Verified clean 2 days ago
- Passed all security checks, Safe to install