sunat-cli
ESv0.15.0

Legal framework

Last updated: August 26, 2026

About this tool

sunat-cli is an open-source automation tool that interacts with SUNAT (Superintendencia Nacional de Aduanas y de Administracion Tributaria) web portals on behalf of authenticated users. It does not scrape, collect, or store third-party data.

User responsibility

This tool automates form submissions using YOUR credentials (Clave SOL). You are solely responsible for:

  • The accuracy of tax declarations submitted through this tool
  • Compliance with SUNAT deadlines and tax obligations
  • Safeguarding your Clave SOL credentials
  • Reviewing every operation via --dry-run and RHE issuance via --preview-only before submitting

Legal basis for automation

Peruvian law does not prohibit automated interaction with government web portals when performed by the authenticated account holder for their own tax obligations.

Ley 27269, Ley de Firmas y Certificados Digitales: Electronic submissions have the same legal validity as manual submissions.

Decreto Legislativo 1310, simplificacion administrativa: The State shall promote the use of technology to simplify administrative procedures.

Data protection

sunat-cli operates entirely on your local machine. No data is sent to third-party servers. API calls go exclusively to official SUNAT endpoints (*.sunat.gob.pe).

  • Secrets stored in the OS keychain, with non-secret account configuration under ~/.sunat/
  • Minimized audit logs stored locally with owner-only permissions
  • Selected short-lived API session tokens cached locally with owner-only permissions
  • No analytics or telemetry; tax operations transmit only to official SUNAT endpoints

Ley 29733, Ley de Proteccion de Datos Personales: All personal data processing occurs locally under the user's control.

SUNAT terms of service

SUNAT's Operaciones en Linea portal does not explicitly prohibit automated access by authenticated users. However:

  • This tool uses headed Chrome when SUNAT requires interactive authentication or confirmation, and direct HTTP for verified intermediate stages
  • Operations include realistic delays between form submissions
  • No rate-limiting circumvention is attempted
  • The tool respects session timeouts and re-authenticates properly

Disclaimer

sunat-cli is provided "as is" without warranty. The authors are not responsible for any tax penalties, incorrect declarations, or financial losses resulting from the use of this tool. Always verify declarations with a qualified tax professional (contador).

This tool is not affiliated with, endorsed by, or officially connected to SUNAT in any way. SUNAT is a trademark of the Peruvian government.

Open source license

sunat-cli is released under the MIT License. Source code: github.com/crafter-research/sunat-cli

Contact

For legal inquiries: legal@crafterstation.com
Crafter Station, Lima, Peru