Use individual stratified randomization within each prison, with concealed centrally generated permuted-block randomization and varying block sizes. Prison can affect both baseline risk and intervention delivery, so balancing assignments within prison protects against imbalance in that important covariate. Varying block sizes and allocation concealment prevent staff from predicting the next allocation and selecting participants accordingly. Prespecify how incomplete final blocks are treated. To enforce the overall 4000:4000 allocation exactly, coordinate the stratum totals centrally, allocating odd final places through a concealed random rule; exact half allocation within every prison is impossible if some prison totals are odd.
Individual randomization stratified by prison is preferable to randomizing only twenty whole prisons for this design. A cluster-randomized trial would have few independent units and could lose substantial precision through intraclass correlation. Sharing or selling the intervention can cause treatment contamination, so record it and retain an intention-to-treat analysis; substantial spillover might justify a separately powered cluster design rather than being ignored.
Use individual stratified randomization within each joint combination of prison and the three prespecified addiction-management categories. Within every joint stratum, use permuted-block randomization with equal numbers of active and control assignments in each completed block. This directly balances allocations within prison and within management category, rather than hoping that simple independent allocation will achieve both.
Run the allocation sequentially, since the availability and frequency of management categories change during recruitment. Completed blocks balance contemporaneously, so the expanding category is not assigned predominantly to one trial arm. Use varying block sizes and centrally protected allocation concealment to prevent prediction of future assignments. Incomplete final blocks allow a small residual imbalance, and an odd stratum total cannot be split exactly equally. If many joint strata are very sparse, a prespecified randomized minimization in clinical trials scheme can instead target the prison and management margins, retaining a random component. The analysis should account for the important design strata.