Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/microsoft/data-formulator/unified-error-protocolgit clone --depth 1 https://github.com/microsoft/data-formulatorWhat 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 | $0.00000 | $0.01811 |
| Opus 5 | $0.00000 | $0.00905 |
| Sonnet 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 yesterday.
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.
- yesterday 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,048 stars, last pushed 3d ago), 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
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.