Can I use an 12v 6Ah drill battery to power an 8amp pump?
The second question is easy, so I'll answer it first.  A battery with a capacity of 6 Ah store 6 &quot;amp hours&quot; of energy.  This means it could power 6 amps for 1 hour, 12 amps for 0.5 hours, 3 amps for 2 hours, etc.  If you want 8 amps continuously, it can power it for 6Ah/8A = 2/3 h = 40 minutes.  Thus, by physics, it will not be possible to use this batter to power the pump for a full hour.  You will run it dry.
Safety is a more complex issue.  You need to be certain that the batteries are able to source that current for a long period of time.  The information you need is not found in the info you listed.  You need to find a max current rating for it.  I did not find any official sources (so take this with a grain of salt), but I did find a reddit post which identified the actual lithium ion cells used in the M12 series, and their limits

Now let's dive in. Milwaukee uses Samsung INR18650-30Q cells in their M12 6Ah batteries. Watch ( https://www.youtube.com/watch?v=HLUx2-uYdZc ) if you are a nonbeliever. The datasheet specifies it's maximum recommended current draw is 15A per cell. Can the cell provide 20A, or even 30A? Absolutely, it will just get really hot which will permanently reduce it's lifespan and in extreme cases permanently lower the capacity. The battery has 6 cells, 2 banks of 3 series cells. Putting cells in parallel adds up their capacity and max output current. Putting batteries in series adds up their voltage. The cells are 4.2V 3Ah cells.

You are using about half of the maximum recommended current draw.  There's a high likelihood that this is &quot;safe.&quot;  I have to fall short of saying &quot;its safe&quot; because the reddit post did not link to a spec sheet that defined what &quot;maximum recommended current draw&quot; was -- whether it was continuous or assuming some nominal duty cycle.  Normal use of these products in workshop tools are obviously not 100% duty cycle.  However, coming up at half of the recommended current draw is a pretty reasonable safety margin to at least start with.  If you truly care about the safety of the device, get the real stats.