Skip to content
Sefra

Pillar: approvals

Approval of exact content

A decision is bound to a hash of the submitted plan: its steps, inputs, requester and policy version.

Read the approvals guide

What goes wrong without it

  • An approver says yes to a description, and something else runs. Nothing ties the decision to the content.
  • Either the agent can pay vendors or it cannot. There is no way to let it prepare a payment that a person releases.

How it works

When a rule asks for a person, the execution is held and the agent gets a handle. It holds the execution and not the agent, which is free to do other work. On the approval page, the API or the CLI, the approver reads typed summary lines, the full input, the rule and the requester. A signed webhook can tell a receiver you configure that an approval waits. It carries the summary lines, required roles, expiry and hash, with a link to the full approval. The decision carries back the hash that was shown.

The approval, as the approver reads it

Summary

  1. Create vendor: Northwind Supplies GmbH, DE
  2. Create purchase order: 10 x LAPTOP-14 from (output of step vendor), unit price 120000 EUR (minor units), department it-ops
  3. Pay deposit: 360000 EUR (minor units) for purchase order (output of step order)
Rule
procurement.irreversible_requires_approval
Requester
agent:procurement-bot for user:u_jonas
Required role
finance_approver
Step inputs
shown in full; left out of this drawing
Expires
24 hours after creation
Execution hash
sha256:c41e…

Agent-supplied, unverified

New laptop supplier, 30% deposit agreed.

The signed webhook, drawn

Sent to the receiver you configure, with the headers X-Sefra-Timestamp and X-Sefra-Signature.

{
"created_at": "…",
"data": {
"approval_id": "apr_…B",
"execution_hash": "sha256:c41e…",
"expires_at": "…",
"link": "https://your-sefra/approvals/apr_…B",
"required": ["finance_approver"],
"summary": [
"Create vendor: Northwind Supplies GmbH, DE",
"Create purchase order: 10 x LAPTOP-14 from (output of step vendor), unit price 120000 EUR (minor units), department it-ops",
"Pay deposit: 360000 EUR (minor units) for purchase order (output of step order)"
]
},
"id": "apr_…B",
"type": "approval.requested"
}

The webhook only notifies. The decision is made on the approval page, or with the operator API or CLI.

What the hash binds

The execution hash is SHA-256 over the canonical JSON of this document. Changing any value, the order of steps, the requester or the policy version changes the hash, and a decision that carries a different hash is refused with HASH_MISMATCH. Inputs are hashed as submitted, with references unresolved and sensitive fields in their redacted form. The agent's rationale is shown but is not covered by the hash.

The document the approval is bound to
{ "principal": "agent:procurement-bot", "on_behalf_of": "user:u_jonas",  "steps": [ { "intent": "…", "version": 1, "input": { … } } ],  "bundle_digest": "sha256:9f2c…" }

Scroll sideways for long lines.

Evidence levels

Each decision records how the person was identified. A rule can demand a minimum level. A requirement of oidc can be met only on the approval page.

  1. tokenA bearer token on the operator API or the CLI. Proves a client holds a credential, not that the person signed in to decide.
  2. oidcSign-in on the approval page through your identity provider. Records who was authenticated when the exact content was approved. It is not a signature by the approver.
  3. webauthnWebAuthn approvalsPlannedThe approver's authenticator signs a challenge derived from the execution hash: a true signature over the approved content.

What it does not do

  • Approval never overrides policy. Each step is evaluated again when it runs, on fresh facts, and can still be denied.
  • Approval does not freeze the facts. If the budget changes while a plan waits, the step-time check sees the new value.
  • Manipulation of an approver by agent text is reduced and not eliminated: summaries use typed fields only, and the rationale is labelled as unverified.

How it behaves

Automated tests cover each of these behaviours.

  • An order at or above the approval threshold is held, approved and then executed. A signed webhook can tell your receiver that it is waiting.
  • If the approver denies it, the execution ends with APPROVAL_DENIED and nothing is written.
  • If nobody decides before the deadline, it ends with APPROVAL_EXPIRED.
  • A wrong hash, a person without the role and an agent are each refused, and so is the requesting user where the rule requires a distinct approver.
  • A new bundle activated during the wait does not change the execution. Every decision names the version it was made under.
  • An agent can cancel a pending execution. Cancelling a finished one is refused.
  • A step that needs a role nobody approved fails with APPROVAL_SCOPE_EXCEEDED, and the plan is undone.

What is planned

On our product plan, and listed on the status page with its current state.

  • WebAuthn approvalsPlanned

Start with a pilot

Stopping an agent is the easy half. Sefra also finishes the job.