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/sunra-ai/sunra-clients/python-sdkgit clone --depth 1 https://github.com/sunra-ai/sunra-clientsWrote 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/sunra-ai/sunra-clients/python-sdk)<a href="https://agentmods.dev/rules/sunra-ai/sunra-clients/python-sdk"><img src="https://agentmods.dev/badge/rules/sunra-ai/sunra-clients/python-sdk.svg" alt="Measured on agentmods" 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.00046 | $0.05373 |
| Opus 5 | $0.00023 | $0.02686 |
| Sonnet 5 | $0.00009 | $0.01075 |
| Haiku 4.5 | $0.00005 | $0.00537 |
Grade C, and why
python-sdk scanned grade C 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
rm -rf build/ dist/ *.egg-info/ How it starts
The opening of the file, as written. The whole thing — 772 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Sunra Clients - Python SDK Developer Role Document
Overview
This document defines the role and responsibilities of a Python SDK Developer for the Sunra Clients project. The Python SDK provides both synchronous and asynchronous client libraries for interacting with Sunra.ai services, following Python best practices and type safety standards.
Project Structure
The Python SDK is organized as follows:
- src/sunra_client/: Main package directory
- init.py: Package initialization and public API
- client.py: Main client implementation with sync/async support
- auth.py: Authentication and credential management
- py.typed: Type checking marker file
Development Guidelines
1. Code Style and Standards
Python Style Guide
- Follow PEP 8 coding standards
- Use 4 spaces for indentation (Python standard)
- Maximum line length: 120 characters
- Use snake_case for functions and variables:
submit_request,get_status - Use PascalCase for class names:
SunraClient,QueueClient - Use UPPER_SNAKE_CASE for constants:
DEFAULT_TIMEOUT,MAX_RETRIES
Type Hints
- Use type hints for all function parameters and return values
- Use modern union syntax:
str | Noneinstead ofOptional[str] - Include
from __future__ import annotationsfor forward references - Maintain py.typed file for type checking support
Import Organization
# Standard library imports
import asyncio
import os
from typing import Any, Dict, Optional, Union
# Third-party imports
import httpx
from pydantic import BaseModel, Field
# Local imports
from .auth import CredentialsResolver
from .exceptions import SunraException, SunraValidationException
2. Architecture Patterns
Client Architecture
class SunraClient:
"""Main Sunra client with both sync and async support."""
def __init__(
self,
credentials: str | None = None,
api_endpoint: str | None = None,
queue_domain: str | None = None,
timeout: float = 300.0,
):
self._credentials = credentials or os.getenv("SUNRA_KEY")
self._api_endpoint = api_endpoint or os.getenv("SUNRA_API_ENDPOINT")
self._queue_domain = queue_domain or os.getenv("SUNRA_QUEUE_DOMAIN")
self._timeout = timeout
# Initialize HTTP clients
self._sync_client = httpx.Client(timeout=timeout)
self._async_client = httpx.AsyncClient(timeout=timeout)
def subscribe(self, endpoint_id: str, **kwargs) -> Dict[str, Any]:
"""Synchronous subscribe method."""
pass
async def subscribe_async(self, endpoint_id: str, **kwargs) -> Dict[str, Any]:
"""Asynchronous subscribe method."""
pass
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 · 772 lines · 46 tokens per session scan C 69bbb2a7c944
python-sdk is a cursor rule published in the GitHub repository sunra-ai/sunra-clients (7 stars, last pushed 7d ago), licensed Apache-2.0. It adds 46 tokens to every session and 5,373 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.
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.
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.
django-python
Rules for writing Python services at PostHog (Python servers powered by the Django framework).
aiohttp
This guide defines definitive best practices for using aiohttp, focusing on efficient, robust, and maintainable asynchronous HTTP client code.