---
title: "How RotaGrant works: nine gates before the action | Rotascale"
description: "Three lines in the agent's own code, and every consequential action is checked against a bounded authority a named human signed for — before it happens."
url: https://rotascale.com/platform/
---

Platform

# Nine gates, before the action.

Three lines in the agent's own code, and every consequential action it takes is checked against a bounded authority a named human signed for — **before** the action, with the answer recorded either way.

```
# The agent appears here, the first time it speaks. Nobody registers it.
agent = rs.agent("settlement-bot")

# One episode of work, recorded as it happens.
with rs.witness(agent, goal={"ticket": ticket_id}) as t:

    # Ask BEFORE acting. The answer is recorded either way.
    decision = t.authorize(grant_id, {"tools": ["settle_payment"]},
                           amount_minor=600_000, currency="EUR")

    if decision.allowed:
        settle_payment(...)          # only reached if it was allowed
        t.outcome(decision="settled")
    else:
        # A refusal is not an exception. It is the product working,
        # and it is already in the evidence stream by the time you read this.
        t.outcome(decision="refused", reason=decision.reason)
```

## The order is fixed, and the order is the design

Cheap structural checks first, expensive evaluation last, and the budget debited last of all — so an action refused by policy costs nothing. A gate that never runs cannot be wrong, and a ceiling that is never touched cannot leak.

| # | Gate | What it asks |
| --- | --- | --- |
| 1 | **authority** | Is there any authority for this at all? |
| 2 | **status** | Is the grant active, or revoked, or still awaiting a second approver? |
| 3 | **window** | Is now inside the grant's window? |
| 4 | **scope** | Does the grant cover this action? |
| 5 | **clean context** | Was the context clean, where this grant requires it to be? |
| 6 | **bounds** | Do the per-action limits hold? |
| 7 | **policy** | Does the policy on this grant permit it? |
| 8 | **budget** | Is there room under the ceiling — and under every ancestor's? |
| 9 | **review** | Does this need a person before it runs? |

**Not applicable is kept separate from passed.** Every decision can render what each gate did — passed, refused, not reached, or not applicable. A grant carrying no policy must not display as though a rule had approved the action, because a reader counting green marks would reach a conclusion nobody supported.

## Six answers, not two

An authorisation is not a boolean. The reason a refusal happened decides what the remedy is, and collapsing them into `false` throws away the only part anybody can act on.

- **`allow`**: Within authority. The action may run, and the ceiling is debited after it does — or held, if the grant names a resource.
- **`deny`**: Outside scope, or refused by policy. Not retryable; a human has to change the grant.
- **`exhausted`**: The budget or the call count is spent — on this grant or on one of its ancestors. The remedy is a new grant, not a wider scope.
- **`gated`**: The trajectory's context is tainted and this grant requires a clean one. The agent read something untrusted and then tried to act.
- **`review_sync`**: A person must decide before it runs. The queue item already exists.
- **`review_async`**: It ran, and a person will see it. Counted as allowed, because the agent acted.

## Roll it out without breaking anything

A control switched on everywhere at once is a control switched off again by Friday. Every grant runs on a ladder, and a rollout report says what the next rung *would* have refused — over real recorded history, not a simulation.

#### observe

Decides in full and refuses nothing. This is how you find out what it would have stopped, before it stops anything.

#### shadow

Evaluated alongside the live path, still refusing nothing.

#### canary

Refuses for a stated share of traffic. The first rung that can say no.

#### enforce

Refuses everything that exceeds the grant.

A grant in `observe` is instrumentation, not governance, and every screen that lists one says so. A dashboard showing it as a working control is the failure this design exists to prevent — and a delegated grant may climb the ladder but never descend it.

## And once it is running, how do you know it still behaves?

A grant is checked at the moment of an action. None of this is — it is checked afterwards, over a window of what actually happened, which is the only way to answer a question about behaviour rather than about one decision.

- **Somebody declares what it will do**: A behavioural contract: *never calls `wire_transfer`*, *refused at most 5% of decisions*. Nine clause types, each rendering as one line a manager can be held to, because a signature over a page of policy is not an attestation. Tightening one is free; loosening it has to be said out loud, in somebody's name. [reference →](https://docs.rotascale.com/concepts/behavioural-contracts)
- **The platform measures whether it did**: Three answers, never two: `held`, `breached`, and **not demonstrated** — the window cannot tell those apart, and saying so is the answer. The third is decided by a confidence interval rather than a comparison, so an agent at 5.4% against a 5% ceiling over forty decisions is not breaching. It is unmeasured. [reference →](https://docs.rotascale.com/concepts/conformance-claims)
- **And a claim expires**: A lower bound, a denominator, a window, and a date it lapses without fresh evidence. You cannot certify a non-deterministic actor; you can maintain a claim, and a claim that never expires is a certificate wearing a different word. It is signed with the deployment's key, so it checks off this system — [in your own browser](https://rotascale.com/verify/), or with any Ed25519 implementation.
- **Optionally, authority withdraws itself**: A circuit breaker turns a breach into a revocation without waiting for somebody to read a screen. It ships observing, and arming one requires stating how many times it would have fired over ninety days of real history — the number has to match what the platform computes. [reference →](https://docs.rotascale.com/concepts/circuit-breakers)

**A breach is a finding, not a refusal** — unless you arm a breaker. Acting on a contract at the moment of a decision would refuse an action because of a population it had not yet joined, and the first breach would block traffic that had already been allowed under the same numbers. What refuses at decision time is the grant.

## Where to go next

[Authority What an agent may do](https://rotascale.com/platform/authority/) [Evidence What survives being checked](https://rotascale.com/platform/evidence/) [Compliance Several regimes at once](https://rotascale.com/platform/compliance/) [Assurance Where our controls fail](https://rotascale.com/platform/assurance/) [Architecture How it is built](https://rotascale.com/architecture/)
