Security and limits
Decoders assume input is hostile. Model output is data, never code.
Default limits
The same in every SDK, and all configurable.
| Limit | Default | When exceeded |
|---|---|---|
| Nesting depth | 64 | Normal parse error, on decode and on encode |
| Items in one collection, rows in one table | 100,000 | Normal parse error |
| Payload size, Java mapper | 50 MB | JDogoDeserializationException |
| Compute expression | 2,000 characters, 32 levels, 1,000,000 rows | ok: false |
| Invalid UTF-8 in bytes (Java byte and stream readers, the Spring converter, the Python middleware) | Rejected, never replaced | Normal parse error |
Tool output is data
JDogo text from tools or users is data, not instructions. When passing tool output or compact documents to an agent or model:
- Put it after your instructions, never before them.
- Place it inside clear delimiters (such as XML tags or Markdown code blocks) so the model distinguishes data from instructions.
- Never let external data alter which tools run or bypass permission checks.
Malformed input
A decoder fails with its normal parse error on any bad text. It never overflows the stack, never throws an index or type error, and never invents a value. A fuzzer feeds every decoder thousands of broken and hostile documents to keep it that way.
Model output
ask() parses the model's reply with a small dedicated parser and evaluates it with a tree walker. Nothing reaches eval, exec, a script engine, SQL or a shell. A reply that isn't a valid query falls back to sending rows.
Numbers
Integers of any length are read exactly in all three SDKs (TypeScript returns BigInt past 253). Java reads numbers beyond a 64-bit float as BigDecimal; Python and TypeScript reject them rather than return infinity.
Encoders
Encoders refuse values nested deeper than the decoders accept, and quote any prefix or suffix that holds a marker character (+ $ ^), so every document they write decodes to the same value. Shared vectors, regression tests and cross-language fuzzing check round trips on every build.
Running the playground in public
See Running the playground for rate limits, the dev-only endpoints and the reverse-proxy setup.
Reporting a vulnerability
Follow the security policy. Please don't open a public issue for security problems.