During his time in Spain, he joined an American lodge that worked for the independence of America.
He came back to Peru after he was appointed as accountant and conservative judge in the area of luck and lotteries in the Tribunal Mayor de Cuentas de Lima (1810), returned to Peru, via Buenos Aires, decided to support the independence movement.
During his trip, he avoided harassment from the authorities: he was briefly arrested in Montevideo but; in Buenos Aires, he had to flee furtively after realizing that they were going to return him to Spain.
Something similar happened in the city of Mendoza.

Already established in Lima, he was associated with various groups of patriots and maintained active correspondence with those of Chile and Buenos Aires, which had already been installed Governing Boards.
He ran Lima's Lodge from home, located at Santa Teresa (now fifth block of Jirón Puno) or the house of the Count of Vega del Ren, in the street of Botica San Pedro (now fourth block of Jirón Miró Quesada).
He was involved in almost all Lima conspiracies, which were closely monitored by the authorities and eventually persecuted.
However,  the intervention of powerful friends and relatives saved him.

In 1816 he wrote a Manifestación histórica y política de la revolución de América, published anonymously in Buenos Aires in 1818 in which he exposed 20 causes justifying the insurgency against the colonial regime.
During his time in Spain, he joined an American lodge that worked for the independence of America. He came back to Peru after he was appointed as accountant and conservative judge in the area of luck and lotteries in the Tribunal Mayor de Cuentas de Lima (1810), returned to Peru, via Buenos Aires, decided to support the independence movement. During his trip, he avoided harassment from the authorities: he was briefly arrested in Montevideo but; in Buenos Aires, he had to flee furtively after realizing that they were going to return him to Spain. Something similar happened in the city of Mendoza.
Already established in Lima, he was associated with various groups of patriots and maintained active correspondence with those of Chile and Buenos Aires, which had already been installed Governing Boards. He ran Lima's Lodge from home, located at Santa Teresa (now fifth block of Jirón Puno) or the house of the Count of Vega del Ren, in the street of Botica San Pedro (now fourth block of Jirón Miró Quesada). He was involved in almost all Lima conspiracies, which were closely monitored by the authorities and eventually persecuted. However,  the intervention of powerful friends and relatives saved him.
In 1816 he wrote a Manifestación histórica y política de la revolución de América, published anonymously in Buenos Aires in 1818 in which he exposed 20 causes justifying the insurgency against the colonial regime.
José de la Riva Agüero