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/artesiana/agent2/cursorrulesgit clone --depth 1 https://github.com/Artesiana/agent2What 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.00399 | $0.00399 |
| Opus 5 | $0.00199 | $0.00199 |
| Sonnet 5 | $0.00080 | $0.00080 |
| Haiku 4.5 | $0.00040 | $0.00040 |
Grade A, and why
cursorrules scanned grade A with 1 finding 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
- Docker: docker compose up -d && curl localhost:8001/health What it actually says
Agent2 — Production Runtime for AI Agents
What this repo is
Agent2 is a framework for building production AI agents with typed HTTP APIs. PydanticAI handles the agent loop. Agent2 handles everything else: API, auth, pause/resume, approvals, provider routing, knowledge search.
Key patterns
- Agents live in agents// with: schemas.py, agent.py, tools.py, config.yaml, main.py
- create_agent() from shared/runtime.py is the ONLY way to build agents
- create_app() from shared/api.py is the ONLY way to build FastAPI apps
- Use instructions= (not system_prompt=) for agent prompts
- Use toolsets= for MCP server connections
- Output schemas are Pydantic BaseModel classes passed as output_type=
Code style
- Python 3.12+, type hints on all signatures
- from future import annotations in all shared/ modules
- RFC 7807 error responses via ProblemError
- Config uses frozen dataclasses with from_env(), not pydantic-settings
- OpenRouter models: OpenAIChatModel + OpenRouterProvider
Architecture rules
- shared/ is framework code — never modify it for agent-specific logic
- Each agent is a separate Docker service
- Prompts are code-first; Langfuse is optional for observability
- Knowledge is in R2R, accessed via Knowledge MCP
Testing
- uv run pytest tests/ -v (unit tests, no Docker needed)
- Docker: docker compose up -d && curl localhost:8001/health
Creating a new agent
- cp -r agents/_template agents/my-agent
- Edit schemas.py (Pydantic output model)
- Edit agent.py (create_agent + tools)
- Edit config.yaml (name, model, collections)
- Edit main.py (create_app call)
- Add to docker-compose.yml
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 · 40 lines · 399 tokens per session scan A 8087baa08bc4
cursorrules is a cursor rule published in the GitHub repository Artesiana/agent2 (36 stars, last pushed 3mo ago), licensed MIT. It adds 399 tokens to every session, about $0.0020 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). 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
settings-page
Settings page layout, tabs, Preferences section, AI Setup section, auto-save pattern, custom UI components.
rolemule-core
Core RoleMule conventions — app name, error system, JSON serialization, background tasks.
llm-integration
Multi-provider LLM client — per-user BYOK (Gemini/OpenAI/Anthropic/Ollama), grounding, CFG6001.
analytics-consent-onboarding
PostHog analytics, GDPR cookie consent, and onboarding tour usage.
cursorrules
You are an AI assistant working with the OmoiOS codebase. Follow these rules when working with Python files, especially those containing SQLAlchemy models.
desktop-release-gate
Desktop app fixes must pass a local packaged build smoke test before pushing release tags or CI desktop builds.