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/OpenDCAI/DataFlow-WebUIWrote 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/opendcai/dataflow-webui/backend-api)<a href="https://agentmods.dev/rules/opendcai/dataflow-webui/backend-api"><img src="https://agentmods.dev/badge/rules/opendcai/dataflow-webui/backend-api/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/opendcai/dataflow-webui/backend-api"><img src="https://agentmods.dev/badge/rules/opendcai/dataflow-webui/backend-api.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.01689 |
| Opus 5.5 | $0.00000 | $0.00676 |
| Sonnet 5.5 | $0.00000 | $0.00338 |
| Haiku 4.5 | $0.00000 | $0.00169 |
Grade A, and why
backend-api 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 — 194 lines — stays where its author put it; the contents beside it link to each section on GitHub.
DataFlow WebUI Backend (FastAPI)
⚠ CHANGE POLICY: Before creating any new endpoint, service, or registry, check
webui-change-policy.mdc. Only operator rendering support and existing-resource CRUD fixes are allowed. New analytical endpoints, dashboards, and feature-level APIs are prohibited unless the user explicitly overrides.
Response Envelope — ALL responses return HTTP 200
This project wraps every response in ApiResponse[T]. Errors are NOT HTTP 4xx/5xx on the wire — they are success: false with the real status in meta.http_status.
from app.api.v1.resp import ok, created, no_content
from app.api.v1.envelope import ApiResponse
# Success
return ok(data) # {"success": true, "code": 200, "data": ...}
return created(data) # Same shape, HTTP still 200
return no_content() # Empty body, HTTP 200
# Errors — raise HTTPException or ApiError subclass, handler wraps into ApiResponse
from fastapi import HTTPException
raise HTTPException(404, "Pipeline not found") # → {"success": false, "code": 40400, ...}
from app.api.v1.errors import NotFoundError, ConflictError, ValidationBizError
raise NotFoundError("Dataset not found") # code=40401, meta.http_status=404
Endpoint Pattern
from fastapi import APIRouter, HTTPException
from app.api.v1.envelope import ApiResponse
from app.api.v1.resp import ok, created
from app.core.container import container
from app.schemas.my_resource import MyResourceIn, MyResourceOut
router = APIRouter(tags=["my_resource"])
# GET list
@router.get("/", response_model=ApiResponse[list[MyResourceOut]],
operation_id="list_my_resources", summary="列出所有资源")
def list_my_resources():
return ok(container.my_resource_registry.list())
# POST create
@router.post("/", response_model=ApiResponse[MyResourceOut],
operation_id="create_my_resource", summary="创建新资源")
def create_my_resource(payload: MyResourceIn):
try:
result = container.my_resource_registry.add_or_update(payload.model_dump(mode="json"))
except Exception as e:
raise HTTPException(400, f"Failed to create: {e}")
return created(result)
# GET by id
@router.get("/{resource_id}", response_model=ApiResponse[MyResourceOut],
operation_id="get_my_resource", summary="获取单个资源")
def get_my_resource(resource_id: str):
item = container.my_resource_registry.get(resource_id)
if not item:
raise HTTPException(404, "Resource not found")
return ok(item)
# PUT update
@router.put("/{resource_id}", response_model=ApiResponse[MyResourceOut],
operation_id="update_my_resource", summary="更新资源")
def update_my_resource(resource_id: str, payload: MyResourceUpdateIn):
data = payload.model_dump(exclude_unset=True)
updated = container.my_resource_registry.update(resource_id, data)
return ok(updated)
# DELETE
@router.delete("/{resource_id}", response_model=ApiResponse[dict],
operation_id="delete_my_resource", summary="删除资源")
def delete_my_resource(resource_id: str):
item = container.my_resource_registry.get(resource_id)
if not item:
raise HTTPException(404, "Resource not found")
container.my_resource_registry.remove(resource_id)
return ok(message="Resource deleted")
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 · 194 lines · 0 tokens per session scan A d71c423e3777
backend-api is a cursor rule published in the GitHub repository OpenDCAI/DataFlow-WebUI (251 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,689 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
python_tests
We use the unit tests to cover internal behavior that can work without the web / backend counterpart. We aim for 95%+ unit test coverage of our Python code in lib/streamlit.
django-python
Rules for writing Python services at PostHog (Python servers powered by the Django framework).
py-fast-api
Cursor rules for Python FastAPI backend development and best practices.
python
Python best practices and patterns for modern software development with Flask and SQLite.
python--typescript-guide-cursorrules-prompt-file
Cursor rules for Python development with TypeScript guide integration.
python-conventions
Python coding style, FastAPI endpoint template, code organisation sections.