Skip to main content

Pinpout Python SDK

Python SDK for the Pinpout Prompt Injection Detection API.

Installation

pip install pinpout

Quick Start

import pinpout

# Uses PINPOUT_API_KEY environment variable
result = pinpout.scan("What is the capital of France?")

if result.is_safe:
    print("Safe to pass to LLM")
else:
    print(f"Injection detected (confidence: {result.confidence})")

Explicit Client

from pinpout import Pinpout

client = Pinpout("pp_live_your_key_here")
result = client.scan("Hello world")

print(result.is_safe)       # True
print(result.confidence)    # 0.98
print(result.scan_id)       # "scan_abc123"

Async

from pinpout import AsyncPinpout

async with AsyncPinpout("pp_live_your_key_here") as client:
    result = await client.scan("Hello world")

Normalized Text

result = client.scan("h3ll0 w0rld", return_normalized=True)
print(result.normalized_text)  # "hello world"

Error Handling

from pinpout import Pinpout, AuthenticationError, RateLimitError

client = Pinpout("pp_live_your_key_here")

try:
    result = client.scan("test")
except AuthenticationError:
    print("Invalid API key")
except RateLimitError as e:
    print(f"Rate limited, retry after {e.retry_after}s")

Configuration

Parameter Env Variable Default
api_key PINPOUT_API_KEY — (required)
base_url PINPOUT_BASE_URL https://api.pinpout.dev
timeout — 30.0

License

MIT

Metadata

Release files for pinpout 0.1.0

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

Source distribution (sdist)

Source distribution for pinpout 0.1.0
File Size Uploaded Provenance Actions
pinpout-0.1.0.tar.gz 5.4 kB Without provenance Details for pinpout-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pinpout 0.1.0
File Interpreter ABI Platform Actions
pinpout-0.1.0-py3-none-any.whl Python 3 none any Details for pinpout-0.1.0-py3-none-any.whl

Total release size: 11.2 kB

Release files / pinpout-0.1.0.tar.gz

Download URL pinpout-0.1.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6f5d7307af4605720093d6359cd57ff913b3db497b609eabef7009311a480480
BLAKE2b-256 checksum
How to use checksums
ba4da4bd55e53d83fad396c263fce66deaafcb461a394d75df2a3f95fa7411f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release files / pinpout-0.1.0-py3-none-any.whl

Download URL pinpout-0.1.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb6d2d86e560200d64646fb4b89866662cfa984cb962fee8276d4ba1098fad25
BLAKE2b-256 checksum
How to use checksums
47323d8aa7df9f0b4c6bd2acecb64ec3a56926416185df5ffc49569d3cf785a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Security for pinpout 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.0 This release

2 release files No 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