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/adonai-labs/agent-runwayWrote 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/adonai-labs/agent-runway/python)<a href="https://agentmods.dev/rules/adonai-labs/agent-runway/python"><img src="https://agentmods.dev/badge/rules/adonai-labs/agent-runway/python/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/adonai-labs/agent-runway/python"><img src="https://agentmods.dev/badge/rules/adonai-labs/agent-runway/python.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.00635 |
| Opus 5.5 | $0.00000 | $0.00254 |
| Sonnet 5.5 | $0.00000 | $0.00127 |
| Haiku 4.5 | $0.00000 | $0.00064 |
Grade A, and why
python 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 — 64 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Development Guidelines
Directives for Python development. Apply when working with .py files, pyproject.toml, or requirements files.
Code Style
- Follow PEP 8; let
blackandruffenforce formatting rather than hand-tuning. - Use
snake_casefor functions and variables,PascalCasefor classes,UPPER_SNAKEfor constants. - Keep functions small and single-purpose; prefer early returns over deep nesting.
- Prefer comprehensions over manual loops for simple transformations, but not at the cost of readability.
Type Hints
- Annotate public function signatures (parameters and return types).
- Use
from __future__ import annotationsto simplify forward references. - Prefer
X | NoneoverOptional[X]on modern versions; useProtocolfor structural typing. - Run a type checker (
mypyorpyright) in CI; treat new type errors as failures.
Error Handling
- Catch specific exceptions — never a bare
except:. - Define custom exception types for domain errors; do not raise bare
Exception. - Use context managers (
with) for resources (files, sockets, locks, sessions). - Add context when re-raising:
raise DomainError(...) from err. - Do not silently swallow exceptions; log with context or propagate.
Async Patterns
- Use
async/awaitfor I/O-bound work; never call blocking I/O inside an async function. - Use
asyncio.gatherfor concurrent awaits;asyncio.create_taskto schedule. - Do not mix blocking libraries into the event loop — use async clients or run them in an executor.
Packaging and Imports
- Prefer absolute imports; avoid wildcard
from x import *. - Pin dependencies in
pyproject.toml/lock files; keep runtime and dev dependencies separate. - Avoid mutable default arguments — use
Noneand create the value inside the function.
Testing
- Use
pytest; name teststest_*.py. - Use fixtures for setup/teardown; mock external dependencies at the boundary.
- Cover happy path, edge cases (empty, null, boundary), and failure paths.
- Assert behaviour, not implementation detail.
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 · 64 lines · 0 tokens per session scan A 7d2e8f8d0df4
python is a cursor rule published in the GitHub repository adonai-labs/agent-runway (2 stars, last pushed 24d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 635 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-09-03.
Other cursor rules, from other repositories
python-cursorrules-prompt-file-best-practices
Cursor rules for Python development with best practices integration.
python-general-coding-standards
A set of general standards for Python projects, including type hints, input checking, code style, security, web requests, background work, and tests. It also covers FastAPI-specific tasks such as CORS and authentication.
pytest
You are an expert in pytest testing. Follow these rules.
pytest
You are an expert in pytest testing. Follow these rules.
jest-unit-testing-cursorrules-prompt-file
Cursor rules for Jest development with unit testing.
go
Idiomatic Go rules. Explicit error handling, interface-based design, context-first concurrency.