Skip to main content

AgentGraph trust verification middleware for PydanticAI agents

Project description

agentgraph-pydantic

Trust verification middleware for PydanticAI agents

Status: Early Development — feedback welcome

Install

pip install agentgraph-pydantic

Quick Start

from agentgraph_pydantic import TrustGuard, check_trust

# Quick one-shot check
result = await check_trust("crewAIInc/crewAI")
if result.allowed:
    print(f"{result.grade} ({result.score}) — safe to execute")

# Reusable guard with a minimum tier
guard = TrustGuard(min_tier="standard")
result = await guard.check("owner/repo")
if not result.allowed:
    raise ValueError(f"Blocked: {result.reason}")

What This Does

agentgraph-pydantic lets PydanticAI agents verify the trust score of any GitHub repository before executing tools, calling external code, or loading MCP servers. It queries the AgentGraph Trust Gateway and returns a typed TrustResult with score, grade, tier, and category breakdowns — no AgentGraph account required for basic checks.

API

check_trust(repo, min_tier="standard") -> TrustResult

Convenience function for a single trust check.

TrustGuard(min_tier, api_url=None, timeout=30.0)

Reusable guard object. Call await guard.check(repo) to verify trust.

TrustResult

Field Type Description
repo str Repository checked
allowed bool Whether the repo meets the minimum tier
score int Trust score (0-100)
grade str Letter grade (A+/A/B/C/D/F)
tier str Trust tier (verified/trusted/standard/minimal/restricted/blocked)
reason str Human-readable decision reason
category_scores dict[str, int] Per-category score breakdown

How It Differs from agentgraph-bridge-pydantic

  • agentgraph-pydantic (this package) — trust verification middleware. Checks whether external tools/repos are safe to use. No account needed.
  • agentgraph-bridge-pydantic — registration bridge. Registers your PydanticAI agents on the AgentGraph network. Requires an API key.

Documentation

Full docs at agentgraph.co/docs

Contributing

This package is in early development. We welcome issues, feedback, and PRs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentgraph_pydantic-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentgraph_pydantic-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file agentgraph_pydantic-0.1.0.tar.gz.

File metadata

  • Download URL: agentgraph_pydantic-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for agentgraph_pydantic-0.1.0.tar.gz
Algorithm Hash digest
SHA256 40f115c1cb13a61685873e434333d7f10a4eb9a8439f7f861a0a99ce86d53502
MD5 3daa8aa319d7b5dd3af945daedb015d7
BLAKE2b-256 96eb6d4c526b045ebfdecbefaf15f660b28506659210641cc57f46e09184ee45

See more details on using hashes here.

File details

Details for the file agentgraph_pydantic-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentgraph_pydantic-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c1786c9e4376ccb5b032ec0c4101f3e9dbf97f7f33f25d7c587ca175b447b4b
MD5 16a2cb7d32e1faf18a23c16944d0b893
BLAKE2b-256 255780e7a8b07e548b6d73e02735c714634301d15bcbbf309baeaf48d480e505

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page