Data Formulator is an interactive workspace where AI agents connect to data sources, answer questions, and create visualizations. It is used to explore and analyze data while branching into related questions without losing the context of each investigative path.
Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/microsoft/data-formulatornpx agentmods add rules/microsoft/data-formulator/unified-error-protocolWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/microsoft/data-formulator/unified-error-protocol)<a href="https://agentmods.dev/rules/microsoft/data-formulator/unified-error-protocol"><img src="https://agentmods.dev/badge/rules/microsoft/data-formulator/unified-error-protocol/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/microsoft/data-formulator/unified-error-protocol"><img src="https://agentmods.dev/badge/rules/microsoft/data-formulator/unified-error-protocol.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01811 |
| Opus 5.5 | $0.00000 | $0.00724 |
| Sonnet 5.5 | $0.00000 | $0.00362 |
| Haiku 4.5 | $0.00000 | $0.00181 |
Grade A, and why
unified-error-protocol scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 176 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Unified Error Protocol
See docs/dev-guides/7-unified-error-handling.md for the full developer guide.
HTTP Status Code Policy
All application-controlled errors return HTTP 200 with status: "error" in the body.
This applies to both non-streaming JSON APIs and streaming pre-flight errors.
Only these scenarios use non-200:
401—AUTH_REQUIRED/AUTH_EXPIRED(so transport layer can intercept)403—ACCESS_DENIED(so transport layer can intercept)404— Flask routing: no matching route handler413— WSGI: request body exceedsMAX_CONTENT_LENGTH500— Unhandled exception that escaped all error handling
Streaming NDJSON APIs:
- Pre-stream validation failure: HTTP
200+application/json(usestream_preflight_error()) - In-stream error: NDJSON
{"type": "error", "error": {...}} - In-stream warning: NDJSON
{"type": "warning", "warning": {...}}
Backend: Non-streaming JSON Format
// Success (HTTP 200)
{"status": "success", "data": {...}}
// Error (HTTP 200 for business errors, 401/403 for auth errors)
{
"status": "error",
"error": {
"code": "TABLE_NOT_FOUND",
"message": "Table not found",
"retry": false,
"detail": "..." // Only in debug mode
}
}
Backend: Streaming NDJSON Format
All streaming endpoints use application/x-ndjson. Each line is one JSON object:
{"type": "text_delta", "data": {...}}
{"type": "error", "error": {"code": "LLM_TIMEOUT", "message": "...", "retry": true}}
{"type": "done", "data": {...}}
Backend: How to Handle Errors
from data_formulator.errors import AppError, ErrorCode
from data_formulator.error_handler import json_ok, stream_preflight_error
from data_formulator.error_handler import stream_error_event, classify_and_wrap_llm_error
# Non-streaming: success
return json_ok(data)
# Non-streaming: error (global handler returns HTTP 200, auth errors get 401/403)
raise AppError(ErrorCode.TABLE_NOT_FOUND, "Table not found")
# Streaming: pre-flight error (always HTTP 200)
return stream_preflight_error(AppError(ErrorCode.INVALID_REQUEST, "Bad input"))
# Streaming: in-stream error
yield stream_error_event(classify_and_wrap_llm_error(e))
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 176 lines · 0 tokens per session scan A c80fbd20128f
unified-error-protocol is a cursor rule published in the GitHub repository microsoft/data-formulator (17,610 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,811 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
api-property-optionality-hygiene
Fix ApiProperty/ApiPropertyOptional optionality mismatches in DTO files; use for scheduled batch fixes or DTO edits.
python
Python best practices and patterns for modern software development with Flask and SQLite.
cursor
You are working on the checkout service. Preserve transaction integrity and auditability.
django
Definitive guidelines for writing maintainable, performant, and secure Django applications, emphasizing modern best practices, clear code organization, and efficient patterns.
server-state
USE WHEN: Fetching and caching server data with TanStack Query 5: queryOptions, hooks, mutations, invalidation.
ehs-ims-conventions
EHS IMS app — RBAC, data layer, tRPC, migrations, AI boundaries.