An extended derivation (endomorphism) of a (restricted) Lie algebra L L is an assignment of a derivation (respectively) of L ′ L’ for any (restricted) Lie morphism f : L → L ′ f:L\to L’ , functorial in f f in the obvious sense. We show that (a) the only extended endomorphisms of a restricted Lie algebra are the two obvious ones, assigning either the identity or the zero map of L ′ L’ to every f f ; and (b) if L L is a Lie algebra in characteristic zero or a restricted Lie algebra in positive characteristic, then L L is in canonical bijection with its space of extended derivations (so the latter are all, in a sense, inner). These results answer a number of questions of G. Bergman. In a similar vein, we show that the individual components of an extended endomorphism of a compact connected group are either all trivial or all inner automorphisms.