Pre-Action Gate & Spend Guard

    by Enoch Gardiner

    1

    Implement a fail-closed safety gate to prevent unauthorized spending, media generation, and data leaks.

    $2

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Pre-Action Gate & Spend Guard

    Example session with this skill installed

    I need to generate a high-res promotional video for the 'Project Phoenix' launch using our paid media credits. Here is the source script: assets/script_v2.txt. Check the rules and log it.

    • Read your context and instructions
    • Compiled the pre-action gate

    I have processed the pre-action gate for the media generation request. The standing rules for credit consumption were evaluated, and the gate is now locked in the ledger.

    Pre-Action Ledger Entry: Media Generation

    FieldValue
    Timestamp2023-10-27T14:22:05Z
    Classmedia
    ActionGenerate high-res promotional video for Project Phoenix
    NamedProject Phoenix
    Source Fileassets/script_v2.txt
    CheckedRule ID 104 (Spend Cap): Yes, within $50 limit. Rule ID 201 (Source Match): Verified script_v2.txt is the latest master.
    ApprovalUser prompt: "generate a high-res promotional video for the 'Project Phoenix' launch"

    The entry has been successfully appended to gate-ledger.jsonl.

    Next steps

    1. Initiate the video generation API call using the approved script.
    2. Verify the generated file against the destination path.
    3. Update the ledger with the final result status once the asset is received.

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

    About this skill

    A pre-action gate for agents: no irreversible action — media generation, money spend, sign-in, external send — happens until a structured pass entry is written to an append-only ledger, checking standing rules, the exact named source, and the approval it rides on. Includes the gate workflow, a standing-rules template, the best-file-first and honest-state doctrines, and a stdlib ledger tool that validates entries and refuses incomplete ones. From THE PASSWORD.

    Requires Python 3. Cannot block actions if the agent bypasses the gate via custom tools. Does not monitor routine read-only operations.

    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

    Money-back guarantee

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

    Trust & safety

    Security scan

    Security scan passed 14 days ago

    Software
    Python

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed14 days ago
    Updated12 days ago

    What's inside

    Frequently Asked Questions

    This skill acts as a hard stop between your agent's decision and the actual API call. Unlike prompts that agents can ignore, this requires a successful Python-validated ledger write before any high-stakes action can trigger, effectively preventing accidental overspending or data leaks.

    The gate is framework-agnostic and works with any agent capable of executing local Python scripts or CLI commands. As long as your agent can trigger a script before performing an action, you can integrate this safety layer into your workflow.

    The package includes the core validation logic in `gate_ledger.py`, a template for your `standing-rules.json`, documentation for the six-field ledger schema, and implementation guides for common agentic workflows.

    Yes, the `standing-rules.json` allows you to define specific criteria for different action classes. You can set unique safety checks for financial transactions that differ from the rules applied to media generation or data transfers.

    No, the gate is 'fail-closed,' meaning if the script cannot run, the ledger is inaccessible, or the validation fails, the action is automatically blocked. This ensures safety even in the event of a system error or agent confusion.

    New in LLM Ops

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.