One governed tool gateway

The idea

Every action goes through one gateway. It checks authorization, policy, risk, budget and approval, writes the action ledger first, and reads back each external write. A model answer can only add a requirement.

The problem
A model's judgement cannot be trusted to respect permissions and budgets.
Why it matters
Permissions, approvals and read-backs apply to every tool, whoever calls it.
Where it stands
In production as of

A step-by-step replay of this idea is not published yet. The library adds one when a recorded run shows it.

  • System One decision cascade

    Bounded choices (route, next action, failure class, done, risk, intent) are typed questions. A rule answers first, then a typed arm, then a small LLM, each with a confidence.

  • Completion truth gates

    New tests must run here or have a trace for each assertion. Claimed behaviour must be tested, and the same bug elsewhere fixed or ruled out. Planned changes must exist, steps tick only on evidence, and spend over budget needs a recorded decision.

  • Approvals on web, WhatsApp, Slack and Teams

    A governed action waits for an approval that eligible people decide on the web, WhatsApp buttons or Slack/Teams direct messages; the requester never decides, and owned resources are approved by their owner.

  • Idempotent action ledger

    Each outside action is written with an idempotency key before it runs and settled after. A crash between the two leaves it 'unknown', and the model checks the outside system instead of repeating the action.

  • Only the operator's own words instruct

    Only a verified sender's own lines are instructions; forwarded, quoted, fetched, partner and guest-command text is data, hidden characters are stripped, and actions after instruction-shaped content wait for a person.

  • Read-back of external writes

    After a connector writes, it reads the object again, and the gateway compares the declared fields. A mismatch that stays fails verification.

Turn the numbers into shipped work.

Crewshal runs these choices for you: a persistent AI worker with memory and rules, on your Claude and Codex subscriptions.