Human Approval and Control Boundaries
Bind human approval to immutable intents, then recheck scope, actor, artifact, and time at the execution boundary. Learn safe control design.
Language AI HandbookAll chapters Human Approval and Control Boundaries
A release assistant prepares a note for the Acorn project. Priya reviews the proposed text and authorizes publication on the project's public board. Before the queued work runs, the assistant regenerates the note. The request still says “publish the release note,” but its content has changed. A worker that remembers only that Priya clicked Approve can now publish text she never saw.
The worker needs the approved bytes, the affected resource and destination, the principals who may propose and authorize publication, and the latest time at which the decision may be used. It also needs to know what a pause can stop and what to do when a write commits but its response disappears. We will test each case with a release board held in memory. Nothing in the example publishes to a real service.
An approval records a decision by an authorized principal on a defined operation. This chapter binds the decision to the action, requester, resource, destination, artifact digest, and a bounded time window. A decision record can include a denial. The worker checks current policy and the live record before committing the simulated effect.
Why approval is a control boundary, not a dialog
The dialog is where a person inspects the proposal. The worker is where policy takes effect. If the publisher can run through another path that accepts ordinary model messages, skipping the dialog is enough to bypass the policy. Put the check at the operation boundary. In the example, the broker commits the release receipt itself. The assistant can ask for a decision and submit an intent, but its chat history provides no permission to write to the board.
Approval answers a different question from standing authorization. Standing authorization says that the publisher service may act on a particular board. Approval says that a particular release note may be published there within a specific window. Check both. An authenticated service can be out of scope for a destination, or it can hold a previously valid approval after the approver has lost responsibility for that project.
Ownership should be explicit before a request reaches the dialog. The requester identifies the needed work. The approver sees the operation and its effect. The worker checks policy and carries out the approved action. The audit record identifies who made each decision and which particular release it affected. NIST's AI RMF Core distinguishes responsibilities for human-AI oversight in GOVERN 3.2. MAP 3.5 calls for defining, assessing, and documenting oversight processes. The toy broker illustrates one way to encode those decisions; the framework does not prescribe its fields or thresholds.
The boundary also gives the reviewer a meaningful way to say no. An explicit denial is recorded for the intent in front of the reviewer. A missing answer leaves the worker without permission. A pause leaves the outcome pending while an authorized person checks a changed condition. Those states have different operational consequences and deserve distinct audit entries.
The effect model: classifying actions by reversibility
Start with what changes when the call succeeds. A local preview can be discarded. A stored internal draft can be restored from a prior version if the application keeps one. Publishing to a shared board can expose the note to people or processes outside the assistant's immediate control. A correction may fix what readers find on the board without undoing the fact that they were already shown the earlier note.
Read-only is a statement about writes. A read may still involve confidential content, a restricted resource, or a transfer to an external processor. The system needs explicit read and export boundaries even if its approval gate is primarily for writes. A preview that renders only within a private staging area and a preview sent outside it have different effects. Treat the destination as part of the operation.
Use a small effect classification for decisions in this deployment. Class 0 is a local lookup of an already accessible fixture. Class 1 is a local reversible change such as staging a preview. Class 2 is a board publication that deserves a named owner’s decision. Class 3 is an operation the example cannot classify, so the worker refuses it. These ordinal labels organize policy. They do not measure loss, duration, priority, or probability.
PythonIn [3]Expand
EFFECT_NAMES = ("Local read", "Local draft", "Publish", "Unknown")
KNOWN_ACTIONS = {"read-note": 0, "stage-preview": 1, "publish-note": 2}
def effect_class(action):
return KNOWN_ACTIONS.get(action, 3)The classifier is illustrative. It checks fixed operation names already declared by the implementation. It does not infer that an operation is safe because a caller says its name is “preview.” Only the modeled publish-note operation enters the broker implementation below. In a larger system, resolve the trusted operation and its target from the adapter that will actually perform the side effect. Its metadata should reflect what that adapter can do at a given destination.
PythonIn [4]Expand
import numpy as np
operation_names = [
"Inspect note",
"Stage private preview",
"Publish to board",
"Unrecognized action",
]
operation_classes = np.array(
[effect_class(a) for a in (*KNOWN_ACTIONS, "new-action")]
)VisualizationOut [5]Expand

