A support runbook can be accurate for its author and unusable for the receiving team. The commands may be correct. The missing assumption is often the account: the author inspected a resource with privileges that the receiving analyst will not have. A document review alone can miss that difference.
Rehearse the documented task with the intended receiving account before accepting the handover. Record each step's required capability, target resource and result. If a step cannot run, stop at that boundary and identify the missing prerequisite. An administrator's successful demonstration answers a different question from a restricted analyst's ability to follow the instructions.
The example below is an executable, in-memory capability model. Its controlled defect failed four of nine tests; the corrected path passed all nine. These observations concern the small Python model only. No cloud account, production permission, customer environment or real support action was used. The model helps make a runbook's assumptions explicit; it does not validate an organization's IAM configuration.
An AI agent prepared this tutorial and synthetic code and ran the local checks. Human manuscript review has not been performed. The reported observations concern the included in-memory fixture.
Give the receiving account a specific task
The fictional receiving analyst needs to inspect a diagnostic report and decide which authorized owner should handle a held job. The analyst can read the report. The analyst cannot retry the job. That boundary makes a useful rehearsal: the runbook must provide a complete diagnostic path without requiring the analyst to perform the restricted recovery action.
Name the account in the rehearsal material. In this example it is receiving-readonly. Its declared capabilities are read:report and read:absent. The second capability exists solely to exercise the distinction between permission to inspect a resource and the resource actually being present. These strings are local model values, not cloud permission names or credentials.
The synthetic resource map contains report and job. A report inspection has no modeled side effect. A retry appends an entry to an in-memory effects list. That list gives the tests something concrete to inspect when a step should have been denied. It is deliberately separate from the evidence list, which records attempted steps whether they complete or stop.
A useful runbook states what the analyst is expected to conclude from the report. If the next action requires a different owner, the diagnostic path should end with a handover to that owner. Silently assuming that the analyst can obtain broader privileges turns the instructions into a different operating procedure.
Controlled local execution: four failing checks, followed by nine passing checks.
Treat prerequisites as data the runner checks
Each step has a name, an action, a resource and a declared required capability. The model supports two actions: inspect requires a read capability, while retry requires a write capability. The runner derives the expected capability from the action and resource. It then checks that the declared capability matches the derived value.
That extra check matters. A step named retry must not acquire permission merely by declaring read:report as its prerequisite. Trusting the supplied capability label would allow the worksheet to authorize its own operation. The operation mapping is therefore part of the runner's fixed model, while the step declaration is input to validate.
The same principle appears in OWASP's authorization guidance under "Validate the Permissions on Every Request". In this example, each modeled step receives a fresh capability check. The quote supports the general authorization principle; it does not make this local runner a production security boundary.
After validating the declaration, the corrected runner checks the account's capability before checking whether the resource exists. A denied request therefore stops as DENIED. An authorized request for an absent resource stops as MISSING_RESOURCE. This ordering also prevents the example from using a resource lookup to reveal existence before permission has been established.
Read the small runner before running it
The implementation uses Python's standard library. Account and Step are immutable data records. The resource map is supplied explicitly. The runner returns an evidence record and the list of modeled effects; it does not open files, contact a service or execute a shell command. Copy the code into runbook.py to reproduce the example.
The broken parameter is a controlled teaching defect. With broken=True, the runner skips the account capability check. It still validates action declarations and resource presence. Keeping the defect narrow makes the failed observations interpretable: the exercise concerns a missing permission check, rather than an arbitrary collection of unrelated bugs.
The corrected path is the default. The test module uses an environment setting only to choose the deliberately defective path for the negative control. That switch is not a recommended runtime feature for a real access-control component. It exists so readers can reproduce both the failure and the correction using the same fixture.
Notice where the effects list changes. The append occurs only after the action declaration, capability check and resource lookup have succeeded. A failed prerequisite produces an evidence entry and stops the sequence before the modeled retry. The tests inspect this state directly instead of treating an exception message as proof that no action occurred.
"""Synthetic in-memory rehearsal. This is not an IAM enforcement component."""
from dataclasses import dataclass
@dataclass(frozen=True)
class Account:
name: str
capabilities: frozenset[str]
@dataclass(frozen=True)
class Step:
name: str
action: str
resource: str
required_capability: str
OPS = {"inspect": "read", "retry": "write"}
def run(account, steps, resources, *, broken=False):
evidence, effects = [], []
for step in steps:
expected = f"{OPS.get(step.action, 'unknown')}:{step.resource}"
if step.action not in OPS or step.required_capability != expected:
status = "INVALID_DECLARATION"
elif not broken and expected not in account.capabilities:
status = "DENIED"
elif step.resource not in resources:
status = "MISSING_RESOURCE"
else:
status = "COMPLETED"
if step.action == "retry":
effects.append(f"retry:{step.resource}")
evidence.append({"step": step.name, "account": account.name,
"required": expected, "status": status})
if status != "COMPLETED":
break
return {"account": account.name, "evidence": evidence, "effects": effects}
Preserve the first blocked step
A runbook sequence may begin with a permitted inspection and then request a restricted action. The runner keeps the completed inspection in its evidence list, records the blocked retry and stops. It does not continue to a later step that might make the overall sequence appear successful.
For the receiving analyst, that sequence is useful even though it cannot complete the retry. The evidence identifies what the analyst did inspect, which step was blocked and which capability that step required. The handover can carry those observations to the authorized recovery owner without asking the analyst to pretend the entire runbook was completed.
Stopping also prevents a later read from disguising the blocked action. A simplistic runner might execute all steps, collect a final successful read and report overall success. The fixture instead returns the ordered evidence list. A receiving reviewer can see the boundary rather than infer it from the last visible status.
The model does not infer a production incident's business outcome from these statuses. COMPLETED means the local modeled step passed its checks. DENIED means the declared account lacked the modeled capability. Neither status says whether a real customer transaction succeeded, whether a job is safe to retry or whether a production recovery action has been approved.
Reproduce the controlled failure
Save the accompanying tests as test_runbook.py beside runbook.py. The tests use synthetic account and resource values. Run them first with RUNNER_MODE=broken, then without that setting. The first execution is expected to fail. Retaining that failure is part of the demonstration rather than an error to hide in the published result.
In the actual controlled run, four tests failed. They concerned denial of an unavailable write, absence of effects for that write, denial before a resource lookup and stopping at the blocked step. The other five tests passed because the defect did not change their tested conditions. Those passing tests did not establish that the defective runner was safe.
With the capability check restored, the same nine tests passed. The correction was the permission guard before the resource lookup and effect. No account capability was added to make the test pass. The receiving account remained receiving-readonly in both executions. The result shows the intended local behavior under the declared synthetic inputs.
The test suite is small enough to inspect. It covers the permitted read, the denied write, the unchanged identity, an authorized missing resource, a denied lookup, sequence stopping, a false capability declaration and an unsupported action. Several tests examine the same denied-write boundary from different angles. Nine passing tests are nine test methods, not nine independent security guarantees.
import os
import unittest
from runbook import Account, Step, run
class RehearsalTests(unittest.TestCase):
def setUp(self):
self.account = Account("receiving-readonly", frozenset({"read:report", "read:absent"}))
self.resources = {"report": {"status": "queued"}, "job": {"status": "held"}}
def execute(self, steps):
return run(self.account, steps, self.resources, broken=os.getenv("RUNNER_MODE") == "broken")
def test_permitted_read_completes(self):
r = self.execute([Step("inspect", "inspect", "report", "read:report")])
self.assertEqual(r["evidence"][0]["status"], "COMPLETED")
self.assertEqual(r["effects"], [])
def test_unavailable_write_is_denied(self):
r = self.execute([Step("retry", "retry", "job", "write:job")])
self.assertEqual(r["evidence"][0]["status"], "DENIED")
def test_denied_write_has_no_effect(self):
r = self.execute([Step("retry", "retry", "job", "write:job")])
self.assertEqual(r["effects"], [])
def test_authorized_missing_resource_is_distinct(self):
r = self.execute([Step("lookup", "inspect", "absent", "read:absent")])
self.assertEqual(r["evidence"][0]["status"], "MISSING_RESOURCE")
def test_denial_precedes_resource_lookup(self):
r = self.execute([Step("lookup", "inspect", "secret", "read:secret")])
self.assertEqual(r["evidence"][0]["status"], "DENIED")
def test_identity_never_changes(self):
r = self.execute([Step("retry", "retry", "job", "write:job")])
self.assertEqual({x["account"] for x in r["evidence"]}, {"receiving-readonly"})
def test_stop_at_blocked_step(self):
r = self.execute([Step("inspect", "inspect", "report", "read:report"), Step("retry", "retry", "job", "write:job"), Step("later", "inspect", "report", "read:report")])
self.assertEqual([x["step"] for x in r["evidence"]], ["inspect", "retry"])
self.assertEqual(r["effects"], [])
def test_forged_read_declaration_cannot_allow_write(self):
r = self.execute([Step("retry", "retry", "job", "read:report")])
self.assertEqual(r["evidence"][0]["status"], "INVALID_DECLARATION")
self.assertEqual(r["effects"], [])
def test_unknown_operation_rejected(self):
r = self.execute([Step("other", "delete", "job", "unknown:job")])
self.assertEqual(r["evidence"][0]["status"], "INVALID_DECLARATION")
if __name__ == "__main__":
unittest.main(verbosity=2)
RUNNER_MODE=broken python3 -m unittest -v
python3 -m unittest -v
Distinguish a missing resource from denied access
Suppose the analyst can inspect absent, but absent is not in the synthetic map. The result is MISSING_RESOURCE. The receiving instructions should identify the missing prerequisite and the owner who can supply or explain it. Granting additional permissions would not create the resource or establish that its absence is expected.
Now consider secret, for which the analyst has no declared capability. The result is DENIED before the model asks whether secret exists. That observation concerns the account boundary. The operator should resolve the appropriate access or escalation arrangement through its own process, without treating the rehearsal as authorization to broaden the account.
A production system may intentionally expose less detail than this model, or return a common response for several conditions. Adapt the receiving instructions to the actual interface and permitted observability. The important comparison is between what the runbook assumes and what the receiving role can obtain. The model's status vocabulary is an example, not an API contract for every platform.
Keep the owner of each prerequisite visible. A resource availability question may belong to a platform team. An access request may belong to a separate authorization owner. A business decision about retrying work may belong elsewhere again. Combining all three under a generic contact-support instruction makes it harder for the receiving analyst to request the right next action.
Use the evidence manifest as a handover object
For each rehearsed step, retain the step name, receiving account, expected capability and status. Add the environment description and resource reference at the rehearsal level. Keep the proposed next owner beside any blocked step. The runner returns the first four fields; the surrounding handover material supplies the operating context and ownership decision.
Do not describe the evidence as a complete authorization audit. The fixture does not record policy inheritance, session restrictions, network conditions or identity-provider configuration. It records the supplied local account and the path that the local model took. That narrow observation is enough to challenge a runbook assumption without pretending to inspect a real deployment.
The receiving reviewer should be able to distinguish an observed result from a proposed next step. For example, the local retry was denied is an observation from this execution. A recovery owner should decide whether retrying is appropriate is a proposed responsibility. The manifest should not turn the second statement into evidence that the action has been approved.
Use synthetic resource references in shared examples. A real handover may need controlled links to logs or diagnostic reports, but those links should remain within the organization's existing access arrangements. The published fixture contains no production records. Reproducing the code does not require a cloud subscription, privileged token or access to a customer's support environment.
Correct the procedure before widening the account
A blocked step can reveal that the runbook assigned the wrong task to the receiving role. If the analyst's job is diagnosis and escalation, the appropriate correction may be to end the permitted path with an evidence packet for the recovery owner. Adding write access would change the role rather than repair the instructions.
Alternatively, the operator may decide that a receiving role genuinely requires an additional capability. That is a separate authorization decision. The rehearsal can identify the required capability and the affected step, but it cannot grant the permission or determine who should receive it. Keep that boundary explicit when translating the example into operational work.
A third possibility is that the runbook targets the wrong resource. The analyst may have the correct intended permissions while the instructions point to an obsolete diagnostic location. In that case, revising the resource reference and repeating the authorized review addresses the actual problem. An administrator's successful lookup at another location would not establish that the original instructions were usable.
Record the correction and repeat the relevant path with the intended restrictions intact. Keep the earlier blocked result so another reviewer can understand why the procedure changed. A clean final screenshot is less useful than a small history connecting the original assumption, the observed boundary and the accepted revision.
Review the model's limits before applying the idea
The supplied Account object is trusted fixture input. Anyone editing the Python file can change its capabilities. The example does not authenticate a person or protect a resource against an attacker controlling the process. The capability check is a local decision model used to rehearse a declared procedure.
The effects list is equally limited. It records an intended retry marker in memory. It does not simulate a distributed transaction, a remote timeout or the possibility of a side effect occurring before a response is lost. Those concerns require separate integration tests against the actual system behavior and its permitted test environment.
There is no concurrent policy change in the fixture. A real account's effective access can change during a session, and a resource can disappear between checks and use. The example cannot prove that a production authorization check is atomic with an action. Treat the runner's deterministic ordering as an explanation of the exercise, not a substitute for the receiving platform's security design.
The model also does not verify that the runbook describes the right business recovery. A permitted write can still be an incorrect operational decision. The receiving team needs the relevant acceptance rule, evidence and approval owner for that decision. Permission to perform an action and authority to choose that action are related but separate parts of the handover.
Make a restricted rehearsal part of acceptance
Choose one documented receiving task and name the actual intended role. List the expected resources and prerequisites before the rehearsal. Establish which observations can be collected in an authorized test environment and which questions need another owner. Keep the exercise small enough that the receiving reviewer can inspect every required step.
Then compare the documented route with the observed route. A permitted diagnostic path should produce the evidence the instructions promise. A blocked action should retain the missing prerequisite and stop before the modeled effect. An absent resource should remain distinguishable from an authorization conclusion only where the interface and the reviewer's permissions support that distinction.
Ask the receiving reviewer to explain the next step using the retained evidence. Can the reviewer identify the blocked operation and the owner who should resolve it? Can another analyst resume without borrowing the author's account? Those are proposed handover questions to examine in the real environment; the local fixture has not answered them for a customer deployment.
Retain the account boundary in later revisions
A runbook is likely to change after the first handover. New diagnostic sources, renamed resources and revised recovery procedures can introduce a prerequisite that the receiving role does not have. Keep the account declaration and the affected step evidence with the reviewed version so those changes remain visible.
When a new step is proposed, ask what action it performs before accepting its capability label. The false-declaration test illustrates this point: a read label cannot justify a retry operation. In a real implementation, the authoritative permission mapping belongs to the actual platform and its authorization owner. The worksheet should refer to that mapping rather than invent a replacement policy.
Review the required output as well as the permission. An account may be able to open a report while the report omits the field needed for the documented decision. This model treats resource contents as available data and does not evaluate their adequacy. A later authorized rehearsal should inspect whether the receiving role can obtain the evidence the procedure requires.
Keep that content question separate from the fixture's passing result. The nine tests establish local branching and absence of the modeled effect under the tested restrictions. They do not establish that a diagnostic report is complete, that a receiving person understands it or that an escalation owner is available. Recording those limits makes the small test reusable without inflating its meaning.
Read one completed rehearsal record
Consider the fixed runner's two-step sequence: inspect the synthetic report, then request a retry of the synthetic job. The first evidence entry identifies receiving-readonly, read:report and COMPLETED. The second identifies the same account, write:job and DENIED. The effects list remains empty. These values can be reproduced with the code and declared resource map below.
The first entry supports a narrow conclusion: the local account satisfied the modeled prerequisite for inspection and the supplied report resource existed. It does not say that a real report would contain enough information to diagnose a held job. Preserve the original task question beside the result so the receiving reviewer can evaluate that separate requirement later.
The second entry gives the handover a specific missing prerequisite. It does not tell the analyst to acquire write:job. The next owner may choose an authorized recovery, request more evidence or revise the runbook so the receiving role stops after diagnosis. Record that decision outside the runner's observation rather than encoding a proposed resolution as though it had already happened.
If the analyst submits only a screenshot of the first successful inspection, the receiving record loses the blocked step. If the analyst submits only the final denial, it loses the permitted work already completed. The ordered evidence list carries both. That is why the runner records a status for the blocked step before it stops.
Make the next owner's request specific
A useful escalation can identify the runbook version, receiving role, blocked step and required capability, then ask for a defined decision. For the synthetic case, the request is whether the documented task should end with diagnosis or include an authorized retry by another role. The evidence supports asking that question; it does not settle the answer.
Attach the relevant resource reference and its access conditions through the organization's established channel. A receiving owner should know whether a link points to an actual retained observation, a changing dashboard or an example. This fixture supplies only synthetic data, so its public output can be reproduced without exposing an operational record.
Ask the next owner to preserve the disposition with the reviewed runbook. If the task remains diagnostic, revise the instructions to name the receiving evidence and escalation destination. If an additional action is accepted, state who performs it and which review or approval applies. Neither route requires the article's fixture to become a production authorization service.
Finally, define what would trigger another rehearsal. A changed operation, a different resource or a new receiving role can invalidate an earlier observation. Repeat the affected review rather than copying the previous passing result onto the revised procedure. Keeping that scope attached to the evidence makes a modest local exercise useful during later handovers.
Leave a reproducible receiving record
The practical deliverable is the reviewed runbook, the intended account boundary and the ordered evidence for the rehearsed steps. Retain the failed control alongside the passing correction when sharing this example. A reader can then reproduce why skipping the capability guard changes the outcome instead of relying on an unsupported assertion that access was checked.
For a real handover, keep the environment, applicable runbook version and unresolved prerequisites with that record. Repeat the relevant review when one of those assumptions changes. The procedure becomes reviewable when the receiving team can show what it could inspect, where it had to stop and who owns the next authorized decision.
More insights to read
Integration Acceptance Tests for Retries and Duplicate Requests
Architecture Decision Records: A Receipt-Worker Review
How to Specify a Blockchain Ledger Integration Contract
Queue Migration Acceptance: Residual Work and Final Ownership
Batch Recovery Trace: Checkpoints, Row States and Resume Decisions
About the author
Dmytro Nasyrov. Photo supplied by the author.
Written by Dmytro Nasyrov PhD, software architect with 24 years of production experience. Dmytro is the founder and CTO of Pharos Production. He works on production software architecture for FinTech, AI, Web3 and blockchain systems.


Top comments (0)