Skip to main content

Pinta AI SDK for Python agents

Pinta adds observability, telemetry masking and local tool-call policy evaluation to Python agents. LangChain integration uses middleware; no sidecar is required.

Requirements: Python 3.12 or newer. LangChain integration requires langchain >= 1.0 with create_agent.

The distribution name is pinta-ai-sdk; the Python import remains pinta. It is not the unrelated pinta distribution on PyPI. If you installed an earlier private pinta-ai wheel, uninstall that distribution before installing this one: both use the same Python namespace.

Install

If your application already has a compatible LangChain installation:

python -m pip install pinta-ai-sdk

To install LangChain dependencies as well:

python -m pip install "pinta-ai-sdk[langchain]"

Check the installed version and run the bundled offline self-check:

python -c "import pinta; print(pinta.__version__)"
python -m pinta.selfcheck

The self-check requires LangChain. It uses a deterministic local model and in-memory tools, does not contact a model provider or the Pinta backend, and does not prove that your application's telemetry has reached the management console.

Offline installation into an existing LangChain application

On an internet-connected computer using the same Python minor version as the target server, download the SDK and its dependencies. Replace VERSION with the selected release number:

python -m pip download "pinta-ai-sdk==VERSION" -d sdk --only-binary=:all: --platform any

Transfer the entire sdk directory through your approved file-transfer channel. In the target application's Python environment:

python -m pip install --no-index --find-links=sdk "pinta-ai-sdk==VERSION"
python -m pinta.selfcheck

This path deliberately omits the langchain extra: the application already provides LangChain. --platform any accepts platform-independent wheels only, instead of accidentally downloading a workstation-specific native dependency. Installing or upgrading LangChain itself requires a separate bundle compatible with the server's Python version, operating system and architecture.

Connect an application

Set PINTA_BACKEND_URL and PINTA_API_KEY in the application process using your organization's approved endpoint and secret-management mechanism. Start with PINTA_GUARD_MODE=monitor; switch to enforce only after reviewing policies and normal application behavior.

At process startup, configure Pinta. Add middleware at the agent factory and provide the authenticated application's user identity around each invocation:

from langchain.agents import create_agent
from pinta import PintaSettings, configure, get_runtime, pinta_context
from pinta.langchain import PintaMiddleware

configure(PintaSettings.from_env())
agent = create_agent(model, tools=tools, middleware=[PintaMiddleware()])

async def answer(user, session_id, messages):
    async with pinta_context(
        user_id=user.id, user_email=user.email, session_id=session_id,
    ):
        return await agent.ainvoke({"messages": messages})

# In the application's async shutdown hook:
# await get_runtime().ashutdown()

Here model, tools and user are supplied by your application. Installation alone does not instrument an agent or enable telemetry transmission. Outbound HTTPS to the configured Pinta endpoint is required for export and policy refresh; local evaluation and the self-check do not require that connection.

Scope and limitations

  • Masking protects Pinta telemetry, not original business inputs, tool results or prompts sent to a model provider.
  • monitor evaluates without blocking. enforce blocks DENY and REVIEW before the selected tool handler executes.
  • Policy evaluation errors fail open with diagnostics; masking errors redact the affected telemetry value and are reported as failures.
  • Detection depends on configured policies and supported input shapes. This SDK is not universally equivalent to every TypeScript runtime extractor and does not guarantee detection of every credential or unsafe action.
  • Treat this alpha SDK as a version-pinned integration and validate your own normal and violation cases before enforcement.

MIT licensed. Learn more at pinta.sh.

Release files for pinta-ai-sdk 0.2.2

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

Source distribution (sdist)

Source distribution for pinta-ai-sdk 0.2.2
File Size Uploaded
pinta_ai_sdk-0.2.2.tar.gz 101.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pinta-ai-sdk 0.2.2
File Interpreter ABI Platform
pinta_ai_sdk-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 229.0 kB

Release files / pinta_ai_sdk-0.2.2.tar.gz

Download URL pinta_ai_sdk-0.2.2.tar.gz
Size 101.2 kB
Tags Source
SHA-256 checksum
How to use checksums
29261b6c653f53d69ee28a58a1e1a97dbc5d10791f6c103c2c80a399559a5e63
BLAKE2b-256 checksum
How to use checksums
e9b8a35de4cb8249a6e21414620e3e3acb5eeaf11b09878cb7463068adad5a05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 20, 2026.

Transparency log

Release files / pinta_ai_sdk-0.2.2-py3-none-any.whl

Download URL pinta_ai_sdk-0.2.2-py3-none-any.whl
Size 127.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93153ddcc3fc58102d0b97bf2319a078255a7a0f0c99335a44cd8cae3fb9aac1
BLAKE2b-256 checksum
How to use checksums
344fb8f1b261194c1118868d2cd73a6d4030b16c06f7faf47e5445f13f88132f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 20, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.2 This release

2 release files

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