A Cox risk process with a piecewise constant intensity is considered where the sequence (Li) of successive levels of the intensity forms a Markov chain. The duration σi of the level Li is assumed to be only dependent via Li. In the small-claim case a Lundberg inequality is obtained via a martingale approach. It is shown furthermore by a Lundberg bound from below that the resulting adjustment coefficient gives the best possible exponential bound for the ruin probability. In the case where the stationary distribution of Li contains a discrete component, a Cramér–Lundberg approximation can be obtained. By way of example we consider the independent jump intensity model (Björk and Grandell 1988) and the risk model in a Markovian environment (Asmussen 1989).