Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    TollGate - agent money safety review

    1

    Audit code for money-moving AI agents to prevent double-spending, race conditions, and unrecorded transfers.

    Free

    Security scanned
    TollGate - agent money safety review

    TollGate - agent money safety review

    Example session with this skill installed

    Review the payment worker in services/billing.py and the idempotency logic in db/locks.sql. Find any race conditions in the spending cap logic.

    • Read your context and instructions
    • Compiled the tollgate - agent

    I have completed the safety review of the billing worker and database constraints. I identified one Critical race condition and one High severity durability issue.

    Agent money-safety review — Billing Service

    #PathEntry pointDecisionProvider callRecordedVerdict
    1Agent RefundPOST /refundauthorize()stripe.Refund.createaction tableFAIL

    Findings

    #SeverityLocationFailure scenarioMinimal fix
    1Criticalservices/billing.py:142check_cap() reads the sum then writes. 50 concurrent requests can all read the same balance and spend past the limit.Use SELECT ... FOR UPDATE on the actor row before calculating the rolling sum.
    2Highdb/locks.sql:12The idempotency index is missing the actor_id scope. A replay with a different actor could collide with an existing key.Update UNIQUE INDEX to include (actor_id, idempotency_key).

    Top 3 fixes, in priority order

    Lock actor rows — prevents the race condition identified in check_cap(). Proves it: test_rolling_cap_is_atomic.
    2. Scope idempotency keys — ensures unique constraints work across multiple users.
    3.

    Atomic commits — Move the Stripe call record and the database transaction into a single block to prevent unrecorded transfers.

    Next steps

    • Implement the SELECT FOR UPDATE pattern in the authorize function.
    • Add the provided concurrency test suite to your CI pipeline.
    • Verify that the Stripe idempotency_key is derived deterministically from the action_id.

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

    About this skill

    Building an AI agent that handles payments or irreversible API calls is a high-risk engineering challenge where a single race condition or unhandled timeout results in direct financial loss. This skill provides a specialized security auditor designed to find the four specific ways money-moving agents fail: double spending, unauthorized movement, unrecorded transfers, and lost state. It performs a deep-dive code review of authorization caps, idempotency logic, and human-in-the-loop flows to ensure your agent is safe for production traffic.

    What it does

    • Map side-effect paths by tracing every route where an agent causes a real-world effect from entry point to recording.
    • Audit idempotency logic to ensure retries and duplicate webhooks cannot move money twice.
    • Verify atomic caps by checking for row locks and preventing race conditions during spending threshold checks.
    • Enforce failure classification by ensuring the system fails closed on timeouts or 5xx errors rather than assuming success.
    • Review LLM grounding to prevent models from talking their way past rejections or inventing transaction records.

    How it works

    1. Trace execution paths to identify every function that calls a payment provider or triggers an irreversible action.
    2. Execute triage greps to find common vulnerabilities like float-based math, lookup-then-insert patterns, or missing row locks.
    3. Audit against six invariants including choke point enforcement, atomic cap math, and single-transaction commits.
    4. Produce a severity-ranked report with specific file-and-line evidence and minimal, shippable fixes for every finding.

    Frameworks & tools

    This skill is framework-agnostic but optimized for stacks using SQL databases like PostgreSQL for concurrency control. It includes specific patterns for Python and JavaScript environments.

    Why this beats prompting it yourself

    Generic security prompts miss the nuance of agentic failure modes like model hallucination in audit logs or crash-recovery cycles. This skill enforces a strict evidence standard where a control only exists if it is backed by a database constraint or atomic code path.

    Use cases

    • Auditing a Stripe-integrated refund agent for idempotency and replay safety.
    • Checking spending cap logic in a multi-agent autonomous procurement system.
    • Verifying that human-in-the-loop approval flows survive process restarts.
    • Reviewing webhook handlers to prevent double-processing of payment events.

    Known limitations

    Does not cover PCI-DSS certification, KYC/AML screening, fraud modeling, or the internal guarantees of external payment providers.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.

    Focuses on code-level invariants and database constraints. Does not perform live network penetration testing or provide legal/regulatory compliance certification.

    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 buying a skill.

    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 to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 5 days ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Read Files
    Network Access
    Listed5 days ago

    What's inside

    Frequently Asked Questions

    This skill focuses specifically on 'transactional integrity'—preventing race conditions, double-spending, and unrecorded state—rather than general cybersecurity like SQL injection or cross-site scripting.

    The skill is framework-agnostic and works with any agent architecture (LangChain, AutoGPT, or custom loops) as long as it handles financial side effects via code or API calls.

    Yes, the audit specializes in verifying 'idempotency keys' and retry logic to ensure that if an agent crashes or a webhook is sent twice, money is only moved once.

    You receive the specialized auditing agent, a library of safety patterns for common payment providers, and a structured reporting template for severity-ranked findings.

    While it can audit any logic, it provides the most value for systems using relational databases (like PostgreSQL) where it can verify specific row-locking and atomic constraint patterns.

    This skill focuses on the engineering safety of the agent's code; it does not provide legal compliance, KYC/AML verification, or PCI-DSS certification.

    New in Agents & Orchestration

    Free