The approval record: what the system must bind
An approval should answer enough questions for a disconnected worker to check it again later. Here the scope is a tuple of project, destination, and effect. The intent adds a requester, a stable operation key, and the exact artifact bytes. In a real release, a worker can fetch bytes from an immutable store and compare their digest immediately before executing. A path, filename, or editable document URL alone leaves open which version the worker will see.
- Requester. Record the authenticated principal requesting the operation and compare it with the principal reaching the execution boundary.
- Scope. Specify the project, destination, and effect rather than the name of the assistant or the topic of the conversation.
- Artifact. Present the version the person will approve and fingerprint the exact bytes used for execution.
- Decision and approver. Store approval or denial with the authenticated principal authorized for the scope.
- Time. Store issuance, approval expiry, and any earlier scope deadline. Use the earlier upper bound for this operation.
- Operation key. Allocate one key per intended effect; a retry of the same effect reuses the same key.
The digest here is a SHA-256 fingerprint computed over an unambiguous ordered JSON array. It includes a digest of the immutable artifact. The trusted broker stores the resulting approval in its own memory rather than relying on a digest supplied by the assistant. A fingerprint verifies byte relationships between two records when serialization agrees. Actor authentication, authorized issuance, and storage integrity require separate controls. A service that accepts approvals across a trust boundary needs a transport and credential design of its own.
The notebook passes trusted fixture times as integer seconds. Calls always check the current broker state, so supplying an earlier time does not recover a historical state. A deployed worker needs time from a trusted clock at the authorization check. When the stated approval and scope windows differ, the operation is eligible only before their minimum. The exact instant of expiry is excluded. A paused job that resumes before both deadlines may proceed if its approval and ownership are still current. A paused job that wakes after the deadline needs renewed authority.
PythonIn [6]Expand
import json
from dataclasses import dataclass, replace
from hashlib import sha256
@dataclass(frozen=True)
class Scope:
project: str
destination: str
effect: str
@dataclass(frozen=True)
class Intent:
requester: str
request_key: str
scope: Scope
artifact: bytes
def __post_init__(self):
if type(self.scope) is not Scope or type(self.artifact) is not bytes:
raise TypeError("Provide a scope and immutable artifact bytes.")
fields = (
self.requester,
self.request_key,
self.scope.project,
self.scope.destination,
self.scope.effect,
)
if any(type(value) is not str or not value.strip() for value in fields):
raise ValueError(
"Identity, key and scope fields must be nonempty strings."
)
def artifact_digest(self):
return sha256(self.artifact).hexdigest()
def digest(self):
fields = [
self.requester,
self.request_key,
self.scope.project,
self.scope.destination,
self.scope.effect,
self.artifact_digest(),
]
return sha256(
json.dumps(fields, ensure_ascii=True).encode()
).hexdigest()
@dataclass(frozen=True)
class Approval:
intent: Intent
intent_digest: str
approver: str
issued_at: int
expires_at: int
scope_expires_at: int
decision: str
@dataclass(frozen=True)
class Receipt:
intent_digest: str
artifact_digest: str
approval_id: int
approver: str
committed_at: int
@dataclass(frozen=True)
class Result:
status: str
receipt: Receipt | None = None
@dataclass(frozen=True)
class AuditEntry:
time: int
event: str
approval_id: int | None
actor: str
outcome: str
operation_key: tuple[str, str]
intent_digest: strThe receipt records the digest and approver of the committed intent. A stored approval is a decision. A receipt is evidence of the simulated effect. During recovery, a receipt lookup answers what has already happened; passing the authorization check would answer whether a new dispatch is eligible. Those operations have different inputs and should not share a single “authorized” state.
The approval broker: pull model
The caller submits its immutable intent and the decision identifier. The broker looks up its own record, checks the subject and exact scope, and compares the digest before it is allowed to create a release receipt. The decision identifier points to stored state. Possession of that identifier does not override policy or substitute for the requester's identity.
In the example both principal names stand for identities already resolved by trusted code. Outside a toy, the caller cannot set the “authenticated actor” field on its own. The owners map and the writers map model separate policy decisions. The owner can record a decision for the scope. The service may attempt dispatch for the scope. A person with approval rights is not automatically delegated execution rights.
We represent authorization as checks inside the same single-threaded broker method that performs the toy write. This avoids a gap between issuing a reusable permit and using it in the notebook. For a real queue or remote system, put the final check and key reservation as close to commit as the service contract permits. A short-lived permit checked only on dequeue may expire or be revoked while the job is still in flight.
PythonIn [7]Expand
# The two maps are deliberately separate.
public_note = Scope("acorn", "public-board", "publish-note")
birch_note = Scope("birch", "public-board", "publish-note")
owner_policy = {"priya": {public_note}, "rei": {public_note, birch_note}}
writer_policy = {"publisher": {public_note, birch_note}}The broker validates caller scope on issuance and again before dispatch. In the latter check it also verifies that the original approver is still authorized, so ownership changes can invalidate an otherwise exact approval. The order of checks chooses which status a caller sees when several conditions fail at once. An individual reason records the failure encountered in that call. It does not establish that the remaining conditions would pass.
Alongside each computed artifact digest, the next invariant checks which operation fields enter the combined digest. Holding the bytes fixed while changing the destination changes the intent fingerprint. The distinct artifact hash is the same because the file itself has not changed.
PythonIn [8]Expand
def require_integer_seconds(*times):
if any(type(time) is not int for time in times):
raise TypeError("Use integer seconds for broker times.")
class ApprovalBroker:
"""Single-threaded synthetic publisher for release notes."""
def __init__(self, owners, writers):
self.owners = {
actor: frozenset(scopes) for actor, scopes in owners.items()
}
self.writers = {
actor: frozenset(scopes) for actor, scopes in writers.items()
}
self.approvals = {}
self.latest_decision = {}
self.paused = set()
self.revoked = set()
self.committed = {}
self.audit = []
def _record_event(self, now, event, approval_id, actor, outcome, intent):
self.audit.append(
AuditEntry(
now,
event,
approval_id,
actor,
outcome,
(intent.requester, intent.request_key),
intent.digest(),
)
)
def decide(
self, intent, actor, now, expires_at, scope_expires_at, *, allow
):
if not self._known_scope(intent):
raise PermissionError("This operation is outside broker policy.")
if intent.scope not in self.owners.get(actor, ()):
raise PermissionError(
"The approver lacks authority for this scope."
)
if type(allow) is not bool:
raise TypeError("Record an explicit Boolean approval decision.")
require_integer_seconds(now, expires_at, scope_expires_at)
if min(expires_at, scope_expires_at) <= now:
raise ValueError("An approval deadline must follow issuance.")
approval_id = len(self.approvals) + 1
decision = "allow" if allow else "deny"
self.approvals[approval_id] = Approval(
intent,
intent.digest(),
actor,
now,
expires_at,
scope_expires_at,
decision,
)
self.latest_decision[intent.digest()] = approval_id
self._record_event(
now, "decision", approval_id, actor, decision, intent
)
return approval_id
def interrupt(self, approval_id, actor, now, *, permanent=False):
require_integer_seconds(now)
if type(permanent) is not bool:
raise TypeError("Choose temporary or permanent explicitly.")
approval = self.approvals[approval_id]
if actor != approval.approver:
raise PermissionError(
"Only the recorded approver interrupts this demo."
)
if permanent:
self.revoked.add(approval_id)
outcome = "revoked"
else:
self.paused.add(approval_id)
outcome = "paused"
self._record_event(
now, "interrupt", approval_id, actor, outcome, approval.intent
)
def release_pause(self, approval_id, actor, now):
require_integer_seconds(now)
approval = self.approvals[approval_id]
if actor != approval.approver:
raise PermissionError(
"Only the recorded approver can release the pause."
)
self.paused.discard(approval_id)
self._record_event(
now,
"release-pause",
approval_id,
actor,
"released",
approval.intent,
)
def _known_scope(self, intent):
return (
intent.scope.effect == "publish-note"
and intent.scope in self.writers.get(intent.requester, ())
)
def _status(self, intent, actor, now, approval_id):
if actor != intent.requester or not self._known_scope(intent):
return "requester-outside-policy"
approval = self.approvals.get(approval_id)
if approval is None:
return "approval-required"
if approval.intent_digest != intent.digest():
return "intent-changed"
if self.latest_decision[approval.intent_digest] != approval_id:
return "decision-replaced"
if approval.decision == "deny":
return "denied"
if intent.scope not in self.owners.get(approval.approver, ()):
return "authority-changed"
if approval_id in self.revoked:
return "revoked"
if approval_id in self.paused:
return "paused"
if (
not approval.issued_at
<= now
< min(approval.expires_at, approval.scope_expires_at)
):
return "outside-time-window"
return "eligible"
def dispatch(self, intent, actor, now, approval_id, *, lose_ack=False):
require_integer_seconds(now)
status = self._status(intent, actor, now, approval_id)
if status != "eligible":
self._record_event(
now, "dispatch", approval_id, actor, status, intent
)
return Result(status)
key = (intent.requester, intent.request_key)
record = self.committed.get(key)
if record is not None:
status = (
"already-committed"
if record.intent_digest == intent.digest()
else "key-conflict"
)
self._record_event(
now, "dispatch", approval_id, actor, status, intent
)
return Result(
status, record if status == "already-committed" else None
)
approval = self.approvals[approval_id]
record = Receipt(
intent.digest(),
intent.artifact_digest(),
approval_id,
approval.approver,
now,
)
self.committed[key] = (
record # This insert is the only simulated effect.
)
self._record_event(
now, "commit", approval_id, actor, "committed", intent
)
if lose_ack:
return Result("ack-unknown")
return Result("committed", record)
def lookup_receipt(self, intent, actor):
"""Read a receipt under the toy's shared publication scope."""
if actor != intent.requester or not self._known_scope(intent):
return Result("requester-outside-policy")
record = self.committed.get((intent.requester, intent.request_key))
if record is None:
return Result("no-receipt")
if record.intent_digest != intent.digest():
return Result("key-conflict")
return Result("already-committed", record)Each new decision replaces the prior decision for the same exact intent. A deny decision therefore blocks use of an older approval ID for that intent. Replacement leaves the prior decision in the audit history. The in-memory commit dictionary is the only simulated publication. The key is (requester, request_key). An eligible repeat with the same intent digest reads its existing receipt. If the caller reuses the key for a different, separately authorized intent, the broker reports a conflict without a second write. One key per intended operation allows people to repeat a genuine operation with a new decision and a distinct key when policy permits it.
PythonIn [9]Expand
def make_broker():
return ApprovalBroker(owner_policy, writer_policy)
first_intent = Intent(
"publisher",
"release-acorn-1.4",
public_note,
b"Acorn 1.4 is available now.",
)
birch_intent = Intent(
"publisher",
"release-birch-2.0",
birch_note,
b"Birch 2.0 is available now.",
)PythonIn [10]Expand
moved_intent = replace(
first_intent, scope=replace(public_note, destination="private-board")
)
print(
"same artifact:",
first_intent.artifact_digest() == moved_intent.artifact_digest(),
)
print("same action:", first_intent.digest() == moved_intent.digest())ConsoleOut [10]Expand
same artifact: True same action: False
The distinct roles can be tested separately. Priya owns only Acorn’s public board. Rei owns both the Acorn and Birch boards. The same publisher identity may dispatch to both, provided an appropriate human approves the exact action. A proposal for one project cannot inherit the authority granted for the other. Treat authorization for a shared tool as narrower than authorization for every possible use of that tool.
PythonIn [11]Expand
scope_checks = [
("Priya · Acorn", "priya", public_note, public_note),
("Priya · Birch request", "priya", public_note, birch_note),
("Priya · Birch scope", "priya", birch_note, birch_note),
("Rei · Birch", "rei", birch_note, birch_note),
]
array_scope = np.array(
[
[scoped in owner_policy[actor], requested == scoped]
for _, actor, scoped, requested in scope_checks
],
dtype=int,
)VisualizationOut [12]Expand

