The software might be considered "collective work" instead of "derived work"
TL;DR: I'm not sure, but this is a distinction that might be worth looking into.
https://academia.stackexchange.com/questions/48375/using-images-with-cc-by-sa-license-in-slides-or-a-thesis/48382#48382 is for the image in book/thesis, which I believe is analogous ...
You fear that the competence will take your software as it is, and make a competing product.
But in practice this is not viable if it is under the Affero License, as by just creating a service connected to the Internet they would need to publish their software. Hence you could borrow it too.
In reality libre technology forks gets traction only if who creates ...
The developers behind the Timescale database are attempting to do something in this direction with their license, see e.g. the post on their blog.
I am unable to judge, whether this has any chance of surviving in a legal court, but I think it is an interesting attempt anyway ...
According to this page , these are the most restrictive:
European Union Public License 1.1
European Union Public License 1.2
GNU Affero General Public License v3.0
Open Software License 3.0
Personally, I use Open Software License 3.0 with my projects.
There is no free software / open source license that will satisfy your requirements. These licenses generally focus on the freedoms of end users, they are not trying to restrict anyone. The freedom to use software for any purpose (including to compete with your offerings) is considered essential.
Using a freedom-preserving license with the purpose of ...
The GNU Affero General Public License v3.0 is a step in the right direction, but unfortunately doesn't hit the mark completely. Although it does mandate that users who interact with the licensed material via network are given the right to receive a copy of the source code, it doesn't mandate publishing the data.