Agrawal is since 2001 professor of computer science at the Indian Institute of Technology Kanpur, where he received his doctorate also studied computer science ( bachelor's degree, 1986) and 1991. In 1996, he was there already an Assistant Professor and Associate Professor in 1999. He has been a visiting professor in Singapore, at the University of Ulm (as Humboldt Fellow 1995/96 ) and 2003/ 04 at the Institute for Advanced Study.
In 2002 he was awarded the Clay Research Award for the development of an algorithm for primality test, ( AKS primality test, published in August 2002 together with his former students Neeraj Kayal and Nitin Saxena ), whose time complexity grows polynomially with the length of the binary representation of the examined number. With the proof of the possibility of distinguishing prime numbers in polynomial time by pseudoprimes, they confirmed a conjecture of Agrawal and Biswas Somenath from the year 1999.
In 2006 he received the Fulkerson Prize and the Gödel Prize. In 2006 he was invited speaker at the International Congress of Mathematicians in Madrid ( determinant versus permanent ).