Image caption If you request a tenner, that's all you usually get

Dozens of cash machines in Sydney, Australia, were accidentally overpaying customers this week. So if you take money under these circumstances, what is the correct course of action, legally and morally?

Free cash. It sounds too good to be true. And for some customers of the Commonwealth Bank in Sydney this week, it was.

When word got around the streets that some cash machines were giving out more money than customers were entitled to, queues began to form and people took advantage.

There was talk, according to one witness, that they were giving out "free money".

The bank later explained that an error had prevented the machines from properly identifying customer accounts, but that all transactions were correctly recorded and the bank would be pursuing the money.

But is it an offence to keep cash accidentally dispensed from a cash machine?

In England and Wales, it's pretty clear - it's not your money, says Mark Haslam, a criminal defence lawyer at BCL Burton Copeland in London.

"The only issue is what's going to be debited from your account, so if you ask for £10, they give you £100 and they debit £100, then it's yours.

"But if it's clearly a malfunction and it's dishing out money [without deducting it], and people come from miles around because word gets around quickly, then you're helping yourself knowingly and that's theft."

'Report it'

If you happen to be passing and someone tells you it's handing out £200 every time, then it's clearly theft because there's knowledge and intent, and the intent could be proved.

"So the best course of action in terms of the law is to report it straightaway to the bank," says Haslam. "It's the only way you can preserve your position, but if you sit on it and wait for them to find you, then it's a lot weaker."

'Take it, it's your free lunch' What do banks do with the money they make out of their 'account charges' and 'service charges'? Well, for one thing, these charges pay for systems that protect the banks from risks like cash-machine malfunction. If those systems let the banks down, I say 'tough on the banks - it's a windfall for the customers'. Just as when the bankers pay themselves huge bonuses out of the charges they exact on our accounts, the banks say 'tough on the customers - it's a windfall for us.' The bankers get plenty of free lunches. Why shouldn't their customers too?

The law concerned is more likely to be theft rather than fraud, he says, because you've taken money to which you are not entitled.

The 1968 Theft Act says: "A person is guilty of theft if he dishonestly appropriates property belonging to another with the intention of permanently depriving the other of it."

In Scotland, the same principle applies under common law theft, says a spokeswoman for the Law Society of Scotland.

But UK banks don't always take a hard line.

Dozens of people who took advantage of a cash machine in Dundee paying out double the requested amount in January were told by the machine's operator that they would not have to return the extra money, although it was up to individuals' consciences.

Our advice is simple, says Brian Mairs, a spokesman for the British Bankers' Association. "If an ATM dispenses money to you in error, you should take it into the branch as soon as possible. Taking money that is not yours is a punishable crime.

Any moral indignation should be proportionate Julian Baggini, Philosopher

"Banks have invested heavily in recent years in ensuring the security of customers' money and the integrity of ATMs. There have been instances where an ATM has malfunctioned and the bank has written off the loss, but it would be wrong to assume that they will do so every time."

Morally speaking you are doing something wrong, stealing, if you take it, says Simon Rippon of the Oxford Uehiro Centre for Practical Ethics. But the interesting question is whether this kind of stealing is more excusable than stealing from an individual.

Someone who takes cash from a malfunctioning cash machine is judged more leniently than someone else who takes cash that is accidentally left behind by the person in front of them, and who fails to inform that person of their loss, he says.

"The 18th Century Scottish philosopher Adam Smith, who is best known for his 'invisible hand' economic theory, provided a moral theory in his book The Theory of Moral Sentiments that can very naturally explain the distinction between these cases. On Smith's theory, moral judgements arise out of our sympathy with the feelings of others."

Do you back Ada or Bob? Suppose that Ada takes the money from a malfunctioning cash machine, thinking that the bank will barely miss it, but so much money means a lot to her personally. Now suppose that Bob is at another cash machine that isn't malfunctioning, but rather has just been used by the absent-minded old Professor Plump, who has accidentally left his cash behind. Bob thinks of calling Plump back in order to return his money, but decides instead to swipe it for himself, thinking that Plump is both well-off and amnesiac, and probably won't even miss it. Don't we judge Bob to have done something worse than Ada? This is surely not because we think the consequences of Bob's actions are likely to be any worse, but rather because he has harmed, or may have harmed, a specific, identifiable individual.

It's difficult to identify an individual to sympathise with in the case of the misfiring cash machine, says Rippon, so it is only natural for us to judge the person in that case much less harshly than we judge the person in the second example.

This feeling that a bank cannot be a victim of crime is sometimes felt very strongly. In 2003, a family in Coventry made repeated visits to an obliging cash machine and the four of them took out £134,410, which they spent on a new car and air tickets to Jamaica. Three of them were imprisoned.

It's a crime to take the money, but there are two reasons why many people instinctively find this kind of theft less serious or even harmless, says Julian Baggini, editor of The Philosophers' Magazine.

One is that the transaction is completely impersonal and does not require surreptitious behaviour. The other is that people view crime against large corporations as victimless, even though prices and insurance premiums are affected by theft and fraud.

"Leading a moral life requires us to be the kind of person who does the right thing without always stopping to work out if we gain or lose by doing so," says Baggini.

"We do what is right and hope that others will do the same because we want to be that kind of person, not some kind of egotist who is forever trying to work out what acts will serve our own petty self-interest."

People who keep money from rogue cashpoints are not modern day Robin Hoods, he says. Theirs is not a principle act but an opportunistic one.

"But any moral indignation should be proportionate. I think given that many people struggle with money, resisting temptation, even if it is the right thing to do, is hard enough for us to understand those who don't."