We consider a risk model with a counting process whose intensity is a Markovian shot-noise process, to resolve one of the disadvantages of the Cramér–Lundberg model, namely the constant intensity of the Poisson process. Due to this structure, we can apply the theory of piecewise deterministic Markov processes on a multivariate process containing the intensity and the reserve process, which allows us to identify a family of martingales. Eventually, we use change of measure techniques to derive an upper bound for the ruin probability in this model. Exploiting a recurrent structure of the shot-noise process, even the asymptotic behaviour of the ruin probability can be determined.