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
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.
git clone --depth 1 https://github.com/microsoft/data-formulatorWrote 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/error-response-safety)<a href="https://agentmods.dev/rules/microsoft/data-formulator/error-response-safety"><img src="https://agentmods.dev/badge/rules/microsoft/data-formulator/error-response-safety/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/error-response-safety"><img src="https://agentmods.dev/badge/rules/microsoft/data-formulator/error-response-safety.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.01384 |
| Opus 5.5 | $0.00000 | $0.00554 |
| Sonnet 5.5 | $0.00000 | $0.00277 |
| Haiku 4.5 | $0.00000 | $0.00138 |
Grade A, and why
error-response-safety 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 — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Error Response Safety
Never return raw exception text (str(e), f"...{e}") directly in HTTP responses.
Python exceptions may contain stack traces, file paths, database connection strings,
API keys, or internal IP addresses — all of which are security risks (CWE-209).
See docs/dev-guides/7-unified-error-handling.md for the full error handling contract.
Unified Error System
New error paths should use the AppError / error_handler infrastructure from
errors.py and error_handler.py. Legacy message / error_message bodies are
historical formats; do not add compatibility branches for them in new code.
All application-controlled errors return HTTP 200 with status: "error" in the body.
Only auth errors (401/403) and uncontrolled transport errors (404/413/500) use non-200.
Non-streaming routes
Raise AppError for new code or when structured error codes are useful. The
global error handler returns HTTP 200 + JSON error envelope:
from data_formulator.errors import AppError, ErrorCode
# Business error — raise with appropriate code and safe message
raise AppError(ErrorCode.TABLE_NOT_FOUND, "Table not found")
# LLM / external API error — use classify_and_wrap_llm_error
from data_formulator.error_handler import classify_and_wrap_llm_error
except Exception as e:
raise classify_and_wrap_llm_error(e) from e
Streaming routes
Use stream_error_event() to yield a unified NDJSON error line.
Validation before the stream starts returns 200 application/json (not NDJSON):
from data_formulator.errors import AppError, ErrorCode
from data_formulator.error_handler import (
classify_and_wrap_llm_error,
stream_error_event,
stream_preflight_error,
)
except AppError as e:
yield stream_error_event(e)
except Exception as e:
yield stream_error_event(classify_and_wrap_llm_error(e))
Real examples from migrated endpoints
# /data-agent-streaming — standard NDJSON error event
except Exception as e:
logger.error("Error in data-agent-streaming", exc_info=e)
from data_formulator.error_handler import stream_error_event, classify_and_wrap_llm_error
yield stream_error_event(classify_and_wrap_llm_error(e))
# /generate-report-chat — same pattern
except Exception as e:
logger.exception("generate-report-chat failed")
from data_formulator.error_handler import stream_error_event, classify_and_wrap_llm_error
yield stream_error_event(classify_and_wrap_llm_error(e))
# Validation failure before stream starts — use 200 JSON, not NDJSON
if not request.is_json:
return stream_preflight_error(AppError(ErrorCode.INVALID_REQUEST, "Invalid request"))
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 · 160 lines · 0 tokens per session scan A 15b5baa3e0af
error-response-safety is a cursor rule published in the GitHub repository microsoft/data-formulator (17,566 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,384 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.
shared-libraries
Shared libraries - condition framework, inventory containers, file-backed DB, itinerary, references.
selectools-providers
Rules for working with LLM provider adapters in selectools.