index

A guide to defining and running agents with any-agent, using a shared configuration format across supported frameworks. It shows how to create single-agent and multi-agent systems and add built-in tools.

In plain words
What is it for?
Use it to create an agent, choose its model and instructions, add web-search tools, build an agent system with multiple agents, or pass framework-specific settings.
Why use it?
It gives you a consistent starting point for configuring agents even when the underlying framework or model provider changes.

Agent

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 agents/mozilla-ai/any-agent/index
Clone the repo
git clone --depth 1 https://github.com/mozilla-ai/any-agent
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,500 The whole file, excluding the scripts and references it only reads on demand.
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 $0.00000 $0.01500
Opus 5 $0.00000 $0.00750
Sonnet 5 $0.00000 $0.00300
Haiku 4.5 $0.00000 $0.00150

Measured 2d ago against content hash 6029cf373be6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

index 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 2d 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.

docs/agents/index.md · 190 lines

How it starts

The opening of the file, as written. The whole thing — 190 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Defining and Running Agents

Defining Agents

To define any agent system you will always use the same imports:

from any_agent import AgentConfig, AnyAgent, AgentRunError
# In these examples, the built-in tools will be used
from any_agent.tools import search_web, visit_webpage

Check AgentConfig for more info on how to configure agents.

Single Agent

agent = AnyAgent.create(
    "openai",  # See other options under `Frameworks`
    AgentConfig(
        model_id="mistral:mistral-small-latest",
        instructions="Use the tools to find an answer",
        tools=[search_web, visit_webpage]
    ),
)

Multi-Agent

{% hint style="warning" %} A multi-agent system introduces even more complexity than a single agent.

As stated before, carefully consider whether you need to adopt this pattern to solve the task. {% endhint %}

Multi-Agent systems can be implemented using Agent-As-Tools.

Framework Specific Arguments

Sometimes, there may be a new feature in a framework that you want to use that isn't yet supported universally in any-agent.

The agent_args parameter in AgentConfig allows you to pass arguments specific to the underlying framework that the agent instance is built on.

Running Agents

try:
    agent_trace = agent.run("Which Agent Framework is the best??")
    print(agent_trace.final_output)
except AgentRunError as e:
    agent_trace = e.trace

Check AgentTrace for more info on the return type.

Exceptions are wrapped in an AgentRunError, that carries the original exception in the __cause__ attribute. Additionally, its trace property holds the trace containing the spans collected so far.

Async

If you are running in async context, you should use the equivalent create_async and run_async methods:

import asyncio

async def main():
    agent = await AnyAgent.create_async(
        "openai",
        AgentConfig(
            model_id="mistral:mistral-small-latest",
            instructions="Use the tools to find an answer",
            tools=[search_web, visit_webpage]
        )
    )

    agent_trace = await agent.run_async("Which Agent Framework is the best??")
    print(agent_trace.final_output)

if __name__ == "__main__":
    asyncio.run(main())

Read the full file on GitHub · 190 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. 2d ago First seen · 190 lines · 0 tokens per session scan A 6029cf373be6

Subscribe to this mod's changes

index is an agent published in the GitHub repository mozilla-ai/any-agent (1,197 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,500 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-08-30.

Related

Other agents, from other repositories