Observed since 20 Oct, 22:04 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Framework-agnostic agent governance and telemetry library
Framework-agnostic Python library for monitoring and governing AI agents with automatic telemetry, cost tracking, and OpenTelemetry integration.
pip install agent-governance
export AGENT_GOVERNANCE_PLATFORM_URL=https://your-platform-url
export AGENT_GOVERNANCE_API_KEY=your-api-key # optional
from agent_governance import track_agent
@track_agent(
agent_id="my-agent-001",
agent_name="My Agent",
framework="strands" # or "adk", "langgraph", "custom"
)
async def my_agent(query: str):
# Your agent code here
return result
That's it! Every execution is now tracked automatically.
from agent_governance import track_agent
from strands import Agent
from strands.models import VertexAIModel
model = VertexAIModel(model="gemini-2.0-flash-exp")
agent = Agent(name="my_agent", model=model)
@track_agent(agent_id="strands-agent-001", framework="strands")
async def execute_agent(query: str):
response = await agent.run(query)
return {"result": response.content}
from agent_governance import track_agent
from langgraph.prebuilt import create_react_agent
agent = create_react_agent(model=llm, tools=[])
@track_agent(agent_id="langgraph-agent-001", framework="langgraph")
async def execute_agent(query: str):
result = await agent.ainvoke({"messages": [...]})
return {"result": result}
from agent_governance import track_agent
@track_agent(agent_id="adk-agent-001", framework="adk")
async def execute_agent(query: str):
# Your ADK agent code
return result
from agent_governance import track_agent
@track_agent(agent_id="custom-agent-001", framework="custom")
def my_custom_agent(input_data):
# Any Python function
result = process(input_data)
return result
For every agent execution:
| Metric | Description |
|---|---|
| agent_id | Unique identifier |
| agent_name | Human-readable name |
| execution_id | Per-call UUID |
| framework | Framework used |
| timestamp | Execution time |
| duration | Time taken (seconds) |
| input_tokens | Request tokens |
| output_tokens | Response tokens |
| total_tokens | Sum of tokens |
| cost | Calculated cost ($) |
| status | success/error |
| error | Error message if failed |
# Required
export AGENT_GOVERNANCE_PLATFORM_URL=https://your-platform-url
# Optional
export AGENT_GOVERNANCE_API_KEY=your-api-key
@track_agent(
agent_id="my-agent", # Required: Unique identifier
agent_name="My Agent", # Optional: Display name
api_key="...", # Optional: Override env var
platform_url="https://...", # Optional: Override env var
framework="strands" # Optional: Framework name
)
Automatic cost calculation based on token usage:
| Model | Input (per 1M tokens) | Output (per 1M tokens) |
|---|---|---|
| gemini-2.0-flash | $0.075 | $0.30 |
| gemini-1.5-pro | $1.25 | $5.00 |
| gpt-4o | $2.50 | $10.00 |
| gpt-4o-mini | $0.15 | $0.60 |
The library automatically:
The library is designed to never break your agent:
This library requires a governance platform to receive telemetry. You can:
# Install in development mode
pip install -e .
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
MIT License - see LICENSE file for details
Contributions welcome! Please read CONTRIBUTING.md first.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 12 Feb 2026 | 7 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 22:04 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:054274c551b0606f8977ee01c8d62cd7d52ac49b96bf4d16b747387ad0f6a9ec