SAMPLE ENGINEERING SPECIFICATION / ILLUSTRATIVE

Contractor access, specified.

A worked example of how a business request becomes a bounded automation: explicit authority, approvals, expiry, failure handling and testable acceptance.

Fictional worked example. This is an illustrative engineering specification, not a client project, prior delivery record or tested production implementation.

01 / INTENT & BOUNDARIES

Approved access.
A defined end.

In this fictional scenario, contractor access is requested in an approved register and copied manually into identity and application systems. End dates can be missed, and nobody has a complete view of unfinished work.

The proposed workflow grants a limited, approved set of entitlements at the start of an engagement, removes workflow-owned access at expiry or withdrawal, and exposes exceptions to a named operator.

PROPOSED CONTROL FLOW · NOT A LIVE SYSTEM
  1. RegisterAuthoritative request
  2. ApproveBound to a revision
  3. GrantVerify each target
  4. ExpireConfirm removal

Reconciliation compares intended access with observed access throughout.

In scope
Individual contractor identities; an allowlisted set of applications and non-privileged roles; sponsored, time-bounded access; an operation and exception ledger.
Outside this design
Shared or privileged accounts, payroll, device shipping, unrestricted application administration, autonomous AI decisions and deletion of business data. Existing access owned by other processes is not automatically removed.
Before implementation
Validate the actual provider APIs, identity matching, entitlement ownership and session-revocation limits. Agree expiry-sweep cadence, maximum reconciliation delay, retry budget, alert thresholds and who responds. These are deployment gates, not unspecified guarantees.

02 / SOURCE & AUTHORITY

One request. A traceable decision.

The approved contractor register is authoritative for sponsor, engagement status, requested roles and access dates. Identity and application providers are authoritative for the state actually applied. Email addresses are attributes, never the sole identity key.

Required source fields
Immutable contractor ID and request ID; source revision; sponsor ID; application and role IDs; start and end timestamps in UTC; engagement status; and an approval reference. Store only the personal attributes required by the connected provider.
Events & scheduling
Create, revise, withdraw and expire events enqueue a reconciliation request. A periodic sweep also examines current records and due expirations so a missed webhook is not the only path to removal.
Validation gate
Reject missing or conflicting identity links, unknown roles, invalid date ranges, inactive sponsors and duplicate active requests with conflicting ownership. A match requiring judgement becomes an exception; the automation must not guess.
Policy authority
The client’s designated application owner defines the role allowlist. An authorised approver approves the exact request revision. The automation enforces these decisions; it cannot expand its own permissions.

03 / APPROVAL & EXPIRY

Approval has a scope.
So does access.

  • The requester cannot approve their own access. The approver must be authorised for the target application and role; privileged roles are excluded.
  • Approval binds contractor, targets, roles, dates and source revision in an immutable snapshot. A changed role, later end time or new target requires fresh approval before granting or extending access.
  • Withdrawal or an earlier end time can reduce access without waiting for a new grant approval. Expired approval cannot reactivate an ended engagement.
  • Immediately before a grant, recheck current authority, approval and time bounds. Serialise operations per contractor and target; a withdrawal supersedes queued grants. An in-flight grant is read back and removed if it completes after withdrawal.
  • At expiry, remove only workflow-owned entitlements and invoke supported session-revocation controls. Keep the request in revocation until removal is verified for every target. Any remaining access is an unresolved exception, not a completed request.

REQUEST STATES

Pending approval → Scheduled → Provisioning → Active → Revoking → Closed

Blocked or failed operations remain visible alongside the request. “Closed” requires verified completion; an exception is not success.

04 / EXECUTION & RECONCILIATION

A retry must not become a second grant.

Durable intent
Persist the approved desired state and outgoing work in one transactional boundary. Workers claim a per-target operation from the durable queue. Delivery may be repeated; this design does not assume exactly-once messages.
Idempotency
Use a unique operation key from request ID, revision, target and action. Persist attempts, provider references and verified outcomes. Repeated events find the existing operation instead of issuing an unrelated write.
Uncertain provider outcomes
After a timeout, query the provider by its stable identity and assignment reference before retrying. Use native idempotency keys where available. If neither reliable lookup nor safe repeat writes is possible, stop that adapter for operator review.
Reconciliation
Compare current approved intent, the operation ledger and observed provider state. Stale events cannot overwrite newer revisions. Restore missing approved access only while authority, approval and dates remain valid; remove excess workflow-owned access. Flag other access for its owner.
Audit record
Record source revision, decision and approver reference, operation key, before/after entitlement state, provider result and timestamps. Keep credentials out of logs; restrict access and agree retention and deletion policies before deployment.

05 / FAILURES & ESCALATION

Every exception needs an owner.

