boolean isCausedBySecurity(Throwable e) {
        if (e == null) {
            return false;
        }
        return (e instanceof GeneralSecurityException) || isCausedBySecurity(e.getCause());
    }
@Test
    void shouldReturnTrueIfCausedBySecurity() {
        Exception exception = new Exception(new RuntimeException(new GeneralSecurityException()));
        assertThat(agentController.isCausedBySecurity(exception)).isTrue();
    }