Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    PostgreSQL Tenant Isolation Audit

    1

    Trace cross-workspace access risks through API authorization, SQL, RLS roles, pooled connections, caches and jobs. Get evidence-linked findings and tests.

    $9

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    PostgreSQL Tenant Isolation Audit

    PostgreSQL Tenant Isolation Audit

    Example session with this skill installed

    FICTIONAL supplied-evidence exercise; no live actions.

    Source-only audit. Ordinary member authenticated in tenant A can supply invoice ID. Handler UPDATE invoices SET paid=true WHERE id=$1 has no ownership check. RLS enabled; tenant policy exists. Runtime role app_owner owns table, FORCE RLS off, no other enforcement described. Tests use owner role and only A records. Explain finding, counter-evidence and proposed negative tests. No database access.

    • Read your context and instructions
    • Compiled the postgresql tenant isolation

    Tenant isolation review: tenant-1

    Source-only review of the supplied invoice-update path. No database, browser, network, deployment, or schema change was used. PostgreSQL version, ORM/pooler, grants beyond ownership, and exact policy SQL were not supplied. Evidence labels below refer only to the fictional request.

    • T1: An ordinary authenticated tenant A member supplies an invoice ID.
    • T2: Handler executes UPDATE invoices SET paid=true WHERE id=$1, without an ownership check.
    • T3: RLS is enabled and a tenant policy exists.
    • T4: Runtime role app_owner owns the table; FORCE RLS is off; no other enforcement is described.
    • T5: Existing tests use the owner role and contain only A records.
    Entry pointTrusted tenant sourceRuntime role/contextEnforcementEvidence/status
    Invoice paid updateAuthenticated A membership; transaction propagation unspecifiedapp_owner; context unspecifiedID-only SQL; no ownership check; owner normally bypasses non-forced RLST1–T4: reachable source-supported gap

    Ranked findings

    1. High priority: ordinary callers reach an update without effective tenant enforcement. Actor: ordinary A member. Entry point: supplied invoice ID in handler T2. Expected: A may change an authorized A invoice; supplying B's invoice ID cannot alter B. Actual described path: the query selects by ID alone, while table ownership and FORCE RLS off mean the described tenant policy does not constrain the runtime owner in ordinary PostgreSQL behavior. Given a B invoice ID, this path can mark B's invoice paid. Consequence: unauthorized cross-tenant invoice-state mutation, with possible downstream accounting behavior; downstream effects were not supplied and are not asserted. Confidence is high in the source-supported violation mechanism; no exploit or database observation was performed. RLS enabled and a tenant policy are counter-evidence to lack of any security intent, but do not defeat this role-specific bypass. An ID's unpredictability would not establish authorization.

      Smallest corrective owner: the invoice service/runtime database-access owner. Reuse its existing transaction and authorization helpers if present. Enforce ownership using trusted authorized tenant context at the update boundary and verify the affected-row contract. Select and verify a restricted runtime database identity with reviewed grants/policies; do not blindly add FORCE RLS as the entire repair. Review role membership, superuser/BYPASSRLS attributes, maintenance paths, and migration effects before choosing database changes. FORCE RLS does not constrain superusers or BYPASSRLS roles.

    Acceptance evidence gap: T5 proves neither cross-tenant denial nor intended restricted-runtime enforcement. Owner-only same-tenant tests may pass while the violation remains. Keep same-tenant success tests, add adversarial fictional fixtures and test both intended restricted identity and owner behavior separately.

    Negative acceptance plan

    All rows are proposed, not run. Use fictional A/B invoices, including unpaid B invoice inv-b-fictional, and no external providers.

    Fictional caseRuntime identityExpected resultNo-side-effect assertionStatus
    A updates AActual request identity, then intended restricted identity after repairAuthorized update succeedsExactly intended A mutation onlyProposed
    A supplies B IDSame identities, owner tested explicitlyDenied/zero affected rows under corrected contract; avoid disclosing B existenceB remains unpaid; no domain event, job, or external callProposed
    A reads B, if a read route existsActual read identityNo B fields disclosedNo writes/events/callsProposed, route evidence needed
    Missing/empty/invalid contextRestricted runtime roleFail closedNo invoice/event/job/effectProposed
    Reuse pooled connection A → B → absent context, including rollbackActual pool identityNo stale tenant authorizationNo unrelated reads/mutations/events/effectsProposed, pool contract needed
    Mixed A/B batch or cross-tenant child-parent linkage, if supportedActual route/job identityReject unauthorized elements according to documented atomicityNo B changes/events/effectsProposed, path evidence needed
    Job created before A membership revocationActual job identityHonor documented reauthorization/revocation contractNo unauthorized update or effectProposed, job contract needed

    Unverified boundaries and acceptance steps

    Obtain redacted policy/grant/role definitions and the transaction-context and pool lifecycle source, plus existing invoice authorization/event code. Verify USING and WITH CHECK applicability, policy composition, trusted context establishment, and reset behavior; parameterization alone does not authorize a row. Review only relevant related jobs, cache/read paths and maintenance entry points when supplied. No evidence establishes their behavior here.

    Acceptance requires the narrow repair, isolated A/B tests under the actual intended runtime identity, explicit owner behavior checks, and separately authorized complete browser acceptance of the affected invoice flow when an environment is available. This sample does not certify repository-wide isolation.

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

    About this skill

    Audit selected PostgreSQL SaaS tenant boundaries using redacted source/schema and the actual runtime identity. Distinguish reachable access violations from defense-in-depth observations, privileged maintenance paths and unverified risks. Covers role ownership/BYPASSRLS, policy composition, transaction context, cached responses, jobs and negative acceptance scenarios. Includes a boundary-method reference, report template and fictional worked example. Read-only by default; no database connection, exploit, schema change, production query or security certification is included. Fictional supplied-evidence exercises are documented separately; no live provider, database, browser or cross-agent compatibility acceptance is claimed.

    Source analysis cannot prove whole-system security; isolated runtime-role tests and separately authorized browser acceptance remain necessary.

    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

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 21 days ago

    Permissions

    Read Files

    Read bundled and supplied redacted evidence only. Optional browsing, saving a report, implementation and external effects depend on host tools and task authorization. No provider account or credentials required for supplied-evidence review.

    Listed21 days ago

    What's inside

    Frequently Asked Questions

    Four Markdown files: SKILL.md, one method reference, one report template and a fictional worked example. The listing icon is a separate asset.

    No production connector, credentials or runtime are bundled. Supplied-evidence analysis works from authorized redacted material; live checks depend on separately authorized host tools.

    No. The default deliverable is an evidence-linked analysis and proposed next steps. Implementation, settings changes, messaging and deployment require the task authorization.

    Two fictional supplied-evidence forward exercises for this skill using Codex, plus frontmatter, linked-resource and ZIP round-trip checks. No live integration or other-agent compatibility validation is claimed.

    Source analysis cannot prove whole-system security; isolated runtime-role tests and separately authorized browser acceptance remain necessary.

    New in Security