Irreversible Action Gate logo

Irreversible Action Gate

Community
AnthonyAlcaraz
irreversible-action-gate

Gate agent tool calls by reversibility BEFORE execution: classify each action REVERSIBLE / SEMI_REVERSIBLE / IRREVERSIBLE from its declared properties (side-effect scope, idempotency, destructiveness, compensating action), prescribe the matching delivery contract (idempotency key, retry policy, dry-run-first, human approval, compensation registration), check deterministic preconditions against graph facts, and analyze multi-step plans as sagas with an explicit point of no return. Use whenever an agent executes tools with side effects — anything beyond pure reads. NOT for read-only pipelines (nothing to gate), NOT a transaction manager (it prescribes the contract; your executor enforces it), NOT a substitute for the Ch6 information-flow or trust gates (those govern data and tool quality; this governs consequence).

Overview

PublisherAnthonyAlcaraz
Repositoryagentic-graph-rag-skills
Skill nameirreversible-action-gate
Stars
29
Forks
9
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by AnthonyAlcaraz on GitHub. Read the source before you install it.

Installation

Install the Irreversible Action Gate AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/tool-orchestration/irreversible-action-gate
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills.git /tmp/agentic-graph-rag-skills
mkdir -p .claude/skills
cp -r /tmp/agentic-graph-rag-skills/skills/tool-orchestration/irreversible-action-gate .claude/skills/irreversible-action-gate
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Irreversible Action Gate in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Irreversible Action Gate on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Irreversible Action Gate is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Irreversible-Action Gate

Overview

An agent that can call tools can cause consequences, and consequences are not uniform: re-reading a metric is free, scaling a service down is undoable, deleting a snapshot or paging a human is not. Most agent failures that make postmortems are not wrong answers — they are wrong actions that could not be taken back, retried into duplication, or executed before their preconditions held.

This skill is the deterministic gate at the execution boundary. It does four things, all before any tool runs: classifies the action's reversibility, prescribes the delivery contract that class demands, checks the action's preconditions against known graph facts (fail-closed), and — for multi-step plans — computes the compensation stack and the point of no return: the first irreversible step, before which recovery is backward (undo what was done) and after which recovery is forward only (finish what was started).

The classification is property-driven, not name-driven: an action is what its declared side-effect scope, idempotency, destructiveness, and compensation say it is. "The tool is called cleanup" carries no information; "the tool is data-destructive, external, and has no compensating action" does.

When to Use

  • Any agent whose tools mutate state: deployments, configuration changes, scaling, deletions, notifications, payments, ticket creation.
  • Before executing a multi-step remediation plan — the saga analysis tells you where the point of no return sits and whether reversible steps are needlessly ordered after it.
  • When designing a tool registry: run every tool through classify once and store the class as a tool property the orchestrator can filter on.
  • When an executor needs a retry policy and nobody has written one: the prescription (at-most-once vs at-least-once-with-key vs safe-retry) is derivable from the action's properties.

When NOT to Use

  • Read-only pipelines: every action classifies REVERSIBLE and the gate adds a no-op. Skip it.
  • As a transaction manager: this skill prescribes the contract (register compensation first, require the key, dry-run first); enforcing it is the executor's job. The gate cannot roll anything back itself.
  • As a replacement for the other Ch6 gates: information-flow-control-gate governs what data may flow between tools; draft-tool-trust-verifier governs whether a tool does what it claims. This skill governs what happens if the tool DOES what it claims and you wish it hadn't.
  • For human-approval workflow design: the gate says WHEN approval is required (irreversible without dry-run); how approval is collected is out of scope.

Process

StepWhat happensCLI
1Classify reversibility from declared propertiesclassify --action-spec action.json
2Prescribe the delivery contract (key, retry, dry-run, approval, compensation, consistency)prescribe --action-spec action.json
3Check preconditions against graph facts, fail-closedgate --action-spec action.json --facts facts.json
4Analyze a multi-step plan: compensation stack + point of no return + reorder flagssaga --plan-spec plan.json
5Walk the checkout-service remediation end-to-endscenario devops-remediation
6Run the verification batterybenchmark

Rationalizations (and why they fail)