The two columns answer different questions. An Acorn owner can put forward Acorn as a scope, but that decision cannot authorize a Birch publication. A request that matches a Birch scope cannot rely on a decision by a person who lacks authority there. The chart holds the other worker checks out of view so these two comparisons are visible.
Failure mode: stale plan
A queue gives the planner time to change its mind. The same release might be regenerated with a later section, a different project, a new destination, or a revised audience. Treat a changed operation as a changed intent. In particular, the actor's approval binds the old note digest and the destination shown at the time of review. It should fail even when the high-level description remains “publish Acorn's release note.”
PythonIn [13]Expand
stale_broker = make_broker()
stale_id = stale_broker.decide(first_intent, "priya", 30, 330, 150, allow=True)
rewritten = replace(
first_intent, artifact=b"Acorn 1.4 preview is available tomorrow."
)
print(
"changed artifact:",
stale_broker.dispatch(rewritten, "publisher", 41, stale_id).status,
)
print(
"original action:",
stale_broker.dispatch(first_intent, "publisher", 42, stale_id).status,
)ConsoleOut [13]Expand
changed artifact: intent-changed original action: committed
Changing one field and preserving the previous record is useful as a test. The rejected request should have no new receipt. A subsequent call containing the approved bytes can still commit while the original approval is valid. This distinction lets the caller diagnose which alternative was rejected without quietly carrying over the approval.
If it is useful to authorize a narrow class of changes, state that class in the policy and in the approval UI. For example, a person may authorize the publication of a fixed set of assets under a defined destination and cutoff. The worker must still check membership of the final choice. The notebook uses a single exact intent rather than a field-omitting digest that could make an unrelated change invisible. A later section shows why a second approval for changed bytes does not allow reuse of the original operation key after commit.
Failure mode: ambiguous acknowledgement
The word “yes” in a conversation may acknowledge an update or agree to keep preparing a draft. It is too ambiguous to authorize an external effect when there are several pending proposals. Resolve the displayed proposal in the UI, collect an explicit decision for its immutable intent, and send that decision through the trusted approval path. A chat turn that does not select an operation remains conversational evidence only.
PythonIn [14]Expand
ack_broker = make_broker()
print(
"plain acknowledgement:",
ack_broker.dispatch(first_intent, "publisher", 41, None).status,
)
no_id = ack_broker.decide(first_intent, "priya", 42, 342, 162, allow=False)
print(
"recorded denial:",
ack_broker.dispatch(first_intent, "publisher", 43, no_id).status,
)ConsoleOut [14]Expand
plain acknowledgement: approval-required recorded denial: denied
There is a separate ambiguity after dispatch. The caller can time out even though the remote service performed the operation. The safest next step depends on what the service can report about the original operation. If it has a stable receipt identity, look up that instance. If the service promises idempotency for the same principal, key and intent, a retry using those exact values can recover the prior result. Losing a response alone does not establish either success or failure.
The Amazon Builders’ Library account of retries describes caller-provided request identifiers associated with the same caller. It calls for recording the key and making the corresponding changes atomically and durably. That requirement closes two failure cases: creating the effect without its idempotency record, and writing the record without making the effect. This single-threaded fixture models both as one dictionary insertion. It cannot establish the guarantees of an external service.
PythonIn [15]Expand
retry_broker = make_broker()
retry_id = retry_broker.decide(first_intent, "priya", 30, 330, 150, allow=True)
unknown = retry_broker.dispatch(
first_intent, "publisher", 47, retry_id, lose_ack=True
)
known = retry_broker.lookup_receipt(first_intent, "publisher")
repeat_result = retry_broker.dispatch(first_intent, "publisher", 48, retry_id)
print("first response:", unknown.status)
print("lookup:", known.status)
print("same-key retry:", repeat_result.status)
print("simulated publications:", len(retry_broker.committed))ConsoleOut [15]Expand
first response: ack-unknown lookup: already-committed same-key retry: already-committed simulated publications: 1
The response is ambiguous because the demonstration discards the receipt returned to the caller. The committed record still exists. The unchanged retry can recover it while the current dispatch checks pass. After expiry, dispatch refuses the exact same request even when the original receipt still exists. The demo permits a separate lookup by the same requester under the current publication scope, regardless of approval expiry. Losing that scope blocks lookup while leaving the receipt in storage. A deployed service may give an audit owner separate read access. If the downstream cannot safely reconcile an uncertain attempt, keep the status uncertain and escalate it. A fresh key risks creating an independent operation.
A later denial can supersede an approval for the same operation. If the original publication already committed, a denial blocks dispatch and the authorized receipt lookup still returns that effect. In the next block no dispatch has committed yet, so replacing the decision creates a hold and produces no receipt.
PythonIn [16]Expand
decision_broker = make_broker()
allow_id = decision_broker.decide(
first_intent, "priya", 31, 331, 151, allow=True
)
denied_id = decision_broker.decide(
first_intent, "priya", 32, 332, 152, allow=False
)
print(
"superseded decision:",
decision_broker.dispatch(first_intent, "publisher", 33, allow_id).status,
)
print(
"new denial:",
decision_broker.dispatch(first_intent, "publisher", 33, denied_id).status,
)
assert not decision_broker.committedConsoleOut [16]Expand
superseded decision: decision-replaced new denial: denied
Failure mode: authority confusion
A human participant can read a proposal without owning the resource it will change. An authenticated user can own one project and be unable to approve another. Teams may delegate certain decisions to an on-call role for a period, with a separate rule for decisions requiring a second approver. Record the relevant subject and scope in the decision, then check that authority is still current when using it.
PythonIn [17]Expand
authority_broker = make_broker()
try:
authority_broker.decide(birch_intent, "priya", 30, 330, 150, allow=True)
except PermissionError as err:
print("wrong resource owner:", str(err))
authority_id = authority_broker.decide(
birch_intent, "rei", 31, 331, 151, allow=True
)
print(
"wrong requester:",
authority_broker.dispatch(
birch_intent, "other-worker", 32, authority_id
).status,
)
authority_broker.owners["rei"] = frozenset({public_note})
print(
"ownership changed:",
authority_broker.dispatch(
birch_intent, "publisher", 33, authority_id
).status,
)ConsoleOut [17]Expand
wrong resource owner: The approver lacks authority for this scope. wrong requester: requester-outside-policy ownership changed: authority-changed
The invalid actor never gets a decision on Birch. The valid actor can make one while her scope includes Birch. Holding that approval identifier does not grant dispatch to other-worker, and removing Birch from the approver's current authority blocks it even for the correct requester. Owner sets are replaced only through trusted administrative actions; the direct assignment here is a way to simulate such a policy update.
An unsupported operation is also stopped before a decision. It cannot become an approved-looking publication simply because the owner has authority for a board.
PythonIn [18]Expand
unsupported = replace(
first_intent, scope=replace(public_note, effect="archive-note")
)
try:
authority_broker.decide(unsupported, "priya", 34, 334, 154, allow=True)
except PermissionError as err:
print("unsupported operation:", str(err))ConsoleOut [18]Expand
unsupported operation: This operation is outside broker policy.
Interruption, cancellation, and preemption
A stop request has different effects before and after commit. A queued operation can be paused or withdrawn while there has been no external write. An operation already underway needs a worker or service that cooperates with cancellation before an irreversible step. Once an operation has committed, stopping the agent prevents further work. Separate recovery or compensation is needed to address what it already did.
The example checks both paused and revoked immediately before a simulated write. This toy lets the recorded approver change the interruption state even after scope ownership moves. Dispatch still checks current ownership. A deployed service can delegate authority to clear a pause under an explicit policy. Permanent revocation stays attached to that decision ID. A new authorized approval can make an uncommitted intent eligible while the original ID remains revoked. Neither interruption deletes the prior decision or an existing receipt. If an interruption and dispatch race in a production system, the observable result depends on their order at the actual commit boundary. In that system, persist the decision state with the claim or lock on the relevant operation. The notebook processes operations sequentially, so the ordered test outcomes are deterministic.
PythonIn [19]Expand
interrupt_broker = make_broker()
interrupt_id = interrupt_broker.decide(
first_intent, "priya", 30, 330, 150, allow=True
)
interrupt_broker.interrupt(interrupt_id, "priya", 60)
print(
"while paused:",
interrupt_broker.dispatch(
first_intent, "publisher", 70, interrupt_id
).status,
)
interrupt_broker.release_pause(interrupt_id, "priya", 80)
interrupt_broker.interrupt(interrupt_id, "priya", 100, permanent=True)
interrupt_broker.release_pause(interrupt_id, "priya", 105)
print(
"after permanent revocation:",
interrupt_broker.dispatch(
first_intent, "publisher", 110, interrupt_id
).status,
)
print("simulated publications:", len(interrupt_broker.committed))ConsoleOut [19]Expand
while paused: paused after permanent revocation: revoked simulated publications: 0
Measure cancellation by observable effect, not by the speed with which the UI changes color. A useful service test covers three positions: before a queued worker starts, just before the service commits, and after the receipt exists. At the last position, a successful interruption can stop the next operation, while the already-completed operation still has a recorded receipt.
PythonIn [20]Expand
def eligibility_trace(permanent_at):
test_broker = make_broker()
uid = test_broker.decide(first_intent, "priya", 30, 330, 150, allow=True)
bins = np.arange(0, 161, 5)
values = []
for t in bins:
if permanent_at is not None and t == permanent_at:
test_broker.interrupt(uid, "priya", int(t), permanent=True)
values.append(
test_broker._status(first_intent, "publisher", int(t), uid)
== "eligible"
)
return bins, values
timeline_s, eligible_until_expiry = eligibility_trace(None)
_, eligible_with_revocation = eligibility_trace(100)VisualizationOut [21]Expand

