I am using my companies SharePoint online server and we have a parent site /testplatform with several subsites within it /testplatform/test1, /testplatform/test2, etc.. When adding users as members (permissions) to a subsite (/testplatform/test1), the users added are also added as members on the parent site. Not sure why this is happening as none of the sites are inheriting permissions, and if they were, they would be inheriting from parent, not the other way around as is occurring in this scenario. How can I stop the parent site from getting new members added, when they are being added to a subsite.
I can think of a scenario which acts quite like your situation. As you mentioned the sub site stops inheriting permission from parent site, that is fine. Please have a check if you have added that user into a group like
<Site Name> members/owners/visitors. If that is your scenario, the permission settings works as expected. And you may better create new groups in sub site for holding users with only sub-site level permission.
A bit more explanation:
When you create the sub-site , the permission settings always starts from the original settings in Parent site. That is saying, in modern sites, the groups like
<Site Name> members/owners/visitors will act as the main groups in your sub site.
Per my test, if I only stop inheriting permission in the sub site, still the groups I just mention will remain. When you try to add the member to the sub site, the default edit permission group is still
<Site Name> members. And after you adding the user in that group, it will also affects the parent site permission. It is reasonable and it do works that way. Then in the parent site, I noticed that user actually gets in the group and has edit permission now.
If your subsite is inheriting from the parent, it's possible the group you are adding users to in the subsite is also the group being used at the parent level.
For example, if I have GROUP 1 at the parent level and my subsite is inheriting permissions, I may also see GROUP 1 in the subsite permissions.
Check out the section for "Permission levels and SharePoint groups" in this MS documentation: https://docs.microsoft.com/en-us/sharepoint/understanding-permission-levels?redirectSourcePath=%252fen-us%252farticle%252fUnderstanding-permission-levels-in-SharePoint-87ecbb0e-6550-491a-8826-c075e4859848