Catalog PyPI
Back to packageRELEASE DETAILS

0.1.1

PyPI

agent-cover

Framework-agnostic coverage testing and observability tool for LLM Agents.

agentaicoveragedecision-coveragedevops-for-aievalsevaluationgenaigenai-opsgenerative-ailangchainllama-indexllmllm-opsllmopsmetrics
All keywords (30)
mlopsobservabilityopenaipf-runpluginprompt-coverageprompt-engineeringpromptflowpromptflow-batchpytestqaquality-assurancetestingtool-coverage
Published19 Jan 2026
Direct dependencies7
Transitive dependenciesNot calculated

README

Version 0.1.1 documentation

🛡️ Agent Cover

PyPI version Tests codecov Docs License: MIT Code style: ruff

Agent Cover is an observability and testing framework designed for LLMOps. Unlike traditional tools that measure executed lines of code, Agent Cover measures the Logical Coverage of your Agent.

It verifies that your test suite actually exercises the agent's capabilities: its Prompts, its Tools, and its Business Decision branches.

📚 Read the Documentation


📉 The Gap in LLM Testing

Traditional tools (like coverage.py) measure Python execution. However, in LLM-based applications, "line coverage" creates a false sense of security.

The Scenario: Your agent has a tool refund_user and a prompt instruction to "Ask for confirmation".

The Problem: Your test runs the code, but the LLM decides to skip the tool or ignore the prompt. Standard coverage says 100%. Agent Cover says 0% Tool Coverage.

🚀 How It Works

Agent Cover operates on a hybrid "Static + Runtime" model:

  1. 🔍 Inventory Scan (Static): Before tests run, it scans your codebase to build a map of "Logical Assets":

    • Prompts: LangChain objects, Jinja2 templates, and raw global strings.
    • Tools: Functions decorated with @tool or inheriting from BaseTool.
    • Decisions: Automatically derives coverage rules from your Pydantic models (Enums, Literals, Booleans).
  2. ⚡ Instrumentation (Runtime): It hooks into the execution lifecycle (LangChain, LlamaIndex, OpenAI, PromptFlow) to verify if those assets were actually used by the LLM.


📦 Installation

pip install agent-cover

For development and testing support:

pip install "agent-cover[dev]"


⚡ Quick Start

Create an agent-cover.yaml to define your Business Logic requirements.

# agent-cover.yaml
decisions:
  - id: intent_classification
    description: "Ensure the agent triggers all support paths"
    target_field: intent
    expected_values: ["REFUND", "TECH_SUPPORT", "SALES"]

2. Run with Pytest

Simply add the --agent-cov flag to your existing test run.

pytest --agent-cov --agent-cov-html=coverage_report

3. View the Report

Open coverage_report/index.html. You will see:

  • Prompt Coverage: Which templates were formatted and sent to the LLM.
  • Tool Coverage: Which tools the LLM actually decided to call.
  • Decision Coverage: Which logical branches (e.g., REFUND vs SALES) were observed in the output.

🔌 Supported Frameworks

Agent Cover dynamically patches these libraries to intercept logical events.

FrameworkStatusFeatures Tracked
LangChain✅Chains, Agents, Tools, Callbacks, Pydantic Parsers
LlamaIndex✅AgentRunner, FunctionTools, Prompts
OpenAI SDK✅ChatCompletions, Function Calling (Raw Strings)
PromptFlow✅Flow Nodes, Jinja Templates, Python Tools
Pydantic✅Auto-generation of decision rules from Models

🛠 Advanced Usage: Microsoft PromptFlow

PromptFlow executes nodes in separate worker processes, which breaks standard coverage tools. Agent Cover includes a dedicated CLI wrapper to handle multi-process aggregation.

Instead of running pf run, wrap your command:

# Injects instrumentation into all child worker processes
agent-cover run --source-dir ./src -- pf run create --flow ./my_flow --data data.jsonl

This will automatically aggregate coverage data from all parallel workers into a single report.


🤝 Contributing

Contributions are welcome! Please ensure all pull requests pass the CI quality gates.

  1. Clone the repository.
  2. Install development dependencies: pip install -e ".[dev]"
  3. Install pre-commit hooks: pre-commit install
  4. Run the test suite: pytest

📄 License

This project is licensed under the MIT License.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 7

Native requirements
7 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
filelock
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.10",
  "evaluation": "NOT_EVALUATED"
}
filelock<4.0.0,>=3.20.1runtime
langchain
Environment
{
  "extras": "",
  "marker": "extra == \"langchain\" or extra == \"all\"",
  "requires_python": "<4.0,>=3.10",
  "evaluation": "NOT_EVALUATED"
}
langchain<0.4.0,>=0.3.0; extra == "langchain" or extra == "all"runtime
llama-index
Environment
{
  "extras": "",
  "marker": "extra == \"llama-index\" or extra == \"all\"",
  "requires_python": "<4.0,>=3.10",
  "evaluation": "NOT_EVALUATED"
}
llama-index<0.14,>=0.13; extra == "llama-index" or extra == "all"runtime
openai
Environment
{
  "extras": "",
  "marker": "extra == \"openai\" or extra == \"all\"",
  "requires_python": "<4.0,>=3.10",
  "evaluation": "NOT_EVALUATED"
}
openai<2.0.0,>=1.30.0; extra == "openai" or extra == "all"runtime
packaging
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.10",
  "evaluation": "NOT_EVALUATED"
}
packaging<24.0,>=23.0runtime
promptflow
Environment
{
  "extras": "",
  "marker": "extra == \"promptflow\" or extra == \"all\"",
  "requires_python": "<4.0,>=3.10",
  "evaluation": "NOT_EVALUATED"
}
promptflow<2.0.0,>=1.0.0; extra == "promptflow" or extra == "all"runtime
pyyaml
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.10",
  "evaluation": "NOT_EVALUATED"
}
pyyaml<7.0,>=6.0runtime

Distribution files

2 collected
agent_cover-0.1.1-py3-none-any.whl

bdist_wheel · 99.89 KB · Python py3

Source file
agent_cover-0.1.1.tar.gz

sdist · 76.42 KB · Python source

Source file

Repository

PENDING
vittoriomussin/agent-cover

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:44 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:bc23c06afe970cc21c6af04d80fb10afb0268f5e765a020ff661d3e34e3dc43e

Other collected versions

View all collected versions →