We present a technique that accurately approximates tangent linear and adjoint models for data assimilation applications using only evaluations of the nonlinear model. The approximation offers a simple way to create tangent linear and adjoint model code that is easily maintainable, as only major changes to the nonlinear model formulation necessitate modifications of the tangent linear or adjoint model code. The approach is particularly well‐suited to marine biogeochemical models and takes advantage of typical features of these types of models to be computationally viable. We illustrate the approximation in a realistic application, using a 3‐dimensional coupled physical‐biogeochemical 4D‐Var data assimilation system, set in the California Current system, in which the approximation is only applied to the 11 state variable biogeochemical model. In this application, the approximation‐based model solution tracks the reference solution accurately over 30 4‐day assimilation cycles but leads to a 3%-15% increase in the computational cost compared to the hand‐coded reference.