What kind of documents are patent offices allowed to ask? May a patent office ask for the source code, implementation details or other sensitive documents about how the technology can be reproduced or is this beyond what they are allowed to ask by the law or international standards?
This answer is for the U.S.
In the course of examination the examiner doesn't ask for anything. They just issue rejections if the claims in front of them in combination with the specification, do not satisfy the requirements, by law, to be allowed.
What you send them in response to a rejection is your choice. Working models are not required unless you are trying to patent a perpetual motion machine. Anything you do provide would normally be accompanied by an affidavit attesting under penalty of perjury what the document represents.
No new matter can be added to an application after the date accorded to the initial application filing but material could be presented to demonstrate that some term in the application had a particular meaning to those skilled in the art.
In the past there was a proceeding called an interference where a later filing applicant could try to show their application should get priority over an earlier filed application, This is not part of an examination but something before the board. People filed receipts for parts they bought in the process of inventing and signed notebooks showing continued effort. Under first-to-file that is not a thing. Now we have derivation proceedings where a later applicant can try to show that an earlier applicant took the idea from them.
Some biological applications require depositing a sample.
One thing that is relevant to the question is that all people involved in an application have a duty of disclosure, candor and good faith to the patent office during the prosecution. If accused of murder you can tell your lawyer you did it and it is kept confidential, but if you tell your patent attorney you didn't really invent it, the practitioner must tell the Office if you won't actively kill your application.
Of course, if you get into a law suit to enforce a patent the other side gets discovery and can see pretty much anything relevant.