toon-format — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited toon-format (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
TOON (Token-Oriented Object Notation) is a compact, human-readable encoding of the JSON data model optimized for LLM context windows. It uses YAML-style indentation for objects and CSV-style tabular rows for uniform arrays. It achieves ~40% fewer tokens than JSON on mixed-structure data.
TOON is a wire format between harness and model — not a replacement for JSON in code.
Use TOON when injecting structured data into context and the data has repeated structure:
Do not use TOON when:
Decision rule: if the data contains arrays of objects with mostly the same keys, use TOON. Otherwise, use JSON.
When a tool returns structured JSON, encode it as TOON before injecting into the conversation. Use the TypeScript SDK:
import { encode } from '@toon-format/toon'
const toon = encode(toolResult)Wrap in a toon code fence when embedding in a message:
<encoded content>
Encode retrieved document metadata and content as TOON to fit more documents in the context window:
const contextPayload = encode({
documents: retrievedDocs.map(doc => ({
id: doc.id, score: doc.score, source: doc.source, content: doc.content
}))
})Use TOON for few-shot examples with uniform structure to save tokens:
const examples = encode({
examples: [
{ input: 'extract invoice fields', output: 'vendor,amount,date' },
{ input: 'summarize meeting notes', output: 'attendees,decisions,action_items' }
]
})When generating TOON yourself (not just consuming it), follow these rules:
results[N]{id,title,confidence}:Replace N with the actual row count.
true, false, null), or is empty.Objects — key: value with 2-space indent, no braces:
user:
id: 123
name: Ada LovelacePrimitive arrays — inline with count:
tags[3]: admin,ops,devTabular arrays — field names declared once, values as rows:
users[3]{id,name,role}:
1,Alice,admin
2,Bob,engineer
3,Carol,viewerList arrays — for non-uniform objects (different key sets):
events[2]:
- type: login
ts: 1700000000
- type: error
ts: 1700000042
code: 503Always decode model-generated TOON with strict mode (the default):
import { decode } from '@toon-format/toon'
const parsed = decode(toonString) // strict by defaultStrip code fences before decoding. Handle parse errors explicitly — do not silently accept partial data.
Strict mode catches: array count mismatches (truncation), indentation violations, missing/extra columns, and escaping errors.
\t): numeric-heavy data, fewer quotes needed.|): data with frequent commas in strings.const toon = encode(data, { delimiter: '\t' })Collapse single-key wrapper chains into dotted paths to reduce nesting overhead:
const folded = encode(data, { keyFolding: 'safe' })
// response.data.metadata.items[2]: a,bUse when API responses have deep single-key wrappers. Disable when structural clarity matters more than savings.
Use the CLI --stats flag to quantify savings before committing:
npx @toon-format/cli input.json --stats"null", "true", "123" when they are strings).~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.