agent__baseagent___llmagent_

agent__baseagent___llmagent_ is a cursor rule for Cursor from altaidevorg/rules-for-ai. It costs 4,096 tokens per session, scanned A, original, MIT.

A basic structure for an AI agent, including agents powered by a large language model. An agent can receive instructions, use tools or code, and work toward a task.

In plain words
What is it for?
Use it to build agents such as research assistants that interpret requests, call external tools, execute code, or cooperate with other agents.
Why use it?
It gives the parts of an AI application a consistent way to define what an agent is and how it behaves.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: mentions subagents.

Install

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.

agentmods
npx agentmods add rules/altaidevorg/rules-for-ai/agent__baseagent___llmagent_
Clone the repo
git clone --depth 1 https://github.com/altaidevorg/rules-for-ai

Made for: Cursor.

Wrote 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.

agentmods badge for agent__baseagent___llmagent_

README.md
[![agentmods](https://agentmods.dev/badge/rules/altaidevorg/rules-for-ai/agent__baseagent___llmagent_.svg)](https://agentmods.dev/rules/altaidevorg/rules-for-ai/agent__baseagent___llmagent_)
Your own site
<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>
Per session 4,096 This file is loaded in full into every session.
When invoked 4,096 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 5d ago against content hash ea2e771e60d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

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.

examples/google-adk/agent__baseagent___llmagent_.mdc · 286 lines

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:

  1. Understand a user's research query (e.g., "Summarize recent advancements in quantum computing").
  2. Use a web search tool to find relevant articles.
  3. Process the search results.
  4. Generate a concise summary. Furthermore, perhaps the summarization task is complex enough to warrant a dedicated "Summarizer" sub-agent. The Agent abstraction 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) and run_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), and sub_agents (list of contained agents).
    • Hierarchy: Enables building multi-agent systems by nesting agents within each other via sub_agents. The parent_agent field is automatically set when an agent is added to another's sub_agents.
    • Callbacks: Provides hooks (before_agent_callback, after_agent_callback) to inject custom logic before and after the agent's core execution logic.

Read the full file on GitHub · 286 lines

Changes

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.

  1. 5d ago First seen · 286 lines · 4,096 tokens per session scan A ea2e771e60d1

Subscribe to this mod's changes

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.