There are several kinds of hardware for sale for just this.
Which are available where you live depends on the local market, so likely the ones I find on internet round here might be available where you live.
The most common types are meant to allow you to open the door a bit, have a look on who is there and then close the door, open the safety device and open the door fully. Most do not allow the door to open once the security closure is active, not even when you use a smart method.
The chain I had on my door in my last house not only needed the door to be 95% closed, it also needed you to press a small thingy while taking the chain out, so it was impossible to open the door unless you were actually inside.
This is one of them.
If you use any of those methods that prevents the door to be opened without the person inside changing something, you will have to keep the door open while the device is active. Those do not keep the door open.
In fact the device in the picture I linked to above was in a story about it getting locked on closure of the door by accident, (Dutch language story)
There is also hardware that is designed to hold doors or windows on a tiny gap for a long time, mostly used on doors that are not the main entrance to a house or room, but they might work for you.
Those should also be available for doors open in as well as out, as both methods of opening garden doors and windows can be common.
A clamp like this (from a commercial site) is combined with a metal plate with two or three slots. The slots are such that one closes the door, the other one or two allow the door to be kept open a little bit.
Where these items used to be common here, the local stores do not sell them anymore, likely because most doors and windows have been replaced by plastic ones.