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/altaidevorg/rules-for-ai/agent__baseagent___llmagent_git clone --depth 1 https://github.com/altaidevorg/rules-for-aiWrote 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/altaidevorg/rules-for-ai/agent__baseagent___llmagent_)<a href="https://agentmods.dev/rules/altaidevorg/rules-for-ai/agent__baseagent___llmagent_"><img src="https://agentmods.dev/badge/rules/altaidevorg/rules-for-ai/agent__baseagent___llmagent_.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.04096 | $0.04096 |
| Opus 5 | $0.02048 | $0.02048 |
| Sonnet 5 | $0.00819 | $0.00819 |
| Haiku 4.5 | $0.00410 | $0.00410 |
Grade A, and why
agent__baseagent___llmagent_ 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 5d 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 — 286 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Chapter 2: Agent (BaseAgent / LlmAgent)
In the previous chapter, we learned about the Runner, the orchestrator that manages agent execution within a session. Now, we dive into the core component being orchestrated: the Agent itself. This chapter focuses on BaseAgent, the fundamental agent abstraction, and LlmAgent, its primary LLM-powered implementation.
Motivation and Use Case
To build sophisticated AI applications, we need a way to represent autonomous entities that can perceive, reason, plan, and act to achieve goals. These entities might need to use external tools (like search engines or APIs), execute code, follow complex instructions, and potentially collaborate with other similar entities.
The Agent abstraction in google-adk provides this structure. BaseAgent defines the common interface and properties for any agent, while LlmAgent provides a powerful implementation leveraging Large Language Models (LLMs) for reasoning and task execution.
Central Use Case: Imagine building a "Research Assistant" agent. This agent needs to:
- Understand a user's research query (e.g., "Summarize recent advancements in quantum computing").
- Use a web search tool to find relevant articles.
- Process the search results.
- Generate a concise summary.
Furthermore, perhaps the summarization task is complex enough to warrant a dedicated "Summarizer" sub-agent. The
Agentabstraction allows us to define the Research Assistant (LlmAgent), equip it with a search Tool (BaseTool), define its instructions, and structure it to potentially delegate to a Summarizer sub-agent.
Key Concepts
BaseAgent(Interface & Structure):- Interface: Defines the core execution methods:
run_async(for typical turn-based interaction) andrun_live(experimental, for real-time streaming). - Structure: Holds fundamental properties like
name(unique identifier),description(capability summary used for delegation),parent_agent(reference to the containing agent), andsub_agents(list of contained agents). - Hierarchy: Enables building multi-agent systems by nesting agents within each other via
sub_agents. Theparent_agentfield is automatically set when an agent is added to another'ssub_agents. - Callbacks: Provides hooks (
before_agent_callback,after_agent_callback) to inject custom logic before and after the agent's core execution logic.
- Interface: Defines the core execution methods:
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.
- 5d ago First seen · 286 lines · 4,096 tokens per session scan A ea2e771e60d1
agent__baseagent___llmagent_ is a cursor rule published in the GitHub repository altaidevorg/rules-for-ai (2 stars, last pushed 1y ago), licensed MIT. It adds 4,096 tokens to every session, about $0.0205 per session on Opus 5. 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-31.
Other cursor rules, from other repositories
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.