Clarify legal basis and competence first.
Depending on the phase, criminal procedure, the Prison Act, civil law and company law interact. In pre-trial detention, defence, contact and alternative measures are central; in imprisonment, prison rules and long-term organisation become more important.