ADR-0015 — Tool output contract and untrusted-data envelope
- Status: accepted (owner, 2026-10-21, with the final tool conventions, P0-11)
- Date: 2026-10-16
- Related: tool conventions, P0-11, P1-05, L-017, L-018, L-030 – L-045, THREAT_MODEL T6, A1, A7
Context
Section titled “Context”Agility content is user-generated (descriptions, acceptance criteria, comments, names) and often HTML. It reaches a language model that may follow instructions hidden in it. Agents also need compact, predictable output to choose and chain tools well, and clients validate outputs against schemas.
Decision
Section titled “Decision”Every tool returns:
- Text: a one-line summary, notes, then data in the requested
format(auto= table up to 8 columns, CSV above;table;csv;json). structuredContentmatching an additive, openoutputSchema(extra properties allowed)._meta["agility-bridge/result"]: instance, workspace, query actually run (with values masked), requests used, cache status, truncation, links.
Rules:
- All Agility-originated text (including names in summaries, notes and candidate lists) is inside an untrusted-data envelope with a random per-call marker; look-alike markers in data are neutralised; a one-line warning precedes each block. Rich text (HTML) is converted to plain text/Markdown with scripts, styles and event attributes removed; control and bidirectional-override characters are stripped.
- Caps (defaults / hard maximums): rows 100 / 1,000; value length 300 / 4,000 characters; data block 24,000 / 100,000 characters; columns 50 / 200. Cuts end with a notice that says how to get the rest.
- Paging:
nextCursorpresent only when more rows exist (the tool fetcheslimit + 1);truncatedonly for deliberately bounded lists;totalonly when actually computed (Agility returns no totals for lists, P0-06), never-1, never a guess. - Schemas: absent values are omitted, never
null; notypearrays (P0-07 finding 8). - Completeness:
partial: truewithnotes[]whenever pagination, permissions, limits, budget or a failed section prevent a complete answer; no plausible zeros. - Identity on every row:
number,assetType,oid,state,project, and timestamps where relevant. - Personal data minimisation: member emails are not returned unless the workspace enables it.
- Errors:
isError: true, textCODE: messageplus an optionalHint:,_meta["agility-bridge/error"] = { code, requestId }; stableAB_*codes (list in ARCHITECTURE.md §7); raw Agility bodies are never returned; unexpected exceptions becomeAB_INTERNALwith a reference id. - CSV output neutralises spreadsheet formulas.
Consequences
Section titled “Consequences”- One shaper for every tool; every new output path is covered by the poisoned-string probe tests.
- The envelope is advisory for the model, not a security boundary: write tools still need approval (ADR-0013).
Alternatives considered
Section titled “Alternatives considered”- Envelope only free-text fields: rejected; names and error texts carried injections in comparable servers.
- JSON-only output: rejected; many clients show only text, and CSV/table output is far cheaper in tokens.
agility-bridge is an unofficial, community project. It is not affiliated with, endorsed by, or supported by Digital.ai. Digital.ai, Agility and VersionOne are trademarks of their respective owners.