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 agents/cubeplexai/cubepi/first-agentgit clone --depth 1 https://github.com/cubeplexai/cubepiWrote 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/agents/cubeplexai/cubepi/first-agent)<a href="https://agentmods.dev/agents/cubeplexai/cubepi/first-agent"><img src="https://agentmods.dev/badge/agents/cubeplexai/cubepi/first-agent.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 | $0.00023 | $0.01449 |
| Opus 5 | $0.00012 | $0.00724 |
| Sonnet 5 | $0.00005 | $0.00290 |
| Haiku 4.5 | $0.00002 | $0.00145 |
Grade A, and why
first-agent 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 — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Building Your First Agent
This guide is the longer cousin of the Quick Start. We'll build a single-tool agent end-to-end, then layer on the things you'll want next: streaming UI, error handling, and a cancel button.
Step 1 — set up the provider and model
The provider is the connection to the LLM API; provider.model("id", ...)
binds a model id to that provider and produces the value Agent(model=...)
expects.
import os
from cubepi.providers.anthropic import AnthropicProvider
provider = AnthropicProvider(provider_id="anthropic", api_key=os.environ["ANTHROPIC_API_KEY"])
model = provider.model(
"claude-sonnet-4-6",
max_tokens=4096, # response cap
context_window=200_000, # hard model limit; defaults are usually fine
temperature=0.7,
)
provider_id lives on the provider constructor and is propagated into the
bound model automatically — used by the framework to gate reasoning fields
and tag responses. Building a Model by hand and passing both
provider= and model= to Agent is the 0.6 idiom and no longer works
in 0.7.
Step 2 — declare a tool
A tool is an async function decorated with @tool:
from cubepi import tool
@tool
async def get_weather(city: str) -> str:
"Get current weather for a city. Returns a short text summary."
# do real work here — call an HTTP API, query a DB, etc.
return f"72°F and sunny in {city}"
A few details:
- The input schema is generated from the typed parameters and sent to
the model; the docstring becomes the tool description. Pydantic
Field(...)defaults and metadata are honoured. - Return a
str(wrapped as text), aContent, alistof content, or a fullAgentToolResultwhen you needdetails/is_error. - Need cancellation or progress streaming? Declare
signal(anasyncio.Eventset when the user cancels) and/oron_update(partial)in the signature and CubePi injects them — see Tool Use. - For a shared params model or dynamic construction, the longhand
AgentTool(...)is equivalent — see Tool Use.
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 · 178 lines · 23 tokens per session scan A 40f6177e655b
first-agent is an agent published in the GitHub repository cubeplexai/cubepi (43 stars, last pushed 2d ago), licensed MIT. It adds 23 tokens to every session and 1,449 once invoked, about $0.0001 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-30.
Other agents, from other repositories
cr-custom-rules
Reviews a supplied diff against explicit repository rules from supplied rule sources. Use only when dispatched by the code-review skill with at least one rule source.
cr-security
Reviews a supplied diff for introduced, practically exploitable security vulnerabilities. Use only when dispatched by the code-review skill.
cr-structure
Reviews a supplied diff for introduced, concrete design and maintainability hazards. Use only when dispatched by the code-review skill.
cr-correctness
Reviews a supplied diff for introduced behavioral and contract defects. Use only when dispatched by the code-review skill.
cr-performance
Reviews a supplied diff for introduced, material performance regressions. Use only when dispatched by the code-review skill.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.