Unavailable authority
Block new or expanded grants when the source or approval cannot be verified. Continue known expiry and withdrawal actions from durable records. Alert the designated operational owner; source recovery triggers reconciliation before grants resume.
Rate limit or temporary fault
Respect provider retry guidance and use bounded backoff within the agreed retry budget. Exhaustion creates a visible exception, never an endless silent retry. Access removal failures follow the agreed higher-priority escalation path.
Partial provisioning
Track each target separately. The sponsor sees the request as incomplete. Before deployment, the application owner chooses whether a partial grant can remain or requires removal of the grants made by this request. The automation does not invent that decision during a failure.
Who responds
The designated client operator owns the exception queue and manual intervention. The application owner approves entitlement decisions; the security owner handles unresolved exposure. Agree their contact routes, response expectations and escalation cover before enabling the workflow.
Alert contents
Include request and operation references, the affected target, remaining access, safe next action and runbook link. An acknowledged alert is not a resolved exception: closure needs a verified provider result or a documented, still-visible limitation.

06 / ACCEPTANCE CRITERIA

Specify the evidence before the build.

Proposed acceptance tests — not executed. These criteria illustrate how this design would be evaluated; they are not test results.

Contractor access automation: proposed acceptance matrix
CaseGiven / whenRequired behaviourEvidence to collect
A01Approved request reaches its start timeOnly approved, allowlisted entitlements are granted. Observed provider state matches the approved revision.Approval snapshot, operation ledger and provider read-back.
A02Requester tries to approve their own requestApproval is rejected. No grant operation enters the execution queue.Authorisation decision and empty grant queue for the request.
A03Role, end time or target changes after approvalThe old grant approval becomes invalid. A new approval is required; an earlier end time still triggers revocation.Revision comparison, invalidation event and expiry job.
A04Duplicate or out-of-order events arriveA completed operation is not repeated. Older revisions cannot replace current desired state.Unique operation keys and rejected stale-event records.
A05Provider writes successfully, then the connection times outRead-back resolves the uncertain outcome before another write. No duplicate account or assignment is created.Ambiguous-operation state, lookup result and reconciliation decision.
A06One application fails after other grants succeedThe request stays incomplete, and the partial state is visible. The approved partial-failure policy determines whether owned grants are removed.Per-target ledger, owner notification and any authorised compensation record.
A07An expiry event is lostThe independent expiry sweep identifies the ended request and initiates removal of owned entitlements.Sweep result, due-time comparison and revocation read-back.
A08The authoritative register cannot be readNew or expanded grants stop. Known expirations and previously recorded withdrawals remain actionable; the outage is escalated.Authority health event, blocked grant and retained expiry record.
A09A contractor is withdrawn while grants are queuedQueued grants are cancelled. A grant already in flight is reconciled and removed if it completes.Withdrawal revision, cancellation and final provider state.
A10A provider cannot revoke access or sessionsThe record cannot close as fully revoked. An actionable exception identifies the remaining access and responsible operator.Provider error, open exception and manual verification requirement.
A11Observed access drifts from approved stateOwned entitlements are compared with current authority; excess owned access is removed. Unowned access is flagged for its owner, not silently modified.Reconciliation diff, scoped removal and ownership exception.
A12Audit records and the handover are inspectedNo secrets or unnecessary personal data appear in logs. A client operator can find each decision, outstanding exception and recovery instruction.Redaction checks and an operator walkthrough against the runbook.

Run these cases with synthetic identities and controlled failure injection in a suitable test environment. Before rollout, the client’s authorised acceptance owner reviews recorded results, provider limitations and unresolved risks against the agreed criteria.

07 / RECOVERY LIMITS

Stopping safely is a designed path.

  1. Pause grants. A documented control stops new provisioning without disabling known-expiry processing, the exception queue or audit capture.
  2. Establish the actual state. Reconcile provider read-back with the ledger. Preserve operation evidence; do not replay ambiguous writes blindly.
  3. Use an authorised recovery action. Remove only the entitlements created and owned by this workflow. Never automatically restore access revoked by expiry or withdrawal. Manual actions use client-controlled credentials and are recorded for reconciliation.
  4. Validate before resuming. Correct the cause, review pending intent against current authority and confirm provider state. The designated change owner authorises resumption.

Removal cannot guarantee that existing sessions immediately terminate where a provider lacks the control. It cannot undo exported data, messages sent or other external side effects. This design does not delete business data or promise universal rollback. An unavailable revocation API creates an unresolved access exposure for the client’s security owner.

08 / HANDOVER & OWNERSHIP

The client can operate what is built.

  • Client-owned assets: source and configuration repository, deployment instructions, dependency inventory, service accounts and secrets held in an approved store.
  • Operational runbook: queue inspection, alert routing, reconciliation, expiry verification, pause/resume, manual removal and provider-outage procedures.
  • Decision record: approved scope, field mapping, entitlement ownership, approver policy, cadence and retry settings, partial-failure policy and recovery limits.
  • Acceptance pack: actual test evidence collected during implementation, owner sign-off, unresolved risks and any conditions preventing rollout. This fictional sample contains no such results or sign-off.
  • Ownership transfer: a client operator walks through an exception and recovery scenario; responsibilities and access revocation are confirmed. Any retained engineering capacity is separately agreed.

A real specification would name the actual systems, decision makers and agreed operating thresholds. This specimen defines the design and the decisions needed before implementation without inventing a customer environment.

FROM SAMPLE TO YOUR SYSTEM

Which process needs this level of clarity?

I can review the process and specify the next change, or scope a defined build when the direction is already clear.