Now scientists at Queen Mary, University of London have shown that immune cells begin to act strangely even before symptoms occur.
They say the test will identify at-risk patients with more than 90 per cent accuracy.
Dr William Alazawi, who led the study and is also an honorary consultant at Barts Health NHS Trust in London, said that the discovery could be "a real game-changer".
Dr Alazawi said: "We already know that monocytes are important triggers for our immune defences but the particular aspects of the cells we looked at, and their use as accurate predictors of who will develop a serious illness after surgery, is a totally new concept."
Sepsis occurs when the immune system over-reacts to a fungal, viral or bacterial infection, attacking the heart and other organs. It can cause fever, inflammation, low blood pressure, blood clotting problems and multiple organ failure.
The most common causes are pneumonia, bowel perforation, urinary infection and severe skin infections.
However, an estimated 10 per cent of all cases result from post-operative infections; bowel surgery carries the highest risk because of the large number of bacteria in the area. It usually takes 48 to 72 hours for sepsis to develop but it can start only several days after surgery.
Around 37,000 people in Britain die from sepsis every year - more than from bowel and breast cancer combined.
To uncover a marker indicating infection, blood was taken from 39 Barts patients undergoing major liver and pancreatic surgery.
They were tested before the operation when their immune systems were normal and then one and two days afterwards to detect any changes.
Infections can occur if fragments of bacteria found in the skin or gut are released during surgery.
In the 12 patients who developed serious complications, monocytes began producing high levels of immune proteins, unlike the 27 patients who recovered without problems.
The condition can be treated with antibiotics and fluids. Dr Alazawi added: "If we can more accurately predict who will run into trouble after an operation, we can tailor personalised treatments to prevent complications and improve survival rates."
The team plans to develop a commercial test and study patients undergoing a wider range of operations
The research was published in the journal Annals of Surgery.