The two traces are eligibility checks, not completion rates. The curve with no revocation ends at the scope deadline even though the approval deadline is much later. The earlier fall shows what a permanent revocation changes. An already committed write would still appear in the board's receipt index.
Reversibility and the "compensate instead of approve" pattern
An internal draft with immutable versions may have a well-understood restore operation. A release that has already been viewed by other people has a different recovery story. It can be corrected or withdrawn at its origin, but cached and copied versions may remain elsewhere. Treat compensation as a new action with its own scope and permissions, even when it tries to counteract an earlier one.
A compensation design should name the side effects it can repair and those it cannot recall. For instance, an internal preview can be discarded when only the requesting process can read it. A correction to a shared note may need to inform the people who saw the old note. Logging the original and the correction gives reviewers a way to trace when each view was shown. Overwriting the original record loses that timeline.
Use measured recovery properties. Before putting an action in a lightly reviewed category, check who can run the compensation, how quickly they can run it, whether an external observer sees either operation, and how completion is checked. The existence of a rollback function in source code gives no measurement of how reliably it restores the intended state. Some applications will retain an approval requirement even for actions that are reversible technically because disclosure, cost, or timing matters.
Escalation and the approval ladder
An escalation policy routes a decision to a role with the relevant authority. A team that drafts an internal note may not own the public board. If the owner is unavailable, raise the request to a declared delegated role or leave it pending until the deadline. Repeated requests and queue delay do not establish new authority. The reason for escalating should be visible to the person who receives the request.
Role separation can protect decisions where one person should not control the entire workflow. A second reviewer can notice a changed audience or artifact that an earlier reviewer missed. To enforce two-person approval, require two authorized distinct subjects to approve the same intent under the same policy window, with distinct decisions preserved. Clicking the same button twice or forwarding a screenshot is not evidence of having two distinct decision makers. The toy implements single-owner approval and makes the extra role a design choice for applications that need it.
Define three ordinary outcomes after escalation: a timely approved action, a timely denial, and an unanswered request by expiry. Use the last outcome to hold consequential work or continue a separately authorized, lower-impact task such as revising a draft. Neither case grants the original action by implication. If the approver returns later, show the current selected artifact and ask for a fresh decision if the old one has expired.
Ownership and audit
A record of the final decision should give an investigator enough context to answer who did what, to which resource, and whether a write actually occurred. Preserve the operation key, policy scope, approval and receipt references, and timestamps. Bind the referenced artifact to immutable bytes so the reader can inspect exactly what was approved without publishing those bytes in ordinary logs. Limit log access because audit trails can contain identifiers or operational detail.
An audit row should describe an attempted step even if it never changed the board. Recognizing a stale-plan rejection, a pause, or a denial can explain why a queue stalled. A replay that simply reads an existing receipt needs a different status from a write that created it, or a reader may count two publications for one accepted operation. Deleting denials would destroy evidence about what the worker tried, as well as about legitimate activity blocked by policy.
The demo logs the time, event, decision ID when available, actor, outcome, operation key, and digest of the attempted intent. Two rejected note variants can therefore have different digests even when both used the same approval and key. The log omits the note bytes. The demo logs accepted decision records, dispatch outcomes, and changes to interruption state. Receipt lookups and invalid issuance attempts before a decision is recorded are outside this log. A deployed service can specify separate access and logging for searches of existing receipts.
PythonIn [22]Expand
print("stored approvals:", sorted(retry_broker.approvals))
print("committed operation keys:", sorted(retry_broker.committed))
assert sum(entry.event == "commit" for entry in retry_broker.audit) == 1ConsoleOut [22]Expand
stored approvals: [1]
committed operation keys: [('publisher', 'release-acorn-1.4')]PythonIn [23]Expand
print("retry audit:")
for entry in retry_broker.audit:
print(
entry.time,
entry.event,
entry.approval_id,
entry.actor,
entry.outcome,
entry.operation_key,
entry.intent_digest[:12],
)ConsoleOut [23]Expand
retry audit:
30 decision 1 priya allow ('publisher', 'release-acorn-1.4') 7966c26d51d8
47 commit 1 publisher committed ('publisher', 'release-acorn-1.4') 7966c26d51d8
48 dispatch 1 publisher already-committed ('publisher', 'release-acorn-1.4') 7966c26d51d8Here the simulated request created one commit row. The retry returned an existing receipt and produced a dispatch audit row. In larger systems, persist the trace together with its policy and receipt references, and restrict who can change it. A sample audit list is mutable in memory and fails to survive a process crash. Its value here is that the exact decision logic creates visible, distinct events.
Putting it together: a worked incident
A designer makes a final change after Priya approves Acorn’s original note. The worker sees the changed text and stops. Before the deadline, the worker submits the original version under Priya’s existing approval. The board accepts it, but the caller does not receive the acknowledgement. The recovery path reuses the same identity and key, then returns the original receipt. Priya then approves the rewritten note. Submitting it with the consumed operation key triggers a conflict and leaves the original publication intact.
PythonIn [24]Expand
incident_broker = make_broker()
incident_id = incident_broker.decide(
first_intent, "priya", 30, 330, 150, allow=True
)
incident_results = [
incident_broker.dispatch(rewritten, "publisher", 39, incident_id).status,
incident_broker.dispatch(
first_intent, "publisher", 40, incident_id, lose_ack=True
).status,
incident_broker.lookup_receipt(first_intent, "publisher").status,
incident_broker.dispatch(first_intent, "publisher", 41, incident_id).status,
]
replacement_id = incident_broker.decide(
rewritten, "priya", 44, 344, 164, allow=True
)
incident_results.append(
incident_broker.dispatch(rewritten, "publisher", 45, replacement_id).status
)PythonIn [25]Expand
print("incident outcomes:", incident_results)
print("simulated publications:", len(incident_broker.committed))
assert incident_results == [
"intent-changed",
"ack-unknown",
"already-committed",
"already-committed",
"key-conflict",
]
assert len(incident_broker.committed) == 1ConsoleOut [25]Expand
incident outcomes: ['intent-changed', 'ack-unknown', 'already-committed', 'already-committed', 'key-conflict'] simulated publications: 1
A worker debugging this example should first reconstruct what was approved, then what reached the publish boundary, and finally what receipt exists under the original key. Retrying with a brand-new key would change the operation being reconciled. If stakeholders really want to publish a corrected note, ask them to authorize a separate action under its own key. The separate receipt can refer to the old one through application metadata without erasing it.
Here the new decision applies to a distinct key. The fixture commits it and preserves both records. Matching the new artifact digest means the second record cannot stand in for the first.
PythonIn [26]Expand
new_operation = replace(rewritten, request_key="release-acorn-1.4-correction")
new_id = incident_broker.decide(
new_operation, "priya", 50, 350, 170, allow=True
)
second = incident_broker.dispatch(new_operation, "publisher", 51, new_id)
assert second.status == "committed"
assert len(incident_broker.committed) == 2
assert (
second.receipt.artifact_digest
!= incident_broker.lookup_receipt(
first_intent, "publisher"
).receipt.artifact_digest
)
print("separately authorized correction:", second.status)ConsoleOut [26]Expand
separately authorized correction: committed
A note on latency and the human in long-horizon systems
A long-running system can create a request faster than a reviewer can handle it. If approval is needed when an irreversible action is ready, provide the reviewer with enough detail to make the decision before the deadline. The worker can queue or defer the request, but it still has to verify scope and time when it resumes. Do not count time before an owner has seen the requested action as review time or silently move the deadline while work waits.
When the valid period is short, put any lengthy preparation before the approval or request approval only once the immutable action is ready. Conversely, a longer window leaves more time for ownership or the environment to change. The chart below compares remaining window lengths for a 300-second approval and an earlier 120-second scope deadline. Only timing differs in the chart. Scope, roles, digest, revocation, and key binding still matter even while a window remains positive.
PythonIn [27]Expand
elapsed_s = np.arange(0, 331, 10)
remaining_approval_s = np.maximum(0, 300 - elapsed_s)
remaining_scoped_s = np.maximum(0, min(300, 120) - elapsed_s)VisualizationOut [28]Expand

