Logo de Irreversible Action Gate

Irreversible Action Gate

Comunidade
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).

Visão geral

Publicado porAnthonyAlcaraz
Repositórioagentic-graph-rag-skills
Nome da habilidadeirreversible-action-gate
Estrelas
29
Forks
9
Arquivos incluídos
5
LicençaMIT
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Arquivos incluídos: 5

    Scripts, templates e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente para leitura e nunca são executados.

  • Código aberto

    Publicada por AnthonyAlcaraz no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Irreversible Action Gate no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/tool-orchestration/irreversible-action-gate
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

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
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Irreversible Action Gate em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Irreversible Action Gate automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Irreversible Action Gate não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

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.

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Irreversible Action Gate faz?

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...

Por que usar Irreversible Action Gate no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Irreversible Action Gate é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Irreversible Action Gate no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/tool-orchestration/irreversible-action-gate. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Irreversible Action Gate?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Irreversible Action Gate?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Irreversible Action Gate com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Irreversible Action Gate é gratuita?

Sim. A habilidade é publicada no GitHub por AnthonyAlcaraz sob a licença MIT. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