The intention of the GPL is to ensure the maximal possible freedom for the (end-)users of GPLed code. Therefore:
- you may freely use GPLed software, even in closed source applications. The GPL does not require that you open-source your code.
- when you re-distribute/convey GPLed software, you must use the GPL license so that your users enjoy the same freedom – you may not sublicense it to set different terms.
- when you distribute software that depends on GPLed code, you must license your software under the GPL.
So the GPL is only “viral” when you distribute your software. When your GPL-depending software is not distributed, there is no need to issue licenses.
When the software only runs on your servers, you are not conveying the software to your end users, you are merely providing access to that software. This is a valid loophole in the GPL, and the AGPL closes it (by tying the licensing requirements to usage rather than distribution).
So to summarize: you are free to use GPL software in a SaaS context without having to make your code GPLed – as long as you merely provide access to your GPL-dependent software and do not distribute it (e.g. sell your software to clients so they can install it on their own servers, or make your software available in some public package manager). The GPL distribution rules only kick in when you give a copy of the software to another legal entity, e.g. a different company.