Skip to main content

pydantic-ai-trustabl

Scan an agent repository for reliability and safety weaknesses from inside a Pydantic AI agent, and hand the findings back for the agent to fix.

pip install pydantic-ai-trustabl

The problem

Trustabl analyses agent code: unsafe tool grants, missing turn limits, untyped tools, prompt-injectable shell tools, fetch calls with no timeout. It ships as a CLI and as editor plugins. There was no way to give a Pydantic AI agent the same scan-and-fix loop from your own code.

The solution

Trustabl adds a scan_repository tool that runs the scanner in the run's workspace, summarises the report, and returns it. The agent then verifies each finding and fixes the real ones with whatever tools it already has.

from pydantic_ai import Agent
from pydantic_ai.capabilities import LocalWorkspace
from pydantic_ai_trustabl import Trustabl

agent = Agent(
    'anthropic:claude-sonnet-5',
    capabilities=[
        LocalWorkspace('.'),
        Trustabl(),
    ],
)

result = agent.run_sync('Scan this repository and fix the confirmed findings.')
print(result.output)

On Windows, use a container workspace rather than LocalWorkspace. The example above raises NotImplementedError there, because Pydantic AI's LocalWorkspaceBackend is POSIX only at the moment: its timeout contract kills the whole process group, which Windows has no equivalent for. That is an upstream limitation rather than one this package adds, and everything else here works the same on all three platforms.

Why it summarises

A full scan of a large agent repository reaches several megabytes, far past what is useful in a tool result. The tool returns the inventory, a severity histogram, and the findings above a floor, with truncated set when any were dropped.

Two details worth knowing:

  • Test-path findings are excluded, from the returned findings and from the histogram. The scanner classifies them with origin: test. Counting them would produce a histogram that contradicts the findings printed beside it.
  • rules_skipped is reported. When the rule pack is newer than the scanner, rules are skipped silently. A zero finding count with a non-zero rules_skipped means the scan was incomplete, not that the code is clean.

Options

Option Default What it does
command None Binary name or path. None resolves it automatically
engine_version 0.1.16 Scanner release to download when none is on PATH
severity_floor medium Lowest severity returned. Counts ignore the floor
max_findings 50 Cap on returned findings, worst first
timeout 600.0 Seconds allowed for one scan
guidance None Replaces the default instructions. '' contributes none

How the scanner is found

  1. If trustabl is on the workspace's PATH, that is used.
  2. Otherwise the pinned release is downloaded and its SHA-256 checked against the release's checksums.txt. Nothing is executed before the checksum matches.
  3. A host download is invisible to a sandbox, so the capability confirms the workspace can see the binary and otherwise raises with install instructions.

The version is pinned rather than tracking latest, so checksum verification stays meaningful and a bad scanner release cannot reach every user at once.

Privacy

The scan runs where your agent runs. There is no hosted scanner, no account, no code upload, and no model in the analysis path. The only network calls are fetching the scanner on first use and the versioned rule pack at scan time.

Apache-2.0

Metadata

Release files for pydantic-ai-trustabl 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydantic-ai-trustabl 0.1.1
File Size Uploaded Provenance Actions
pydantic_ai_trustabl-0.1.1.tar.gz 15.1 kB With provenance Details for pydantic_ai_trustabl-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-ai-trustabl 0.1.1
File Interpreter ABI Platform Actions
pydantic_ai_trustabl-0.1.1-py3-none-any.whl Python 3 none any Details for pydantic_ai_trustabl-0.1.1-py3-none-any.whl

Total release size: 30.3 kB

Release files / pydantic_ai_trustabl-0.1.1.tar.gz

Download URL pydantic_ai_trustabl-0.1.1.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3a1cc47314bb0712155de7c164ecf3b2f87aff350555a0272c60438b1c72e9e8
BLAKE2b-256 checksum
How to use checksums
9bfd9c26431de536a76f494dbcbd5c513c65a2f137616e204a0f8f13a0fafbf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Release files / pydantic_ai_trustabl-0.1.1-py3-none-any.whl

Download URL pydantic_ai_trustabl-0.1.1-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cb4b5b1529b4fc69b4d38c12ac286e007869d651dd965007f7f3a45b5996f88
BLAKE2b-256 checksum
How to use checksums
e14f34f1d0a3c76373a4d6d98be4049507d2d58a49eacb0c8b46c01fca6cdf15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Security for pydantic-ai-trustabl 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pydantic_ai_trustabl-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page