RationalizationWhy it fails
"The model is careful; it won't call the destructive tool wrongly."Care is a probability; the gate is a contract. The classification runs in microseconds and does not have good days and bad days.
"We can always retry on timeout."A timeout on a non-idempotent mutation is not a failure receipt — the action may have succeeded. Retrying without an idempotency key is how one deployment becomes two. That is why the prescription forces at-most-once or a key, never blind retry.
"We'll add rollback handling later if we need it."After the point of no return there is no later. The saga analysis exists precisely because compensation must be registered BEFORE the step executes, not designed during the incident.
"Everything in our system is reversible; we have backups."Backups make internal destruction semi-reversible. They do nothing for external effects: pages sent, customers emailed, money moved. Scope is part of the classification for exactly this reason.
"Preconditions slow the agent down."The gate is one dict lookup per precondition. The Ch3 SHACL discipline it mirrors runs in milliseconds. The slow version is executing RollbackDeployment against a target that never carried :rollbackApproved.

Red Flags

  • An action classified IRREVERSIBLE executing without dry-run or human approval — the prescription was ignored, not wrong.
  • A non-idempotent mutation with retry_policy anything other than at-most-once or at-least-once-with-idempotency-key.
  • A saga whose compensation stack is empty while it contains SEMI_REVERSIBLE steps — compensations declared but not registered.
  • Reversible steps ordered after the point of no return without a stated reason — the reorder flags exist to be read.
  • A tool registry where every action classifies REVERSIBLE — almost certainly under-declared properties, not a genuinely harmless toolset.

Non-Negotiable Verification

  1. python cli.py benchmark exits 0 — the battery covers all three classes, the retry-policy matrix, fail-closed gating, PONR placement, and the reorder flag.
  2. python cli.py --help exits 0 and prints this skill's frontmatter description (so any harness can discover the skill from --help).
  3. For your own tool registry: run classify on every tool and have a human confirm the class of anything marked REVERSIBLE — under-declared properties are the failure mode the battery cannot catch for you.

Security Posture

  • Prompt injection: action properties come from the tool registry, not from retrieved text. If an attacker can edit the registry to mark a destructive tool idempotent: true, side_effect_scope: none, the gate is defeated — registry entries are privileged configuration and must be write-protected.
  • Data exfiltration: the gate itself reads only declared properties and boolean facts; it never sees payloads. Keep it that way — a gate that logs full tool arguments becomes a sensitive-data sink.
  • Privilege escalation: fail-closed is the invariant. A precondition absent from the facts dict blocks execution; treat any "default allow on missing fact" patch as a vulnerability, not a convenience.

Source Attribution

Distilled from Agentic GraphRAG (O'Reilly, by Anthony Alcaraz and Sam Julien), Chapter 6 — Tool Orchestration, composing the execution-boundary discipline the book states across chapters: Ch5's "action irreversibility" risk and Outlines-constrained plans with explicit rollback procedures, Ch3's SHACL precondition gates before tool invocation, Ch4's consistency escalation before irreversible decision points, and Ch7's reversibility hierarchy. External anchor: the saga pattern (Garcia-Molina & Salem, SIGMOD 1987) for compensation-based recovery.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Irreversible Action Gate AI skill do?

Gate agent tool calls by reversibility BEFORE execution: classify each action REVERSIBLE / SEMI_REVERSIBLE / IRREVERSIBLE from its declared properties (side-effect scope, idempotency, destructiveness, compensating action), prescribe the matching delivery contract (idempotency key, retry policy, dry-run-first, human approval, compensation registration), check deterministic preconditions against graph facts, and analyze multi-step plans as sagas with an explicit point of no return. Use whenever an agent executes tools with side effects — anything beyond pure reads. NOT for read-only pipelines...

Why use Irreversible Action Gate on TypingMind?

Because you install it once and use it with any model. Irreversible Action Gate is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Irreversible Action Gate in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/tool-orchestration/irreversible-action-gate. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Irreversible Action Gate?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Irreversible Action Gate?

As many as you like. As long as a model supports skills, you can use Irreversible Action Gate with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Irreversible Action Gate AI skill free?

Yes. It is published on GitHub by AnthonyAlcaraz under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