Logo: Irreversible Action Gate

Irreversible Action Gate

Communautéit
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).

Iwwersiicht

EditeurAnthonyAlcaraz
Repositoryagentic-graph-rag-skills
Skill-Nummirreversible-action-gate
Stären
29
Forks
9
Matgeliwwert Dateien
5
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 5 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    AnthonyAlcaraz huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Irreversible Action Gate an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/tool-orchestration/irreversible-action-gate
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Irreversible Action Gate an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Irreversible Action Gate automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Irreversible Action Gate net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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...

Firwat Irreversible Action Gate op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Irreversible Action Gate besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Irreversible Action Gate an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/tool-orchestration/irreversible-action-gate an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Irreversible Action Gate benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Irreversible Action Gate benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Irreversible Action Gate domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Irreversible Action Gate gratis?

Jo. AnthonyAlcaraz huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