Database Access Audit: Safety & Performance

    1

    Get a prioritized report on database access risks, supporting evidence, and recommended fixes.

    Free

    1 useSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Database Access Audit: Safety & Performance

    Example session with this skill installed

    Audit this PostgreSQL batch write: UPDATE invoices SET paid=true WHERE id=ANY($1). IDs come from customers. Table has tenant_id; no RLS or caller ownership check. Do not change code.

    • Read your context and instructions
    • Compiled the database access audit

    Reviewed the supplied statement in read-only mode. One high-priority isolation finding remains, based on your stated access controls.

    Audit report

    Scope and evidence: Supplied SQL and caller description only. Stack: PostgreSQL, user-specified. Driver, version, schema, and repository files were not provided.

    PriorityLocation and operationFindingEvidence and confidence
    P0Supplied UPDATE; one set-based batch writeCustomer-supplied IDs can target another tenant's invoices.No tenant predicate; you confirm no RLS or caller ownership check. High confidence given those facts.

    Counter-evidence and status: Parameter binding does not enforce ownership. The stated absence of other ownership controls leaves the finding survived within this limited scope; no independent repository verification was possible.

    Recommendation: Add an authenticated tenant predicate to the write. This retains the simple batch operation while restricting eligible rows. Decide how foreign or missing IDs should affect the response.

    Batch semantics: An empty PostgreSQL array matches no rows. Caller handling of empty input and affected-row results is unknown. The all-or-nothing contract is also unknown.

    Non-issue: This statement alone does not show looped I/O or N+1 queries. No business code changed.

    Next steps

    • Fix tenant scoping before performance work.
    • Test mixed-tenant IDs and empty batches in a test database.
    • Inspect the caller and driver to confirm rowcount and partial-success handling.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Database code can look correct while updating the wrong records or making too many queries. Get a prioritized review that shows where data access is risky, what supports each finding, and what to fix first.

    What it does

    • Finds data risks: Reviews account isolation, transactions, concurrent operations, and bulk changes.
    • Checks performance: Investigates repeated queries, N+1 access, large batches, and index support.
    • Explains findings: Provides code locations, supporting evidence, confidence, and practical fix recommendations.
    • Checks proposed shortcuts: Assesses whether bulk operations could skip required validation, events, or other business behavior.

    How it works

    1. Share your repository and name the service, endpoint, job, or area to review.
    2. Request an audit, or explicitly ask for code fixes.
    3. Receive a scoped report with priorities, uncertainties, and suggested validation.
    4. Use the recommended fix order to plan changes and tests.

    Works with

    Repository code, database schemas, migrations, tests, and available query logs. It does not assume a particular language, framework, ORM, or database engine.

    Why use this skill

    Spend less review time chasing suspicious-looking code that is actually safe. Findings are checked against surrounding code and available evidence, with data correctness considered before performance improvements.

    Use cases

    • Review a bulk update before release.
    • Investigate repeated queries in an endpoint.
    • Check account isolation in shared database tables.
    • Assess transaction safety in a background job.

    Known limitations

    The default review is static and read-only. Runtime behavior and performance may remain uncertain without logs, tests, or other supporting evidence.

    Static and read-only by default. Runtime and performance conclusions depend on available evidence. Code changes and potentially risky database execution require explicit authorization.

    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

    1 use

    Times used to date

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    • Free with an Agensi account

    Permissions

    Read Files
    Write Files

    Reads project code, schema, migrations, and tests. Write access is used only when the user explicitly asks for fixes.

    Listed1 month ago
    Updated1 month ago

    What's inside

    Frequently Asked Questions

    This skill acts as a specialized auditor that identifies logical data risks, such as N+1 query patterns, improper transaction handling, and potential account isolation leaks that traditional linters often miss.

    The skill is language and ORM agnostic; it works by analyzing your repository code, database schemas, and migration files regardless of whether you use SQL, NoSQL, or a specific framework like Rails or Django.

    To get the best results, provide access to your codebase and relevant schema files; the skill will then analyze the requested service or endpoint and return a prioritized report with specific code locations and fix recommendations.

    No, the skill performs a static, read-only analysis of your code and schema to identify risks without ever connecting to or modifying your live production data.

    Findings are prioritized and qualified by the available evidence. The report distinguishes confirmed behavior from hypotheses and names the checks needed to reduce uncertainty.

    New in Data & Databases