TL;DR: Code-quality issue output can be emitted as TOON instead of JSON to reduce the token cost of feeding data into AI agents, while preserving the same information and enabling measurement of the savings on real payloads, according to Sonar. The broader point is that agent efficiency depends as much on data shape as on data volume, and structured outputs now belong in governance conversations.
Editorial analysis by NHI Mgmt Group, based on content published by Sonar: “Tokenomics of quality: switch sonar list issues to --format toon for measured token savings”.
Key questions
Q: How should teams reduce token costs when AI coding agents read tool output?
A: Start by changing the most repetitive feeds first, such as issue lists and dependency-risk results, because schema repetition often costs more tokens than the useful content itself.
Q: When does compact structured output work better than JSON for agent workflows?
A: It works best when the data is uniform, record-based, and consumed by a machine rather than a person.
Q: What do security and platform teams get wrong about AI context cost?
A: They often focus on model choice and ignore the cost of the data shape that enters the model.
Practitioner guidance
- Standardise compact output for agent-fed issue lists Use TOON for uniform tool outputs such as issue lists, dependency-risk results, and other record-based feeds that are repeatedly passed into AI coding agents.
- Measure token savings on real payloads Run representative Sonar outputs through a token or stats check so you can compare JSON and TOON on your own data rather than assuming the benefit will be uniform.
- Reserve JSON for irregular structures Keep JSON where nested relationships, variable objects, or downstream integrations depend on explicit hierarchy that a compact row format would obscure.
Bottom line: TOON reduces the token overhead of feeding structured issue data into AI coding agents without changing the underlying information content.
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
TOON is a context-governance control, not just a formatting tweak. When agents ingest tool output, the organisation is spending model context on repetition as well as on substance. That means output encoding belongs in the same conversation as prompt scope, retrieval design, and tool permissions. Practitioners should treat schema compactness as part of AI operational control, not as an afterthought.
A question worth separating out:
Q: Should organisations treat agent output format as part of AI governance?
A: Yes, because output encoding affects cost, efficiency, and the consistency of downstream agent decisions. Governance does not stop at access controls or prompt rules. It also needs standards for what data gets exposed to the model and in what representation, especially in high-volume developer workflows.
👉 Read our full editorial: TOON format cuts agent token costs in Sonar issue output