The queued request with a scope limit has no remaining window at 120 seconds. At the same moment the other request has 180 seconds remaining. A queue evaluator can make those deadline losses visible with separate measurements for time waiting on a person and time waiting on the worker. If the policy requires action only while both checks pass, moving the worker closer to the reviewer or splitting preparation from dispatch can reduce avoidable expiry without widening authority.
PythonIn [29]Expand
clock_broker = make_broker()
clock_id = clock_broker.decide(first_intent, "priya", 30, 330, 150, allow=True)
print(
"before issue:",
clock_broker.dispatch(first_intent, "publisher", 29, clock_id).status,
)
print(
"exactly at scope expiry:",
clock_broker.dispatch(first_intent, "publisher", 150, clock_id).status,
)ConsoleOut [29]Expand
before issue: outside-time-window exactly at scope expiry: outside-time-window
Limitations and impact
This example uses an in-process policy map, synthetic actor names, integer times, and a dictionary of receipts. It holds the full artifact in memory and treats the dictionary insert as commit. A deployed broker needs trusted identity resolution, storage with an explicit consistency model, time bounds enforced at the actual commit boundary, and a downstream interface that can retain and reconcile operation outcomes. Those are requirements on the surrounding system, not properties that can be established by running the notebook.
Concurrent workers make the check-and-write relationship important. Two workers could both see no earlier receipt unless creation of the key and its effect are serialized by the resource owner. A volatile state map can also forget approvals and receipts after a restart. Retain the keys and their related outcomes for a defined period that matches the supported retry contract. Pay attention to partial completion and whether retries stay within the original authorization scope. Test crashes or lease changes at the point where the resource can actually change.
An approval UI can make the policy clearer or conceal it. Show the final artifact, named destination and effect in the review panel. When there are two different requests for the same resource, distinguish them so an approval does not attach to whichever request was most recent. A notice about being able to take action can inform behavior, but only the worker's check determines whether it can actually perform an action under the policy.
The notebook can demonstrate a denial, a stale artifact, interruption, losing the acknowledgement, recovery of the original receipt, and reuse of a key with a new intent. It cannot show that people are good at evaluating release content, that an actual organization delegates authority correctly, or that a remote service can undo a visible publication. Evaluate those claims using the deployment's own people, policies, and interfaces.
Summary
Keep a human decision bound to an immutable intent. Recheck the effect, actor, scope, artifact and time at the boundary that performs the write. Record approval, denial, interruption, and commit as distinct events. Use a downstream contract that identifies one intended operation and records its outcome so a retry can recover it. Preserve the original receipt when a correction addresses an earlier effect.
Quiz
Human Approval and Control Boundaries
Join the discussionAsk a question or share what you learned.
Keep exploring
Reference
Citation details
Cite or share this article.


Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!