  A measurement of the associated production of a top-quark pair ($t\bar{t}$)
with a vector boson ($W$, $Z$) in proton-proton collisions at a center-of-mass
energy of 13 TeV is presented, using $36.1$ fb$^{-1}$ of integrated luminosity
collected by the ATLAS detector at the Large Hadron Collider. Events are
selected in channels with two same- or opposite-sign leptons (electrons or
muons), three leptons or four leptons, and each channel is further divided into
multiple regions to maximize the sensitivity of the measurement. The
$t\bar{t}Z$ and $t\bar{t}W$ production cross sections are simultaneously
measured using a combined fit to all regions. The best-fit values of the
production cross sections are $\sigma_{t\bar{t}Z} = 0.95 \pm
0.08_{\mathrm{stat.}} \pm 0.10_{\mathrm{syst.}}$ pb and $\sigma_{t\bar{t}W} =
0.87 \pm 0.13_{\mathrm{stat.}} \pm 0.14_{\mathrm{syst.}}$ pb in agreement with
the Standard Model predictions. The measurement of the $t\bar{t}Z$ cross
section is used to set constraints on effective field theory operators which
modify the $t\bar{t}Z$ vertex.
