Adversarial Code Reviewer

    1

    An evidence-based reviewer that finds exploitable bugs and security flaws using adversarial threat modeling.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    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

    FindingFile:LineSeverityConfidenceImpact
    Weak Token Generationsrc/auth/session.ts:14CriticalHighPredictable session IDs allow for account hijacking via brute force.
    Missing Expiry Checksrc/auth/session.ts:42HighHighTokens remain valid indefinitely after logout, increasing the attack surface.
    Insecure Cookie Flagssrc/auth/session.ts:58MediumMediumHttpOnly and Secure flags are missing, exposing tokens to XSS scripts.
    Redundant Type Checksrc/auth/session.ts:89LowHighMinor 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

    1. Replace Math.random() with crypto.randomBytes() for all secret generation.
    2. Add a Date.now() > session.expiresAt check in the validateSession middleware.
    3. Configure the session cookie with httpOnly: true and secure: true in 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

    1. Scope definition establishes the baseline by reading diffs, callers, and requirement docs.
    2. Assumption falsification attempts to break the logic using static checks or focused tests.
    3. Structured reporting generates a review ordered by impact with minimal recommended fixes.
    4. Final verdict issues a block, changes requested, or approve status 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.

    Requires surrounding file context for high-confidence logic analysis. Cannot perform destructive operations or merge code independently. Status of tests must be explicitly logged as NOT RUN if absent.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    • Free with an Agensi account

    Permissions

    No special permissions declared or detected

    Listed1 month ago
    Updated13 days ago

    What's inside

    Frequently Asked Questions

    Unlike standard reviews that focus on style, this skill acts as an attacker. It specifically looks for ways to bypass your logic, break authentication, or cause data corruption, requiring proof for every vulnerability it claims to find.

    This skill is language-agnostic and designed to work with any LLM-based agent that has access to a file system or version control API. It performs best when the agent can provide context from both the code diff and surrounding files.

    The skill includes the specialized adversarial workflow, structured reporting templates, and a set of verification protocols used to validate fixes. You will receive the configuration files and documentation needed to integrate it into your agent's environment.

    While the skill is highly effective at identifying logic flaws and security risks, it is not a sandbox. It can suggest reproduction commands, but it cannot execute destructive tests or access external networks unless your specific agent environment permits it.

    Setup is straightforward: you import the skill into your AI agent's toolkit and grant it read access to your repository. It is designed to plug directly into existing CI/CD pipelines or manual PR review workflows.

    The skill is excellent for auditing AI-generated code, as it is specifically tuned to ignore 'plausible-looking' logic and instead hunt for the subtle hallucinations and edge-case failures common in LLM output.

    New in Code Quality & Review